summaryrefslogtreecommitdiff
path: root/Modules/Compiler/GNU-ASM.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-03-11 11:45:46 -0400
committerBrad King <brad.king@kitware.com>2020-03-13 09:55:36 -0400
commit5932f0be4f36f97fcd3ab61a559379a2a1291371 (patch)
tree41c666f30a0a36bdec6fe5ca0cf08b395e05f506 /Modules/Compiler/GNU-ASM.cmake
parent0d0aa98c84bca35431f4239e45956c9d24967af4 (diff)
downloadcmake-5932f0be4f36f97fcd3ab61a559379a2a1291371.tar.gz
ASM: Fix depfile flags for GNU 'as' tool
The GNU `as --help` shows `--MD <file>` as an option to generate depfiles as needed by Ninja. There is no `-MT <target>` flag but fortunately the generated files automatically account for the `-o <obj>` flag. Issue: #20426
Diffstat (limited to 'Modules/Compiler/GNU-ASM.cmake')
-rw-r--r--Modules/Compiler/GNU-ASM.cmake4
1 files changed, 4 insertions, 0 deletions
diff --git a/Modules/Compiler/GNU-ASM.cmake b/Modules/Compiler/GNU-ASM.cmake
index e07401d54f..ac241ed2f0 100644
--- a/Modules/Compiler/GNU-ASM.cmake
+++ b/Modules/Compiler/GNU-ASM.cmake
@@ -4,3 +4,7 @@ include(Compiler/GNU)
set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s;S;asm)
__compiler_gnu(ASM)
+
+if(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_MATCH STREQUAL "GNU assembler")
+ set(CMAKE_DEPFILE_FLAGS_ASM${ASM_DIALECT} "--MD <DEPFILE>")
+endif()