diff --git a/CMakeLists.txt b/CMakeLists.txt index eb7e2e0d6c..de4b500c88 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -246,6 +246,10 @@ set(MEMORYCHECK_COMMAND_OPTIONS "--track-origins=yes --leak-check=full --trace-c # library so we can actually build the tests. option(BUILD_TESTING "Build the testing tree." OFF) +# For special-purpose builds it can be useful to export all symbols from the library, +# like we do when building the tests. +option(EXPORT_ALL_SYMBOLS "Export all symbols from the library." OFF) + # Include the xtests for idlc. These tests use the idl compiler (C back-end) to # compile an idl file at (test) runtime, and use the C compiler to build a test # application for the generated types, that is executed to do the actual testing. diff --git a/fuzz/oss-fuzz-build.sh b/fuzz/oss-fuzz-build.sh index 29176988ea..1aa8942713 100644 --- a/fuzz/oss-fuzz-build.sh +++ b/fuzz/oss-fuzz-build.sh @@ -18,7 +18,7 @@ mkdir build cd build cmake \ -DBUILD_IDLC=ON \ - -DBUILD_TESTING=ON \ + -DEXPORT_ALL_SYMBOLS=ON \ -DBUILD_SHARED_LIBS=OFF \ -DBUILD_EXAMPLES=NO \ -DENABLE_SECURITY=NO \ diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index a37f837212..d4d23a49f5 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -13,7 +13,7 @@ include (GenerateExportHeader) add_library(ddsc) -if(BUILD_TESTING) +if(BUILD_TESTING OR EXPORT_ALL_SYMBOLS) set_property(TARGET ddsc PROPERTY WINDOWS_EXPORT_ALL_SYMBOLS TRUE) else() set_property(TARGET ddsc PROPERTY C_VISIBILITY_PRESET hidden)