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")
|
list(APPEND compile_options "-fdump-rtl-expand")
|
||||||
endif()
|
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")
|
list(APPEND link_options "-fno-lto")
|
||||||
|
|
||||||
idf_build_set_property(COMPILE_OPTIONS "${compile_options}" APPEND)
|
idf_build_set_property(COMPILE_OPTIONS "${compile_options}" APPEND)
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
CONFIG_IDF_TARGET="linux"
|
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"
|
list(APPEND compile_options "-ffunction-sections"
|
||||||
"-fdata-sections"
|
"-fdata-sections"
|
||||||
"-fstrict-volatile-bitfields"
|
|
||||||
# warning-related flags
|
# warning-related flags
|
||||||
"-Wall"
|
"-Wall"
|
||||||
"-Werror=all"
|
"-Werror=all"
|
||||||
"-Wno-error=unused-function"
|
"-Wno-error=unused-function"
|
||||||
"-Wno-error=unused-but-set-variable"
|
|
||||||
"-Wno-error=unused-variable"
|
"-Wno-error=unused-variable"
|
||||||
"-Wno-error=deprecated-declarations"
|
"-Wno-error=deprecated-declarations"
|
||||||
"-Wextra"
|
"-Wextra"
|
||||||
|
@ -460,8 +460,10 @@ macro(project project_name)
|
|||||||
endif()
|
endif()
|
||||||
target_link_libraries(${project_elf} ${build_components})
|
target_link_libraries(${project_elf} ${build_components})
|
||||||
|
|
||||||
set(mapfile "${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}.map")
|
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
||||||
target_link_libraries(${project_elf} "-Wl,--cref -Wl,--Map=${mapfile}")
|
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
|
set_property(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" APPEND PROPERTY
|
||||||
ADDITIONAL_MAKE_CLEAN_FILES
|
ADDITIONAL_MAKE_CLEAN_FILES
|
||||||
|
@ -1,8 +1,3 @@
|
|||||||
set(CMAKE_SYSTEM_NAME Generic)
|
# The build system assumes that toolchain-${IDF_TARGET}.cmake file
|
||||||
|
# is present. It is not necessary for the host build, so we keep
|
||||||
set(CMAKE_C_COMPILER gcc)
|
# this file as a placeholder.
|
||||||
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")
|
|
||||||
|
Loading…
Reference in New Issue
Block a user