From 2e18f636fd39b59a85194c2a8f10732138a0f8ec Mon Sep 17 00:00:00 2001 From: Lang Hames Date: Thu, 12 Sep 2024 15:10:30 +1000 Subject: [PATCH] Fix some unit tests for LLVM_ENABLE_EXPORTED_SYMBOLS_IN_EXECUTABLES=Off. Building with -DLLVM_ENABLE_EXPORTED_SYMBOLS_IN_EXECUTABLES=Off should not prevent the PluginsTests and DynamicLibraryTests unit tests from working. This fix uses the approach implemented in https://github.com/llvm/llvm-project/pull/101741. rdar://135849875 --- llvm/unittests/Passes/Plugins/CMakeLists.txt | 3 ++- llvm/unittests/Support/DynamicLibrary/CMakeLists.txt | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/llvm/unittests/Passes/Plugins/CMakeLists.txt b/llvm/unittests/Passes/Plugins/CMakeLists.txt index e90cae167bc2..9fd543db39c8 100644 --- a/llvm/unittests/Passes/Plugins/CMakeLists.txt +++ b/llvm/unittests/Passes/Plugins/CMakeLists.txt @@ -6,8 +6,9 @@ if (NOT WIN32 AND NOT CYGWIN) set(LLVM_LINK_COMPONENTS Support Passes Core AsmParser) add_llvm_unittest(PluginsTests PluginsTest.cpp + + EXPORT_SYMBOLS ) - export_executable_symbols_for_plugins(PluginsTests) target_link_libraries(PluginsTests PRIVATE LLVMTestingSupport) unset(LLVM_LINK_COMPONENTS) diff --git a/llvm/unittests/Support/DynamicLibrary/CMakeLists.txt b/llvm/unittests/Support/DynamicLibrary/CMakeLists.txt index e976cba23ee8..d8dff1ef4a3f 100644 --- a/llvm/unittests/Support/DynamicLibrary/CMakeLists.txt +++ b/llvm/unittests/Support/DynamicLibrary/CMakeLists.txt @@ -17,9 +17,10 @@ set_output_directory(DynamicLibraryLib add_llvm_unittest(DynamicLibraryTests DynamicLibraryTest.cpp + + EXPORT_SYMBOLS ) target_link_libraries(DynamicLibraryTests PRIVATE DynamicLibraryLib) -export_executable_symbols(DynamicLibraryTests) function(dynlib_add_module NAME) add_library(${NAME} MODULE