aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorKevin Townsend <kevin.townsend@linaro.org>2020-06-02 12:50:12 +0200
committerKen Liu <ken.liu@arm.com>2020-06-04 09:45:14 +0000
commit99c0a9626df6ed0d62d37e0493c7067254d99e7e (patch)
treecaf4835ec4682faec35e89100cd8b303f8ead3b6 /cmake
parent1f345b0d3f51b547c6422febc5f5a5956a1f81bb (diff)
downloadtrusted-firmware-m-99c0a9626df6ed0d62d37e0493c7067254d99e7e.tar.gz
Build: Enable ninja-based builds
This commit enables to use of `-GNinja` for builds, which provides significantly faster TF-M builds, and enables building TF-M as a cmake external project with Zephyr's build system. ``` $ cmake -GNinja \ -DPROJ_CONFIG=`readlink -f ../configs/ConfigDefault.cmake` \ -DTARGET_PLATFORM=LPC55S69 -DBL2=False -DCOMPILER=GNUARM .. $ ninja ``` Signed-off-by: Kevin Townsend <kevin.townsend@linaro.org> Change-Id: I5deaaf9ffb3ec3329174881d70fe7033b531ec49
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Common/CompilerGNUARMCommon.cmake1
-rw-r--r--cmake/Compiler/GNUARM.cmake2
2 files changed, 2 insertions, 1 deletions
diff --git a/cmake/Common/CompilerGNUARMCommon.cmake b/cmake/Common/CompilerGNUARMCommon.cmake
index d616a2df1..6d427ecbf 100644
--- a/cmake/Common/CompilerGNUARMCommon.cmake
+++ b/cmake/Common/CompilerGNUARMCommon.cmake
@@ -146,6 +146,7 @@ function(compiler_set_cmse_output TARGET FILE_PATH)
set_property(TARGET ${TARGET} APPEND_STRING PROPERTY LINK_FLAGS " -Wl,--cmse-implib,--out-implib=${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/GNUARM.cmake b/cmake/Compiler/GNUARM.cmake
index aa197a5e5..ed05d9242 100644
--- a/cmake/Compiler/GNUARM.cmake
+++ b/cmake/Compiler/GNUARM.cmake
@@ -51,6 +51,6 @@ macro(__compiler_gnuarm 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()