summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx2
-rw-r--r--Templates/MSBuild/nasm.targets2
-rw-r--r--Tests/VSNASM/CMakeLists.txt2
-rw-r--r--Tests/VSNASM/foo.asm6
4 files changed, 10 insertions, 2 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 857b2892d9..c88679c649 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -3930,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/nasm.targets b/Templates/MSBuild/nasm.targets
index eeeb613b66..ba120852b6 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/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"