From 4d2d5f36730a5827e01f033cae9a9ff9ad9ec9b7 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Wed, 2 Aug 2023 11:19:08 -0700 Subject: [PATCH] fix compilation with newer CMake It seems CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS on CMake 3.27 breaks compilation on Windows. The reason for it here is wrong: unit tests do not need non exported symbols. --- CMakeLists.txt | 4 ---- src/CMakeLists.txt | 6 ------ 2 files changed, 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e2a27ce6..9d819e0f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -79,10 +79,6 @@ if ( EXIV2_ENABLE_EXTERNAL_XMP ) set(EXIV2_ENABLE_XMP OFF) endif() -if(BUILD_TESTING AND EXIV2_BUILD_UNIT_TESTS) - set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) # Requires CMake 3.3.3 -endif() - include(cmake/findDependencies.cmake REQUIRED) include(cmake/compilerFlags.cmake REQUIRED) include(cmake/generateConfigFile.cmake REQUIRED) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a9ddab4f..24009161 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,9 +1,3 @@ -# Note that this is a hack for testing the internals of the library. If EXIV2_BUILD_UNIT_TESTS==OFF -# Then we only export the symbols that are explicitly exported -if(BUILD_TESTING AND EXIV2_BUILD_UNIT_TESTS) - set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) # Requires CMake 3.3.3 -endif() - include(CMakePackageConfigHelpers) include_directories(${CMAKE_CURRENT_BINARY_DIR})