diff --git a/CMakeLists.txt b/CMakeLists.txt index d617e387..b4c457b4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,6 +3,8 @@ project(putty LANGUAGES C) include(cmake/setup.cmake) +add_compile_definitions(HAVE_CMAKE_H) + add_library(utils STATIC utils/base64_decode_atom.c utils/base64_encode_atom.c @@ -161,8 +163,6 @@ add_executable(test_wildcard target_compile_definitions(test_wildcard PRIVATE TEST) target_link_libraries(test_wildcard utils ${platform_libraries}) -add_compile_definitions(HAVE_CMAKE_H) - foreach(subdir ${PLATFORM_SUBDIRS}) add_subdirectory(${subdir}) endforeach() diff --git a/defs.h b/defs.h index f175d257..b8205c10 100644 --- a/defs.h +++ b/defs.h @@ -22,6 +22,10 @@ #error Do not compile this code base with NDEBUG defined! #endif +#if HAVE_CMAKE_H +#include "cmake.h" +#endif + #include #include #include /* for __MINGW_PRINTF_FORMAT */ diff --git a/unix/platform.h b/unix/platform.h index 8f24b893..62f86a74 100644 --- a/unix/platform.h +++ b/unix/platform.h @@ -5,10 +5,6 @@ #ifndef PUTTY_UNIX_PLATFORM_H #define PUTTY_UNIX_PLATFORM_H -#if HAVE_CMAKE_H -#include "cmake.h" -#endif - #include /* for FILENAME_MAX */ #include /* C99 int types */ #ifndef NO_LIBDL diff --git a/windows/platform.h b/windows/platform.h index 8fadf803..cd89d411 100644 --- a/windows/platform.h +++ b/windows/platform.h @@ -5,10 +5,6 @@ #ifndef PUTTY_WINDOWS_PLATFORM_H #define PUTTY_WINDOWS_PLATFORM_H -#if HAVE_CMAKE_H -#include "cmake.h" -#endif - #include #include #include /* for FILENAME_MAX */