mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
build system: don't add GCC-specific options when building with clang
This commit is contained in:
parent
06f22fc4b0
commit
ed7fbfefac
@ -90,6 +90,13 @@ if(CONFIG_COMPILER_DUMP_RTL_FILES)
|
||||
list(APPEND compile_options "-fdump-rtl-expand")
|
||||
endif()
|
||||
|
||||
# GCC-specific options
|
||||
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
||||
list(APPEND compile_options "-fstrict-volatile-bitfields"
|
||||
"-Wno-error=unused-but-set-variable"
|
||||
)
|
||||
endif()
|
||||
|
||||
list(APPEND link_options "-fno-lto")
|
||||
|
||||
idf_build_set_property(COMPILE_OPTIONS "${compile_options}" APPEND)
|
||||
|
@ -1,2 +1,2 @@
|
||||
CONFIG_IDF_TARGET="linux"
|
||||
CONFIG_CXX_EXCEPTIONS=y
|
||||
CONFIG_COMPILER_CXX_EXCEPTIONS=y
|
||||
|
@ -94,12 +94,10 @@ function(__build_set_default_build_specifications)
|
||||
|
||||
list(APPEND compile_options "-ffunction-sections"
|
||||
"-fdata-sections"
|
||||
"-fstrict-volatile-bitfields"
|
||||
# warning-related flags
|
||||
"-Wall"
|
||||
"-Werror=all"
|
||||
"-Wno-error=unused-function"
|
||||
"-Wno-error=unused-but-set-variable"
|
||||
"-Wno-error=unused-variable"
|
||||
"-Wno-error=deprecated-declarations"
|
||||
"-Wextra"
|
||||
|
@ -460,8 +460,10 @@ macro(project project_name)
|
||||
endif()
|
||||
target_link_libraries(${project_elf} ${build_components})
|
||||
|
||||
set(mapfile "${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}.map")
|
||||
target_link_libraries(${project_elf} "-Wl,--cref -Wl,--Map=${mapfile}")
|
||||
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
||||
set(mapfile "${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}.map")
|
||||
target_link_libraries(${project_elf} "-Wl,--cref -Wl,--Map=${mapfile}")
|
||||
endif()
|
||||
|
||||
set_property(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" APPEND PROPERTY
|
||||
ADDITIONAL_MAKE_CLEAN_FILES
|
||||
|
@ -1,8 +1,3 @@
|
||||
set(CMAKE_SYSTEM_NAME Generic)
|
||||
|
||||
set(CMAKE_C_COMPILER gcc)
|
||||
set(CMAKE_CXX_COMPILER g++)
|
||||
set(CMAKE_ASM_COMPILER gcc)
|
||||
|
||||
set(CMAKE_C_FLAGS "-Wno-frame-address" CACHE STRING "C Compiler Base Flags")
|
||||
set(CMAKE_CXX_FLAGS "-Wno-frame-address" CACHE STRING "C++ Compiler Base Flags")
|
||||
# The build system assumes that toolchain-${IDF_TARGET}.cmake file
|
||||
# is present. It is not necessary for the host build, so we keep
|
||||
# this file as a placeholder.
|
||||
|
Loading…
Reference in New Issue
Block a user