summaryrefslogtreecommitdiff
path: root/Tests/Assembler
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-01-31 14:33:04 -0500
committerBrad King <brad.king@kitware.com>2020-01-31 14:37:34 -0500
commit97de48b52899007e3ecfb988bddff8a8d9b70110 (patch)
tree0a409a083624a9e10b7661b2048ba8040a03e88f /Tests/Assembler
parent6348ffb9e55c5e84b9bc65d4d97a2f6b6f016edc (diff)
downloadcmake-97de48b52899007e3ecfb988bddff8a8d9b70110.tar.gz
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/Assembler')
-rw-r--r--Tests/Assembler/CMakeLists.txt8
1 files changed, 6 insertions, 2 deletions
diff --git a/Tests/Assembler/CMakeLists.txt b/Tests/Assembler/CMakeLists.txt
index 21b265cea4..a3c99466ef 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
)