Include Qt and GoogleTest as system include

That is silencing warnings in Qt and GoogleTest headers .

Change-Id: Ia6fda019c271788fbb341a8de0cf6d7b757f38bf
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
This commit is contained in:
Marco Bubke
2024-04-22 17:59:59 +02:00
parent a369d075ad
commit b07d2f0c1d

View File

@@ -338,12 +338,18 @@ function(add_qtc_depends target_name)
foreach(obj_lib IN LISTS object_lib_depends)
target_compile_options(${target_name} PRIVATE $<TARGET_PROPERTY:${obj_lib},INTERFACE_COMPILE_OPTIONS>)
target_compile_definitions(${target_name} PRIVATE $<TARGET_PROPERTY:${obj_lib},INTERFACE_COMPILE_DEFINITIONS>)
target_include_directories(${target_name} PRIVATE $<TARGET_PROPERTY:${obj_lib},INTERFACE_INCLUDE_DIRECTORIES>)
if (obj_lib MATCHES "Qt::.*|GoogleTest")
set(system_include "SYSTEM")
endif()
target_include_directories(${target_name} ${system_include} PRIVATE $<TARGET_PROPERTY:${obj_lib},INTERFACE_INCLUDE_DIRECTORIES>)
endforeach()
foreach(obj_lib IN LISTS object_public_depends)
target_compile_options(${target_name} PUBLIC $<TARGET_PROPERTY:${obj_lib},INTERFACE_COMPILE_OPTIONS>)
target_compile_definitions(${target_name} PUBLIC $<TARGET_PROPERTY:${obj_lib},INTERFACE_COMPILE_DEFINITIONS>)
target_include_directories(${target_name} PUBLIC $<TARGET_PROPERTY:${obj_lib},INTERFACE_INCLUDE_DIRECTORIES>)
if (obj_lib MATCHES "Qt::.*|GoogleTest")
set(system_include "SYSTEM")
endif()
target_include_directories(${target_name} ${system_include} PUBLIC $<TARGET_PROPERTY:${obj_lib},INTERFACE_INCLUDE_DIRECTORIES>)
endforeach()
endfunction()