fix(cmake): Add back missing compiler definitions for static_build in the generated CMake files

This commit is contained in:
Matej Kenda 2025-02-07 13:05:34 +01:00
parent f32e3d0b90
commit 0434c41ad5
2 changed files with 9 additions and 1 deletions

View File

@ -28,6 +28,8 @@ if(WIN32)
endif() endif()
endif() endif()
if(BUILD_SHARED_LIBS AND MINGW) if(NOT BUILD_SHARED_LIBS)
target_compile_definitions(CppUnit PUBLIC POCO_STATIC)
elseif (MINGW)
target_compile_definitions(CppUnit PUBLIC _DLL) target_compile_definitions(CppUnit PUBLIC _DLL)
endif() endif()

View File

@ -128,6 +128,12 @@ if(NOT DISABLE_CPP14 AND CMAKE_VERSION VERSION_GREATER "3.8")
target_compile_features(Foundation PUBLIC cxx_std_14) target_compile_features(Foundation PUBLIC cxx_std_14)
endif() endif()
if(NOT BUILD_SHARED_LIBS)
# The define must be set here to be included in the generated CMake files
# and properly detect build in the installed files.
target_compile_definitions(Foundation PUBLIC POCO_STATIC)
endif()
if(WIN32) if(WIN32)
target_compile_definitions(Foundation PUBLIC POCO_OS_FAMILY_WINDOWS UNICODE _UNICODE) target_compile_definitions(Foundation PUBLIC POCO_OS_FAMILY_WINDOWS UNICODE _UNICODE)
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")