-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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: generalize exclusion of CXX options #21398
cmake: toolchain: generalize exclusion of CXX options #21398
Conversation
|
||
# List the warnings that are not supported for C++ compilations | ||
|
||
set(CXX_EXCLUDED_OPTIONS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
list(APPEND
then it could be populated elsewhere as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks; updated.
44311eb
to
55c4f32
Compare
@@ -854,7 +854,7 @@ 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)) | |||
if((${lang} STREQUAL CXX) AND ("${option}" IN_LIST CXX_EXCLUDED_OPTIONS)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# -Werror=implicit-int and other flags in CXX_EXCLUDED_OPTIONS are not supported for CXX and we are not able
Sorry for the stepwise feedback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the new wording OK? I didn't want to mention specific flags because they might not apply to certain toolchains.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great
-Wold-style-definition is not a supported option for C++ builds. To prevent it being passed: * the list of compiler flags to be excluded from C++ builds is moved to be toolchain-specific; * -Wold-style-definition is added to that list for gcc and clang; * -Wold-style-definition is moved from zephyr_compiler_options to zephyr_cc_option so the option checking code is executed for it. Signed-off-by: Peter A. Bigot <pab@pabigot.com>
55c4f32
to
269bb2f
Compare
-Wold-style-definition
is not a supported option for C++ builds. To prevent it being passed:-Wold-style-definition
is added to that list for gcc and clang;-Wold-style-definition
is moved fromzephyr_compiler_options
tozephyr_cc_option
so the option checking code is executed for it.Fixes #16239