diff options
author | Robert Maynard <robert.maynard@kitware.com> | 2020-09-10 17:21:07 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-09-10 20:15:55 (GMT) |
commit | 8de145cae18a8c368ffce60c511d6f6424c55aa2 (patch) | |
tree | 8dc8edb70a2e53e7f1096f28e8fcbe66e7cd2ce9 /Tests/ISPC/DynamicLibrary/CMakeLists.txt | |
parent | a83521e082f11fd08027e0f440408914bd83a5eb (diff) | |
download | CMake-8de145cae18a8c368ffce60c511d6f6424c55aa2.zip CMake-8de145cae18a8c368ffce60c511d6f6424c55aa2.tar.gz CMake-8de145cae18a8c368ffce60c511d6f6424c55aa2.tar.bz2 |
ISPC: DynamicLibrary test now passes on windows.
The MSVC linker needs to know what MSVC runtime a shared library
needs. ISPC objects don't have a '/DIRECTIVE' entry for the
MSVC runtime as they have no dependency on it. Therefore
we need to add a C or C++ source to each shared library so
the MSVC linker knows what runtime to embed
Diffstat (limited to 'Tests/ISPC/DynamicLibrary/CMakeLists.txt')
-rw-r--r-- | Tests/ISPC/DynamicLibrary/CMakeLists.txt | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Tests/ISPC/DynamicLibrary/CMakeLists.txt b/Tests/ISPC/DynamicLibrary/CMakeLists.txt index cbfbb3e..4655090 100644 --- a/Tests/ISPC/DynamicLibrary/CMakeLists.txt +++ b/Tests/ISPC/DynamicLibrary/CMakeLists.txt @@ -9,12 +9,14 @@ endif() add_library(ispc_objects1 STATIC extra.ispc extra.cxx) add_library(ispc_objects2 SHARED simple.ispc) +target_sources(ispc_objects2 PRIVATE simple.cxx) set_target_properties(ispc_objects1 PROPERTIES POSITION_INDEPENDENT_CODE ON) + set_target_properties(ispc_objects1 PROPERTIES ISPC_INSTRUCTION_SETS "sse2-i32x4;avx1-i32x16;avx2-i32x4") set_target_properties(ispc_objects2 PROPERTIES ISPC_INSTRUCTION_SETS "sse2-i32x4") -target_link_libraries(ispc_objects2 PRIVATE ispc_objects1) +target_link_libraries(ispc_objects2 PUBLIC ispc_objects1) add_executable(ISPCDynamicLibrary main.cxx) target_link_libraries(ISPCDynamicLibrary PUBLIC ispc_objects2) |