summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-01-27 15:29:34 (GMT)
committerKitware Robot <kwrobot@kitware.com>2023-01-27 15:29:44 (GMT)
commit77074c3eb5c2699079bbb86c8393816f71b75d82 (patch)
treee5ea2252d1c420bdb3e9c0105a413db09e243390
parenteabc3c64e8543769ed8a11f3303bf6d2801af7d5 (diff)
parent24bcad5bace42f4ec8ce8d3bc5994581918f81c5 (diff)
downloadCMake-77074c3eb5c2699079bbb86c8393816f71b75d82.zip
CMake-77074c3eb5c2699079bbb86c8393816f71b75d82.tar.gz
CMake-77074c3eb5c2699079bbb86c8393816f71b75d82.tar.bz2
Merge topic 'vs-asm-flags'
24bcad5bac VS: Honor compile options for ASM_NASM b44714a642 VS: Honor compile options for ASM_MARMASM Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8125
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx4
-rw-r--r--Templates/MSBuild/FlagTables/v10_MARMASM.json9
-rw-r--r--Templates/MSBuild/nasm.targets2
-rw-r--r--Tests/VSMARMASM/CMakeLists.txt3
-rw-r--r--Tests/VSMARMASM/foo.asm2
-rw-r--r--Tests/VSNASM/CMakeLists.txt2
-rw-r--r--Tests/VSNASM/foo.asm6
7 files changed, 16 insertions, 12 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 7b3f348..c88679c 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/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);
@@ -3928,6 +3930,8 @@ bool cmVisualStudio10TargetGenerator::ComputeNasmOptions(
this->LocalGenerator->AddLanguageFlags(flags, this->GeneratorTarget,
cmBuildStep::Compile, "ASM_NASM",
configName);
+ this->LocalGenerator->AddCompileOptions(flags, this->GeneratorTarget,
+ "ASM_NASM", configName);
flags += " -f";
flags += this->Makefile->GetSafeDefinition("CMAKE_ASM_NASM_OBJECT_FORMAT");
nasmOptions.Parse(flags);
diff --git a/Templates/MSBuild/FlagTables/v10_MARMASM.json b/Templates/MSBuild/FlagTables/v10_MARMASM.json
index 8d09574..90668ba 100644
--- a/Templates/MSBuild/FlagTables/v10_MARMASM.json
+++ b/Templates/MSBuild/FlagTables/v10_MARMASM.json
@@ -120,15 +120,6 @@
"flags": []
},
{
- "name": "PredefineDirective",
- "switch": "predefine",
- "comment": "Specify a SETA, SETL, or SETS directive to predefine a symbol.",
- "value": "",
- "flags": [
- "UserValue"
- ]
- },
- {
"name": "SourceLink",
"switch": "sourcelink",
"comment": "Specify the configuration file that contains a simple mapping of local file paths to URLs for source files to display in the debugger.",
diff --git a/Templates/MSBuild/nasm.targets b/Templates/MSBuild/nasm.targets
index eeeb613..ba12085 100644
--- a/Templates/MSBuild/nasm.targets
+++ b/Templates/MSBuild/nasm.targets
@@ -30,7 +30,7 @@
</ItemGroup>
<Message Importance="High" Text="%(NASM.ExecutionDescription)"/>
<WriteLinesToFile Condition="'@(NASM_tlog)' != '' and '%(NASM_tlog.ExcludedFromBuild)' != 'true'" File="$(IntDir)$(ProjectName).write.1.tlog" Lines="^%(NASM_tlog.Source);@(NASM_tlog-&gt;'%(Fullpath)')"/>
- <NASM Condition="'@(NASM)' != '' and '%(NASM.ExcludedFromBuild)' != 'true'" Inputs="%(NASM.Inputs)" OutputFormat="%(NASM.OutputFormat)" Outputswitch="%(NASM.Outputswitch)" AssembledCodeListingFile="%(NASM.AssembledCodeListingFile)" GenerateDebugInformation="%(NASM.GenerateDebugInformation)" ErrorReporting="%(NASM.ErrorReporting)" IncludePaths="%(NASM.IncludePaths)" PreprocessorDefinitions="%(NASM.PreprocessorDefinitions)" UndefinePreprocessorDefinitions="%(NASM.UndefinePreprocessorDefinitions)" ErrorReportingFormat="%(NASM.ErrorReportingFormat)" TreatWarningsAsErrors="%(NASM.TreatWarningsAsErrors)" floatunderflow="%(NASM.floatunderflow)" macrodefaults="%(NASM.macrodefaults)" user="%(NASM.user)" floatoverflow="%(NASM.floatoverflow)" floatdenorm="%(NASM.floatdenorm)" numberoverflow="%(NASM.numberoverflow)" macroselfref="%(NASM.macroselfref)" floattoolong="%(NASM.floattoolong)" orphanlabels="%(NASM.orphanlabels)" CommandLineTemplate="%(NASM.CommandLineTemplate)" AdditionalOptions="%(NASM.AdditionalOptions)"/>
+ <NASM Condition="'@(NASM)' != '' and '%(NASM.ExcludedFromBuild)' != 'true'" Inputs="%(NASM.Inputs)" OutputFormat="%(NASM.OutputFormat)" Outputswitch="%(NASM.Outputswitch)" tasmmode="%(NASM.tasmmode)" AssembledCodeListingFile="%(NASM.AssembledCodeListingFile)" GenerateDebugInformation="%(NASM.GenerateDebugInformation)" ErrorReporting="%(NASM.ErrorReporting)" IncludePaths="%(NASM.IncludePaths)" PreprocessorDefinitions="%(NASM.PreprocessorDefinitions)" UndefinePreprocessorDefinitions="%(NASM.UndefinePreprocessorDefinitions)" ErrorReportingFormat="%(NASM.ErrorReportingFormat)" TreatWarningsAsErrors="%(NASM.TreatWarningsAsErrors)" floatunderflow="%(NASM.floatunderflow)" macrodefaults="%(NASM.macrodefaults)" user="%(NASM.user)" floatoverflow="%(NASM.floatoverflow)" floatdenorm="%(NASM.floatdenorm)" numberoverflow="%(NASM.numberoverflow)" macroselfref="%(NASM.macroselfref)" floattoolong="%(NASM.floattoolong)" orphanlabels="%(NASM.orphanlabels)" CommandLineTemplate="%(NASM.CommandLineTemplate)" AdditionalOptions="%(NASM.AdditionalOptions)"/>
</Target>
<Target Name="ComputeNASMOutput" Condition="'@(NASM)' != ''">
<ItemGroup>
diff --git a/Tests/VSMARMASM/CMakeLists.txt b/Tests/VSMARMASM/CMakeLists.txt
index 6d78e04..85740de 100644
--- a/Tests/VSMARMASM/CMakeLists.txt
+++ b/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\">"
+ )
diff --git a/Tests/VSMARMASM/foo.asm b/Tests/VSMARMASM/foo.asm
index e5b2775..44656ef 100644
--- a/Tests/VSMARMASM/foo.asm
+++ b/Tests/VSMARMASM/foo.asm
@@ -3,7 +3,7 @@
EXPORT foo
foo PROC
- mov w0, #0
+ mov w0, #zero
ret
ENDP
diff --git a/Tests/VSNASM/CMakeLists.txt b/Tests/VSNASM/CMakeLists.txt
index 821d022..a038ddd 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 aba0673..cbfe14b 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"