summaryrefslogtreecommitdiff
path: root/examples/build_system/cmake/toolchain/common.cmake
diff options
context:
space:
mode:
authorhathach <[email protected]>2025-10-23 16:59:04 +0700
committerhathach <[email protected]>2025-10-23 18:00:15 +0700
commit7c95d9bed5b39730c449e321cc72c4e690b17a6c (patch)
treec1a3d0c815418b618ee1c6634d425e1c339d1702 /examples/build_system/cmake/toolchain/common.cmake
parentbde449997e65ee866fa9e20c15bac0bd45efccf4 (diff)
force clang asm with -x assembler-with-cpp
Diffstat (limited to 'examples/build_system/cmake/toolchain/common.cmake')
-rw-r--r--examples/build_system/cmake/toolchain/common.cmake6
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/build_system/cmake/toolchain/common.cmake b/examples/build_system/cmake/toolchain/common.cmake
index fa3034e6f..14449b01d 100644
--- a/examples/build_system/cmake/toolchain/common.cmake
+++ b/examples/build_system/cmake/toolchain/common.cmake
@@ -32,7 +32,6 @@ if (TOOLCHAIN STREQUAL "gcc" OR TOOLCHAIN STREQUAL "clang")
-Wl,--gc-sections
-Wl,--cref
)
-
elseif (TOOLCHAIN STREQUAL "iar")
list(APPEND TOOLCHAIN_EXE_LINKER_FLAGS
--diag_suppress=Li065
@@ -48,5 +47,10 @@ foreach (LANG IN ITEMS C CXX ASM)
#set(CMAKE_${LANG}_FLAGS_DEBUG_INIT "-O0")
endforeach ()
+# Assembler
+if (DEFINED TOOLCHAIN_ASM_FLAGS)
+ set(CMAKE_ASM_FLAGS_INIT "${CMAKE_ASM_FLAGS_INIT} ${TOOLCHAIN_ASM_FLAGS}")
+endif ()
+
# Linker
list(JOIN TOOLCHAIN_EXE_LINKER_FLAGS " " CMAKE_EXE_LINKER_FLAGS_INIT)