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
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user