Skip to content

Commit

Permalink
fix compilation with newer CMake
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
neheb committed Aug 3, 2023
1 parent 4dfb781 commit 4d2d5f3
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
4 changes: 0 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 0 additions & 6 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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})
Expand Down

0 comments on commit 4d2d5f3

Please sign in to comment.