mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
build: add support ESP32-S3 in Clang build configuration
This commit is contained in:
parent
6b0c756ebf
commit
55dda77b98
32
tools/cmake/toolchain-clang-esp32s3.cmake
Normal file
32
tools/cmake/toolchain-clang-esp32s3.cmake
Normal file
@ -0,0 +1,32 @@
|
||||
include($ENV{IDF_PATH}/tools/cmake/utilities.cmake)
|
||||
|
||||
set(CMAKE_SYSTEM_NAME Generic)
|
||||
|
||||
set(CMAKE_C_COMPILER clang)
|
||||
set(CMAKE_CXX_COMPILER clang++)
|
||||
set(CMAKE_ASM_COMPILER clang)
|
||||
|
||||
set(CMAKE_AR xtensa-esp32-elf-ar)
|
||||
set(CMAKE_RANLIB xtensa-esp32-elf-gcc-ranlib)
|
||||
set(CMAKE_OBJDUMP xtensa-esp32-elf-objdump)
|
||||
|
||||
# -freestanding is a hack to force Clang to use its own stdatomic.h,
|
||||
# without falling back to the (incompatible) GCC stdatomic.h
|
||||
# https://github.com/espressif/llvm-project/blob/d9341b81/clang/lib/Headers/stdatomic.h#L13-L18
|
||||
remove_duplicated_flags("--target=xtensa -mcpu=esp32s3 -ffreestanding ${CMAKE_C_FLAGS}"
|
||||
UNIQ_CMAKE_C_FLAGS)
|
||||
set(CMAKE_C_FLAGS "${UNIQ_CMAKE_C_FLAGS}"
|
||||
CACHE STRING "C Compiler Base Flags"
|
||||
FORCE)
|
||||
|
||||
remove_duplicated_flags("--target=xtensa -mcpu=esp32s3 -ffreestanding ${CMAKE_CXX_FLAGS}"
|
||||
UNIQ_CMAKE_CXX_FLAGS)
|
||||
set(CMAKE_CXX_FLAGS "${UNIQ_CMAKE_CXX_FLAGS}"
|
||||
CACHE STRING "C++ Compiler Base Flags"
|
||||
FORCE)
|
||||
|
||||
remove_duplicated_flags("--target=xtensa -mcpu=esp32s3 ${CMAKE_ASM_FLAGS}"
|
||||
UNIQ_CMAKE_ASM_FLAGS)
|
||||
set(CMAKE_ASM_FLAGS "${UNIQ_CMAKE_ASM_FLAGS}"
|
||||
CACHE STRING "Assembler Base Flags"
|
||||
FORCE)
|
Loading…
Reference in New Issue
Block a user