Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake: toolchain: Don't add -Werror=implicit-int to CXX builds #21242

Merged
merged 1 commit into from
Dec 12, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions cmake/extensions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -746,6 +746,14 @@ endfunction()
# caching comes in addition to the caching that CMake does in the
# build folder's CMakeCache.txt)
function(zephyr_check_compiler_flag lang option check)
# Check if the option is covered by any hardcoded check before doing
# an automated test.
zephyr_check_compiler_flag_hardcoded(${lang} "${option}" check exists)
if(exists)
set(check ${check} PARENT_SCOPE)
return()
endif()

# Locate the cache directory
set_ifndef(
ZEPHYR_TOOLCHAIN_CAPABILITY_CACHE_DIR
Expand Down Expand Up @@ -842,6 +850,19 @@ function(zephyr_check_compiler_flag lang option check)
endif()
endfunction()

function(zephyr_check_compiler_flag_hardcoded lang option check exists)
# -Werror=implicit-int is not supported for CXX and we are not able
# to automatically test for it because it produces a warning
# instead of an error during the test.
if((${lang} STREQUAL CXX) AND ("${option}" STREQUAL -Werror=implicit-int))
set(check 0 PARENT_SCOPE)
set(exists 1 PARENT_SCOPE)
else()
# There does not exist a hardcoded check for this option.
set(exists 0 PARENT_SCOPE)
endif()
endfunction(zephyr_check_compiler_flag_hardcoded)

# zephyr_linker_sources(<location> <files>)
#
# <files> is one or more .ld formatted files whose contents will be
Expand Down