forked from espressif/esp-idf
esp_rom: support building for Linux target with Clang
This fixes passing -Wimplicit-fallthrough=0 flag to Clang, which it doesn't recognize, and is not necessary for this file. Also the flag is changed from PUBLIC to PRIVATE since it is necessary when compiling this component only.
This commit is contained in:
@@ -48,8 +48,11 @@ endfunction()
|
|||||||
|
|
||||||
if(target STREQUAL "linux")
|
if(target STREQUAL "linux")
|
||||||
# We need to disable some warnings due to the ROM code's printf implementation
|
# We need to disable some warnings due to the ROM code's printf implementation
|
||||||
if(${CMAKE_CXX_COMPILER_VERSION} GREATER "7.0.0") # TODO: clang compatibility
|
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND ${CMAKE_CXX_COMPILER_VERSION} GREATER "7.0.0")
|
||||||
target_compile_options(${COMPONENT_LIB} PUBLIC -Wimplicit-fallthrough=0 -Wno-shift-count-overflow)
|
target_compile_options(${COMPONENT_LIB} PRIVATE -Wimplicit-fallthrough=0 -Wno-shift-count-overflow)
|
||||||
|
endif()
|
||||||
|
if(CMAKE_C_COMPILER_ID MATCHES "Clang") # Clang or AppleClang
|
||||||
|
target_compile_options(${COMPONENT_LIB} PRIVATE -Wno-integer-overflow -Wno-shift-count-overflow)
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
target_linker_script(${COMPONENT_LIB} INTERFACE "${target}/${ld_folder}/${target}.rom.ld")
|
target_linker_script(${COMPONENT_LIB} INTERFACE "${target}/${ld_folder}/${target}.rom.ld")
|
||||||
|
Reference in New Issue
Block a user