summaryrefslogtreecommitdiff
path: root/Tests/Module/CheckIPOSupported-CXX/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/Module/CheckIPOSupported-CXX/CMakeLists.txt')
-rw-r--r--Tests/Module/CheckIPOSupported-CXX/CMakeLists.txt15
1 files changed, 13 insertions, 2 deletions
diff --git a/Tests/Module/CheckIPOSupported-CXX/CMakeLists.txt b/Tests/Module/CheckIPOSupported-CXX/CMakeLists.txt
index 1bb2b8496..237bf1d6d 100644
--- a/Tests/Module/CheckIPOSupported-CXX/CMakeLists.txt
+++ b/Tests/Module/CheckIPOSupported-CXX/CMakeLists.txt
@@ -12,9 +12,20 @@ elseif(CMake_TEST_IPO_WORKS_CXX)
message(FATAL_ERROR "IPO expected to work, but the check failed:\n ${ipo_output}")
endif()
-add_library(foo foo.cpp)
+
+add_library(foo STATIC foo.cpp)
+if(NOT CYGWIN AND (NOT WIN32 OR "x${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang"))
+ add_library(bar SHARED bar.cpp)
+ 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.cpp)
+endif()
add_executable(CheckIPOSupported-CXX main.cpp)
-target_link_libraries(CheckIPOSupported-CXX PUBLIC foo)
+target_link_libraries(CheckIPOSupported-CXX PUBLIC foo bar)
enable_testing()
add_test(NAME CheckIPOSupported-CXX COMMAND CheckIPOSupported-CXX)