diff --git a/apps/CMakeLists.txt b/apps/CMakeLists.txt index 87bb4c9..52a039b 100644 --- a/apps/CMakeLists.txt +++ b/apps/CMakeLists.txt @@ -94,6 +94,9 @@ endif() # end "standalone mode" block # --------------------------------- +# Check whether getopt.h exists +check_include_file(getopt.h HAVE_GETOPT_H) + check_include_file(sys/resource.h HAVE_SYS_RESOURCE_H) # for getrusage if (HAVE_SYS_RESOURCE_H) check_symbol_exists(getrusage "sys/resource.h" HAVE_GETRUSAGE) diff --git a/apps/json_parse.c b/apps/json_parse.c index c6c7728..3f8ef00 100644 --- a/apps/json_parse.c +++ b/apps/json_parse.c @@ -1,7 +1,9 @@ #include #include #include +#ifdef HAVE_GETOPT_H #include +#endif #include #include #include