summaryrefslogtreecommitdiff
path: root/Tests/VSNASM
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-01-26 12:57:53 -0500
committerBrad King <brad.king@kitware.com>2023-01-26 13:51:49 -0500
commit24bcad5bace42f4ec8ce8d3bc5994581918f81c5 (patch)
tree2c438b9476b9a29aa70e40aa79a760ec9fb623e4 /Tests/VSNASM
parentb44714a6429c48c2cabe53fce100bc20c6f8fbfc (diff)
downloadcmake-24bcad5bace42f4ec8ce8d3bc5994581918f81c5.tar.gz
VS: Honor compile options for ASM_NASM
The Ninja and Makefile generators honor `target_compile_options` and friends for ASM_NASM `.asm` sources. Teach the VS generator to honor them too for consistency. Issue: #24289
Diffstat (limited to 'Tests/VSNASM')
-rw-r--r--Tests/VSNASM/CMakeLists.txt2
-rw-r--r--Tests/VSNASM/foo.asm6
2 files changed, 7 insertions, 1 deletions
diff --git a/Tests/VSNASM/CMakeLists.txt b/Tests/VSNASM/CMakeLists.txt
index 821d0227e3..a038ddd882 100644
--- a/Tests/VSNASM/CMakeLists.txt
+++ b/Tests/VSNASM/CMakeLists.txt
@@ -18,3 +18,5 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/bar baz.asm" "${BAR_ASM_CONTENTS}")
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
add_executable(VSNASM main.c foo.asm "${CMAKE_CURRENT_BINARY_DIR}/bar baz.asm")
+target_compile_definitions(VSNASM PRIVATE DEF_FOO)
+target_compile_options(VSNASM PRIVATE "$<$<COMPILE_LANGUAGE:ASM_NASM>:-t>")
diff --git a/Tests/VSNASM/foo.asm b/Tests/VSNASM/foo.asm
index aba0673c01..cbfe14b44b 100644
--- a/Tests/VSNASM/foo.asm
+++ b/Tests/VSNASM/foo.asm
@@ -1,7 +1,11 @@
+%ifndef DEF_FOO
+%error "DEF_FOO incorrectly not defined"
+%endif
section .text
%ifdef TEST2x64
global foo
%else
global _foo
%endif
-%include "foo-proc.asm"
+;TASM compatibility mode allows 'include' instead of '%include'
+include "foo-proc.asm"