diff options
author | Brad King <brad.king@kitware.com> | 2020-01-31 19:33:04 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-01-31 19:37:34 (GMT) |
commit | 97de48b52899007e3ecfb988bddff8a8d9b70110 (patch) | |
tree | 0a409a083624a9e10b7661b2048ba8040a03e88f /Tests | |
parent | 6348ffb9e55c5e84b9bc65d4d97a2f6b6f016edc (diff) | |
download | CMake-97de48b52899007e3ecfb988bddff8a8d9b70110.zip CMake-97de48b52899007e3ecfb988bddff8a8d9b70110.tar.gz CMake-97de48b52899007e3ecfb988bddff8a8d9b70110.tar.bz2 |
Tests: Update Assembler code generation to select MSVC runtime library
The `Assembler` test runs the C compiler in a custom command to generate
a `.s` file for the platform. When using the GNU-like Clang variant on
Windows, ensure that the custom command includes the MSVC runtime
library selection flags for Clang. That way the resulting `.s` file,
when assembled into a `.obj`, will tell the linker what runtime library
it needs.
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/Assembler/CMakeLists.txt | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Tests/Assembler/CMakeLists.txt b/Tests/Assembler/CMakeLists.txt index 21b265c..a3c9946 100644 --- a/Tests/Assembler/CMakeLists.txt +++ b/Tests/Assembler/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.6) +cmake_minimum_required (VERSION 3.8) project(Assembler C) message("CTEST_FULL_OUTPUT ") set(CMAKE_VERBOSE_MAKEFILE 1) @@ -22,7 +22,11 @@ if("${CMAKE_GENERATOR}" MATCHES "Makefile|Xcode|Ninja" AND set(SRCS main.s) add_custom_command( OUTPUT main.s - COMMAND ${CMAKE_C_COMPILER} ${C_FLAGS} -S ${CMAKE_CURRENT_SOURCE_DIR}/main.c -o main.s + COMMAND ${CMAKE_C_COMPILER} ${C_FLAGS} + "$<$<CONFIG:Debug>:${CMAKE_C_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebugDLL}>" + "$<$<NOT:$<CONFIG:Debug>>:${CMAKE_C_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDLL}>" + -S ${CMAKE_CURRENT_SOURCE_DIR}/main.c -o main.s + COMMAND_EXPAND_LISTS DEPENDS main.c VERBATIM ) |