Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix PluginsTests failure on Windows buildbots by enabling it everywhere
lit is picking up a stale executable in the unittests tree, which is failing on Windows. To simplify the CMake and avoid problems like this in the future, now we always compile the test, but the test exits successfully when plugins are not enabled. llvm-svn: 330867
- Loading branch information
Showing
2 changed files
with
26 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,30 @@ | ||
set(LLVM_LINK_COMPONENTS Support Passes Core) | ||
|
||
# If plugins are disabled, this test will disable itself at runtime. Otherwise, | ||
# reconfiguring with plugins disabled will leave behind a stale executable. | ||
if (LLVM_ENABLE_PLUGINS) | ||
add_llvm_unittest(PluginsTests PluginsTest.cpp) | ||
export_executable_symbols(PluginsTests) | ||
add_definitions(-DLLVM_ENABLE_PLUGINS) | ||
endif() | ||
|
||
add_library(TestPlugin MODULE TestPlugin.cxx) | ||
add_llvm_unittest(PluginsTests PluginsTest.cpp) | ||
export_executable_symbols(PluginsTests) | ||
|
||
set_output_directory(TestPlugin | ||
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR} | ||
LIBRARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR} | ||
) | ||
add_library(TestPlugin MODULE TestPlugin.cxx) | ||
|
||
set_target_properties(TestPlugin | ||
PROPERTIES PREFIX "" | ||
SUFFIX ".so" | ||
) | ||
set_output_directory(TestPlugin | ||
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR} | ||
LIBRARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR} | ||
) | ||
|
||
if (WIN32 OR CYGWIN OR LLVM_EXPORT_SYMBOLS_FOR_PLUGINS) | ||
llvm_map_components_to_libnames(LLVM_DEPS ${LLVM_LINK_COMPONENTS}) | ||
target_link_libraries(TestPlugin ${LLVM_DEPS}) | ||
endif() | ||
set_target_properties(TestPlugin | ||
PROPERTIES PREFIX "" | ||
SUFFIX ".so" | ||
) | ||
|
||
add_dependencies(TestPlugin intrinsics_gen) | ||
add_dependencies(PluginsTests TestPlugin) | ||
if (WIN32 OR CYGWIN OR LLVM_EXPORT_SYMBOLS_FOR_PLUGINS) | ||
llvm_map_components_to_libnames(LLVM_DEPS ${LLVM_LINK_COMPONENTS}) | ||
target_link_libraries(TestPlugin ${LLVM_DEPS}) | ||
endif() | ||
|
||
add_dependencies(TestPlugin intrinsics_gen) | ||
add_dependencies(PluginsTests TestPlugin) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters