From ff3ff01f6fcbf06f683da89609d5910c56fdab84 Mon Sep 17 00:00:00 2001 From: linquize Date: Tue, 4 Jan 2022 16:46:50 +0800 Subject: [PATCH] Fix clang linker problem by defining POCO_NO_AUTOMATIC_LIBS (#3177) --- CppUnit/CMakeLists.txt | 5 +++++ Foundation/CMakeLists.txt | 3 +++ 2 files changed, 8 insertions(+) diff --git a/CppUnit/CMakeLists.txt b/CppUnit/CMakeLists.txt index c367bd2bb..5cc777c61 100644 --- a/CppUnit/CMakeLists.txt +++ b/CppUnit/CMakeLists.txt @@ -22,6 +22,11 @@ target_include_directories(CppUnit PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src ) +if(WIN32) + if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + target_compile_definitions(CppUnit PUBLIC POCO_NO_AUTOMATIC_LIBS) + endif() +endif() if(NOT BUILD_SHARED_LIBS) target_compile_definitions(CppUnit diff --git a/Foundation/CMakeLists.txt b/Foundation/CMakeLists.txt index 6b276bef5..b5b19844d 100644 --- a/Foundation/CMakeLists.txt +++ b/Foundation/CMakeLists.txt @@ -137,6 +137,9 @@ endif() if(WIN32) target_compile_definitions(Foundation PUBLIC POCO_OS_FAMILY_WINDOWS UNICODE _UNICODE) + if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + target_compile_definitions(Foundation PUBLIC POCO_NO_AUTOMATIC_LIBS) + endif() target_link_libraries(Foundation PUBLIC iphlpapi) endif()