summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-12-16 13:55:12 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-12-16 13:55:22 (GMT)
commit9be0cdc22f8e696d3898446a53f4527c78ff2cbc (patch)
tree29eebd44538560c776220476822d27ca02350d1f
parentd293320228e1d64f2909b9a6e49d7744a2c500f7 (diff)
parent64303b97438a15691c29e30a089a63c7447b6b21 (diff)
downloadCMake-9be0cdc22f8e696d3898446a53f4527c78ff2cbc.zip
CMake-9be0cdc22f8e696d3898446a53f4527c78ff2cbc.tar.gz
CMake-9be0cdc22f8e696d3898446a53f4527c78ff2cbc.tar.bz2
Merge topic 'masm-debug-format'
64303b9743 ASM_MARMASM: Fix VS flag table entry for debug flag 5f8e4de696 ASM_MARMASM: Populate MSVC debug information format abstraction table f62a0f53bf Merge branch 'backport-masm-debug-format' into masm-debug-format a9bd1e34ef VS: Do not enable ASM_MASM debug information unless requested 98ba122a30 ASM_MASM: Populate MSVC debug information format abstraction table Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !8022
-rw-r--r--Modules/CMakeASM_MARMASMInformation.cmake4
-rw-r--r--Modules/CMakeASM_MASMInformation.cmake4
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx4
-rw-r--r--Templates/MSBuild/FlagTables/v10_MARMASM.json2
-rw-r--r--Tests/VSMARMASM/CMakeLists.txt2
-rw-r--r--Tests/VSMASM/CMakeLists.txt2
6 files changed, 15 insertions, 3 deletions
diff --git a/Modules/CMakeASM_MARMASMInformation.cmake b/Modules/CMakeASM_MARMASMInformation.cmake
index ac81097..2026c17 100644
--- a/Modules/CMakeASM_MARMASMInformation.cmake
+++ b/Modules/CMakeASM_MARMASMInformation.cmake
@@ -16,5 +16,9 @@ set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDL
set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebug "")
set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebugDLL "")
+set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OPTIONS_MSVC_DEBUG_INFORMATION_FORMAT_Embedded "-g")
+set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OPTIONS_MSVC_DEBUG_INFORMATION_FORMAT_ProgramDatabase "")
+set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OPTIONS_MSVC_DEBUG_INFORMATION_FORMAT_EditAndContinue "")
+
include(CMakeASMInformation)
set(ASM_DIALECT)
diff --git a/Modules/CMakeASM_MASMInformation.cmake b/Modules/CMakeASM_MASMInformation.cmake
index 656b75e..11b83662 100644
--- a/Modules/CMakeASM_MASMInformation.cmake
+++ b/Modules/CMakeASM_MASMInformation.cmake
@@ -16,5 +16,9 @@ set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDL
set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebug "")
set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebugDLL "")
+set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OPTIONS_MSVC_DEBUG_INFORMATION_FORMAT_Embedded "-Zi")
+set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OPTIONS_MSVC_DEBUG_INFORMATION_FORMAT_ProgramDatabase "")
+set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OPTIONS_MSVC_DEBUG_INFORMATION_FORMAT_EditAndContinue "")
+
include(CMakeASMInformation)
set(ASM_DIALECT)
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index f5396f4..1f45ce3 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -3859,6 +3859,10 @@ bool cmVisualStudio10TargetGenerator::ComputeMasmOptions(
this->LocalGenerator, Options::MasmCompiler, gg->GetMasmFlagTable());
Options& masmOptions = *pOptions;
+ // MSBuild enables debug information by default.
+ // Disable it explicitly unless a flag parsed below re-enables it.
+ masmOptions.AddFlag("GenerateDebugInformation", "false");
+
std::string flags;
this->LocalGenerator->AddLanguageFlags(flags, this->GeneratorTarget,
cmBuildStep::Compile, "ASM_MASM",
diff --git a/Templates/MSBuild/FlagTables/v10_MARMASM.json b/Templates/MSBuild/FlagTables/v10_MARMASM.json
index 5c8de1f..8d09574 100644
--- a/Templates/MSBuild/FlagTables/v10_MARMASM.json
+++ b/Templates/MSBuild/FlagTables/v10_MARMASM.json
@@ -67,7 +67,7 @@
]
},
{
- "name": "DebugInformation",
+ "name": "GenerateDebugInformation",
"switch": "g",
"comment": "Generate debugging information.",
"value": "true",
diff --git a/Tests/VSMARMASM/CMakeLists.txt b/Tests/VSMARMASM/CMakeLists.txt
index eb1bfdb..6d78e04 100644
--- a/Tests/VSMARMASM/CMakeLists.txt
+++ b/Tests/VSMARMASM/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.12)
+cmake_minimum_required(VERSION 3.25) # Enable CMP0141
project(VSMARMASM C ASM_MARMASM)
add_executable(VSMARMASM main.c foo.asm)
diff --git a/Tests/VSMASM/CMakeLists.txt b/Tests/VSMASM/CMakeLists.txt
index 2923e15..603a43b 100644
--- a/Tests/VSMASM/CMakeLists.txt
+++ b/Tests/VSMASM/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8.12)
+cmake_minimum_required(VERSION 3.25) # Enable CMP0141
project(VSMASM C ASM_MASM)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
add_definitions(-DTESTx64)