aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorTTornblom <thomas.tornblom@iar.com>2020-06-04 13:11:16 +0200
committerKen Liu <ken.liu@arm.com>2020-08-19 04:06:11 +0000
commit54507b1645087e92b5a115919ae8fd571ace8bdb (patch)
treed866beb7cf0c3f54df0fe54216c890df2a52e3c9 /cmake
parentaf22ffadc12fb34baf0717908336698f8f61c567 (diff)
downloadtrusted-firmware-m-54507b1645087e92b5a115919ae8fd571ace8bdb.tar.gz
Build: Enable ninja-based builds for ARMCLANG and IARARM
This is a port of 99c0a962, which only addressed GNUARM, for ARMCLANG and IARARM. Signed-off-by: TTornblom <thomas.tornblom@iar.com> Change-Id: I67482b613732204a681ac50514a1017fa967bd98
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Common/CompilerArmClangCommon.cmake1
-rw-r--r--cmake/Common/CompilerIarArmCommon.cmake1
-rw-r--r--cmake/Compiler/ARMClang.cmake2
-rw-r--r--cmake/Compiler/IARARM.cmake2
4 files changed, 4 insertions, 2 deletions
diff --git a/cmake/Common/CompilerArmClangCommon.cmake b/cmake/Common/CompilerArmClangCommon.cmake
index 517e6e859..1f7acf95b 100644
--- a/cmake/Common/CompilerArmClangCommon.cmake
+++ b/cmake/Common/CompilerArmClangCommon.cmake
@@ -140,6 +140,7 @@ function(compiler_set_cmse_output TARGET FILE_PATH)
set_property(TARGET ${TARGET} APPEND_STRING PROPERTY LINK_FLAGS " --import_cmse_lib_out=${FILE_PATH}")
#Tell cmake cmse output is a generated object file.
SET_SOURCE_FILES_PROPERTIES("${FILE_PATH}" PROPERTIES EXTERNAL_OBJECT true GENERATED true)
+ add_custom_command(TARGET ${TARGET} POST_BUILD COMMAND ${CMAKE_COMMAND} -E echo "" BYPRODUCTS ${FILE_PATH})
#Tell cmake cmse output shall be removed by clean target.
get_directory_property(_ADDITIONAL_MAKE_CLEAN_FILES DIRECTORY "./" ADDITIONAL_MAKE_CLEAN_FILES)
set_directory_properties(PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "${_ADDITIONAL_MAKE_CLEAN_FILES} ${FILE_PATH}")
diff --git a/cmake/Common/CompilerIarArmCommon.cmake b/cmake/Common/CompilerIarArmCommon.cmake
index 002ead024..6d9bdf6e1 100644
--- a/cmake/Common/CompilerIarArmCommon.cmake
+++ b/cmake/Common/CompilerIarArmCommon.cmake
@@ -141,6 +141,7 @@ function(compiler_set_cmse_output TARGET FILE_PATH)
set_property(TARGET ${TARGET} APPEND_STRING PROPERTY LINK_FLAGS " --import_cmse_lib_out=${FILE_PATH}")
#Tell cmake cmse output is a generated object file.
SET_SOURCE_FILES_PROPERTIES("${FILE_PATH}" PROPERTIES EXTERNAL_OBJECT true GENERATED true)
+ add_custom_command(TARGET ${TARGET} POST_BUILD COMMAND ${CMAKE_COMMAND} -E echo "" BYPRODUCTS ${FILE_PATH})
#Tell cmake cmse output shall be removed by clean target.
get_directory_property(_ADDITIONAL_MAKE_CLEAN_FILES DIRECTORY "./" ADDITIONAL_MAKE_CLEAN_FILES)
set_directory_properties(PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "${_ADDITIONAL_MAKE_CLEAN_FILES} ${FILE_PATH}")
diff --git a/cmake/Compiler/ARMClang.cmake b/cmake/Compiler/ARMClang.cmake
index a65add9b0..0e6f9418c 100644
--- a/cmake/Compiler/ARMClang.cmake
+++ b/cmake/Compiler/ARMClang.cmake
@@ -51,6 +51,6 @@ macro(__compiler_armclang lang)
set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
- set(CMAKE_DEPFILE_FLAGS_${lang} "--depend=<DEPFILE> --depend_single_line --no_depend_system_headers")
+ set(CMAKE_DEPFILE_FLAGS_${lang} "-MD -MT <OBJECT> -MF <DEPFILE>")
endif()
endmacro()
diff --git a/cmake/Compiler/IARARM.cmake b/cmake/Compiler/IARARM.cmake
index 5bb2a37c2..3ce35f1c2 100644
--- a/cmake/Compiler/IARARM.cmake
+++ b/cmake/Compiler/IARARM.cmake
@@ -35,6 +35,7 @@ macro(__compiler_iararm lang)
string(APPEND CMAKE_${lang}_FLAGS_MINSIZEREL_INIT " -Ohz -DNDEBUG")
string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " -Ohs -DNDEBUG")
string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT " -Ohs --debug")
+ set(CMAKE_DEPFILE_FLAGS_${lang} "--dependencies=ins <DEPFILE>")
endif()
set(CMAKE_${lang}_OUTPUT_EXTENSION ".o")
@@ -50,6 +51,5 @@ macro(__compiler_iararm lang)
set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <INCLUDES> <FLAGS> --preprocess=n <PREPROCESSED_SOURCE> <SOURCE> ")
set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <INCLUDES> <FLAGS> <SOURCE> -la <ASSEMBLY_SOURCE>")
- set(CMAKE_DEPFILE_FLAGS_${lang} "--dependencies=ins <DEPFILE>")
endif()
endmacro()