VS: Honor compile options for MASM

The Ninja and Makefile generators honor `target_compile_options`
and friends for MASM `.asm` sources.  Teach the VS generator to
honor them too for consistency.

Fixes: #24289
This commit is contained in:
Brad King 2023-01-12 14:35:38 -05:00
parent e4c281e451
commit 81f670fa83
3 changed files with 10 additions and 0 deletions

View File

@ -3867,6 +3867,8 @@ bool cmVisualStudio10TargetGenerator::ComputeMasmOptions(
this->LocalGenerator->AddLanguageFlags(flags, this->GeneratorTarget,
cmBuildStep::Compile, "ASM_MASM",
configName);
this->LocalGenerator->AddCompileOptions(flags, this->GeneratorTarget,
"ASM_MASM", configName);
masmOptions.Parse(flags);

View File

@ -8,3 +8,5 @@ else()
endif()
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
add_executable(VSMASM main.c foo.asm)
target_compile_definitions(VSMASM PUBLIC DEF_FOO)
target_compile_options(VSMASM PUBLIC -DDEF_BAR)

View File

@ -1,3 +1,9 @@
ifndef DEF_FOO
.err <DEF_FOO incorrectly not defined>
endif
ifndef DEF_BAR
.err <DEF_BAR incorrectly not defined>
endif
ifndef TESTx64
.386
.model flat, c