summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/build_system/cmake/toolchain/arm_clang.cmake2
-rw-r--r--examples/build_system/cmake/toolchain/common.cmake6
-rw-r--r--hw/bsp/ch32v10x/family.cmake2
-rw-r--r--hw/bsp/lpc11/family.cmake2
4 files changed, 9 insertions, 3 deletions
diff --git a/examples/build_system/cmake/toolchain/arm_clang.cmake b/examples/build_system/cmake/toolchain/arm_clang.cmake
index fe3c2b453..dba637367 100644
--- a/examples/build_system/cmake/toolchain/arm_clang.cmake
+++ b/examples/build_system/cmake/toolchain/arm_clang.cmake
@@ -7,6 +7,8 @@ if (NOT DEFINED CMAKE_CXX_COMPILER)
endif ()
set(CMAKE_ASM_COMPILER ${CMAKE_C_COMPILER})
+set(TOOLCHAIN_ASM_FLAGS "-x assembler-with-cpp")
+
find_program(CMAKE_SIZE llvm-size)
find_program(CMAKE_OBJCOPY llvm-objcopy)
find_program(CMAKE_OBJDUMP llvm-objdump)
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)
diff --git a/hw/bsp/ch32v10x/family.cmake b/hw/bsp/ch32v10x/family.cmake
index 1c9d41740..843b7f9d3 100644
--- a/hw/bsp/ch32v10x/family.cmake
+++ b/hw/bsp/ch32v10x/family.cmake
@@ -48,7 +48,7 @@ function(family_add_board BOARD_TARGET)
update_board(${BOARD_TARGET})
if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
- target_compile_options(${TARGET} PUBLIC -mcmodel=medany)
+ target_compile_options(${BOARD_TARGET} PUBLIC -mcmodel=medany)
endif()
endfunction()
diff --git a/hw/bsp/lpc11/family.cmake b/hw/bsp/lpc11/family.cmake
index 42578d403..fceafcf61 100644
--- a/hw/bsp/lpc11/family.cmake
+++ b/hw/bsp/lpc11/family.cmake
@@ -79,7 +79,7 @@ function(family_configure_example TARGET RTOS)
--specs=nosys.specs --specs=nano.specs
)
elseif (CMAKE_C_COMPILER_ID STREQUAL "Clang")
- target_link_options(${BOARD_TARGET} PUBLIC
+ target_link_options(${TARGET} PUBLIC
"LINKER:--script=${LD_FILE_GNU}"
)
elseif (CMAKE_C_COMPILER_ID STREQUAL "IAR")