Skip to content

Commit

Permalink
fix cmake variables
Browse files Browse the repository at this point in the history
  • Loading branch information
ktsaou committed Apr 22, 2024
1 parent 820208d commit 4c1ae30
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
12 changes: 7 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -221,22 +221,24 @@ set(LINUX False)
set(FREEBSD False)
set(MACOS False)

if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
set(MACOS True)
set(COMPILED_FOR_MACOS True)

find_library(IOKIT IOKit)
find_library(FOUNDATION Foundation)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD")
set(FREEBSD True)
set(COMPILED_FOR_FREEBSD True)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
set(LINUX True)
set(COMPILED_FOR_LINUX True)
add_definitions(-D_GNU_SOURCE)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "CYGWIN")
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
set(CYGWIN True)
set(COMPILED_FOR_CYGWIN True)
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "MSYS")
set(MSYS True)
set(COMPILED_FOR_MSYS True)
else()
set(FOREIGN_OS True)
set(COMPILED_FOR_FOREIGN_OS True)
Expand Down
1 change: 1 addition & 0 deletions packaging/cmake/config.cmake.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#cmakedefine COMPILED_FOR_LINUX
#cmakedefine COMPILED_FOR_MACOS
#cmakedefine COMPILED_FOR_CYGWIN
#cmakedefine COMPILED_FOR_MSYS
#cmakedefine COMPILED_FOR_FOREIGN_OS

// checked headers
Expand Down
8 changes: 8 additions & 0 deletions src/daemon/buildinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -1058,6 +1058,14 @@ __attribute__((constructor)) void initialize_build_info(void) {
build_info_set_value(BIB_FEATURE_BUILT_FOR, "MacOS");
build_info_set_status(BIB_PLUGIN_MACOS, true);
#endif
#ifdef COMPILED_FOR_CYGWIN
build_info_set_status(BIB_FEATURE_BUILT_FOR, true);
build_info_set_value(BIB_FEATURE_BUILT_FOR, "Cygwin");
#endif
#ifdef COMPILED_FOR_MSYS
build_info_set_status(BIB_FEATURE_BUILT_FOR, true);
build_info_set_value(BIB_FEATURE_BUILT_FOR, "MSYS");
#endif

#ifdef ENABLE_ACLK
build_info_set_status(BIB_FEATURE_CLOUD, true);
Expand Down
2 changes: 0 additions & 2 deletions src/database/engine/rrdengine.c
Original file line number Diff line number Diff line change
Expand Up @@ -1577,7 +1577,6 @@ static void *cleanup_tp_worker(struct rrdengine_instance *ctx __maybe_unused, vo
wal_cleanup1();
extent_buffer_cleanup1();

#ifdef COMPILED_FOR_FOREIGN_OS
{
static time_t last_run_s = 0;
time_t now_s = now_monotonic_sec();
Expand All @@ -1586,7 +1585,6 @@ static void *cleanup_tp_worker(struct rrdengine_instance *ctx __maybe_unused, vo
journalfile_v2_data_unmount_cleanup(now_s);
}
}
#endif

#ifdef PDC_USE_JULYL
julyl_cleanup1();
Expand Down

0 comments on commit 4c1ae30

Please sign in to comment.