summaryrefslogtreecommitdiffstats
path: root/Tests/Module/CheckIPOSupported-C/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/Module/CheckIPOSupported-C/CMakeLists.txt')
-rw-r--r--Tests/Module/CheckIPOSupported-C/CMakeLists.txt12
1 files changed, 11 insertions, 1 deletions
diff --git a/Tests/Module/CheckIPOSupported-C/CMakeLists.txt b/Tests/Module/CheckIPOSupported-C/CMakeLists.txt
index 4a41a98..c5cd03e 100644
--- a/Tests/Module/CheckIPOSupported-C/CMakeLists.txt
+++ b/Tests/Module/CheckIPOSupported-C/CMakeLists.txt
@@ -13,8 +13,18 @@ elseif(CMake_TEST_IPO_WORKS_C)
endif()
add_library(foo foo.c)
+if(NOT CYGWIN AND (NOT WIN32 OR "x${CMAKE_C_COMPILER_ID}" STREQUAL "xClang"))
+ add_library(bar SHARED bar.c)
+ if(WIN32)
+ # Bindexplib for clang supports LTO objects
+ set_target_properties(bar PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON)
+ endif()
+else()
+ # TODO: bindexplib doesn't support exporting IPO symbols with other compilers on Windows
+ add_library(bar STATIC bar.c)
+endif()
add_executable(CheckIPOSupported-C main.c)
-target_link_libraries(CheckIPOSupported-C PUBLIC foo)
+target_link_libraries(CheckIPOSupported-C PUBLIC foo bar)
enable_testing()
add_test(NAME CheckIPOSupported-C COMMAND CheckIPOSupported-C)