Переглянути джерело

VS: Honor compile options for ASM_MARMASM

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

Issue: #24289
Brad King 2 роки тому
батько
коміт
b44714a642

+ 2 - 0
Source/cmVisualStudio10TargetGenerator.cxx

@@ -3822,6 +3822,8 @@ bool cmVisualStudio10TargetGenerator::ComputeMarmasmOptions(
   this->LocalGenerator->AddLanguageFlags(flags, this->GeneratorTarget,
                                          cmBuildStep::Compile, "ASM_MARMASM",
                                          configName);
+  this->LocalGenerator->AddCompileOptions(flags, this->GeneratorTarget,
+                                          "ASM_MARMASM", configName);
 
   marmasmOptions.Parse(flags);
 

+ 0 - 9
Templates/MSBuild/FlagTables/v10_MARMASM.json

@@ -119,15 +119,6 @@
     "value": "true",
     "flags": []
   },
-  {
-    "name": "PredefineDirective",
-    "switch": "predefine",
-    "comment": "Specify a SETA, SETL, or SETS directive to predefine a symbol.",
-    "value": "",
-    "flags": [
-      "UserValue"
-    ]
-  },
   {
     "name": "SourceLink",
     "switch": "sourcelink",

+ 3 - 0
Tests/VSMARMASM/CMakeLists.txt

@@ -1,3 +1,6 @@
 cmake_minimum_required(VERSION 3.25) # Enable CMP0141
 project(VSMARMASM C ASM_MARMASM)
 add_executable(VSMARMASM main.c foo.asm)
+target_compile_options(VSMARMASM PRIVATE
+  "$<$<COMPILE_LANGUAGE:ASM_MARMASM>:SHELL:-predefine \"zero SETA 0\">"
+  )

+ 1 - 1
Tests/VSMARMASM/foo.asm

@@ -3,7 +3,7 @@
     EXPORT foo
 
 foo PROC
-    mov w0, #0
+    mov w0, #zero
     ret
     ENDP