Bootstrap: Make compiler warnings fatal
Prevent compiler warnings from creeping into the bootstrap library. Pick-to: 6.3 Change-Id: I8054416564c91fee256cad616911dd4ad231d0df Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
parent
ef0e13257d
commit
dfe6601974
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
function(qt_internal_set_warnings_are_errors_flags target)
|
function(qt_internal_set_warnings_are_errors_flags target target_scope)
|
||||||
set(flags "")
|
set(flags "")
|
||||||
if (CLANG AND NOT MSVC)
|
if (CLANG AND NOT MSVC)
|
||||||
list(APPEND flags -Werror -Wno-error=\#warnings -Wno-error=deprecated-declarations)
|
list(APPEND flags -Werror -Wno-error=\#warnings -Wno-error=deprecated-declarations)
|
||||||
@ -69,7 +69,8 @@ function(qt_internal_set_warnings_are_errors_flags target)
|
|||||||
set(cxx_only_genex "$<OR:$<COMPILE_LANGUAGE:CXX>,$<COMPILE_LANGUAGE:OBJCXX>>")
|
set(cxx_only_genex "$<OR:$<COMPILE_LANGUAGE:CXX>,$<COMPILE_LANGUAGE:OBJCXX>>")
|
||||||
set(final_condition_genex "$<AND:${warnings_are_errors_enabled_genex},${cxx_only_genex}>")
|
set(final_condition_genex "$<AND:${warnings_are_errors_enabled_genex},${cxx_only_genex}>")
|
||||||
set(flags_generator_expression "$<${final_condition_genex}:${flags}>")
|
set(flags_generator_expression "$<${final_condition_genex}:${flags}>")
|
||||||
target_compile_options("${target}" INTERFACE "${flags_generator_expression}")
|
|
||||||
|
target_compile_options("${target}" ${target_scope} "${flags_generator_expression}")
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
# The function adds a global 'definition' to the platform internal targets and the target
|
# The function adds a global 'definition' to the platform internal targets and the target
|
||||||
@ -145,9 +146,9 @@ qt_internal_add_global_definition(QT_NO_JAVA_STYLE_ITERATORS)
|
|||||||
qt_internal_add_global_definition(QT_NO_NARROWING_CONVERSIONS_IN_CONNECT)
|
qt_internal_add_global_definition(QT_NO_NARROWING_CONVERSIONS_IN_CONNECT)
|
||||||
|
|
||||||
if(WARNINGS_ARE_ERRORS)
|
if(WARNINGS_ARE_ERRORS)
|
||||||
qt_internal_set_warnings_are_errors_flags(PlatformModuleInternal)
|
qt_internal_set_warnings_are_errors_flags(PlatformModuleInternal INTERFACE)
|
||||||
qt_internal_set_warnings_are_errors_flags(PlatformPluginInternal)
|
qt_internal_set_warnings_are_errors_flags(PlatformPluginInternal INTERFACE)
|
||||||
qt_internal_set_warnings_are_errors_flags(PlatformAppInternal)
|
qt_internal_set_warnings_are_errors_flags(PlatformAppInternal INTERFACE)
|
||||||
endif()
|
endif()
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
# Needed for M_PI define. Same as mkspecs/features/qt_module.prf.
|
# Needed for M_PI define. Same as mkspecs/features/qt_module.prf.
|
||||||
|
@ -241,6 +241,9 @@ qt_set_msvc_cplusplus_options(Bootstrap PUBLIC)
|
|||||||
qt_set_common_target_properties(Bootstrap)
|
qt_set_common_target_properties(Bootstrap)
|
||||||
qt_internal_apply_intel_cet(Bootstrap PUBLIC)
|
qt_internal_apply_intel_cet(Bootstrap PUBLIC)
|
||||||
|
|
||||||
|
if(WARNINGS_ARE_ERRORS)
|
||||||
|
qt_internal_set_warnings_are_errors_flags(Bootstrap PRIVATE)
|
||||||
|
endif()
|
||||||
qt_internal_extend_target(Bootstrap CONDITION MSVC
|
qt_internal_extend_target(Bootstrap CONDITION MSVC
|
||||||
DEFINES
|
DEFINES
|
||||||
_CRT_SECURE_NO_WARNINGS
|
_CRT_SECURE_NO_WARNINGS
|
||||||
|
Loading…
x
Reference in New Issue
Block a user