clang build board test with h743

This commit is contained in:
hathach
2024-04-17 13:00:07 +07:00
parent 9f0e4c2889
commit 96f7ca02bf
5 changed files with 54 additions and 3 deletions

View File

@@ -0,0 +1,21 @@
if (NOT DEFINED CMAKE_C_COMPILER)
set(CMAKE_C_COMPILER "clang")
endif ()
if (NOT DEFINED CMAKE_CXX_COMPILER)
set(CMAKE_CXX_COMPILER "clang++")
endif ()
set(CMAKE_ASM_COMPILER ${CMAKE_C_COMPILER})
set(CMAKE_SIZE "llvm-size" CACHE FILEPATH "")
set(CMAKE_OBJCOPY "llvm-objcopy" CACHE FILEPATH "")
set(CMAKE_OBJDUMP "llvm-objdump" CACHE FILEPATH "")
include(${CMAKE_CURRENT_LIST_DIR}/common.cmake)
get_property(IS_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE)
if (IS_IN_TRY_COMPILE)
set(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} -nostdlib")
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -nostdlib")
cmake_print_variables(CMAKE_C_LINK_FLAGS)
endif ()