Исключение файлов, сгенерированных из qrc, из unity сборки

This commit is contained in:
Andrei Astafev 2020-04-13 20:53:01 +03:00
parent 57173313ad
commit 450c0200a7

View File

@ -7,6 +7,15 @@ function(common_target_properties target)
set(__interface 1)
set(__visibility INTERFACE)
endif()
get_target_property(__sources ${target} SOURCES)
foreach(__src IN LISTS __sources)
string(REGEX MATCH ".*/qrc_.*\\.cpp$" __qrc ${__src})
if (__qrc)
set_property(SOURCE ${__qrc} PROPERTY COTIRE_EXCLUDED ON)
endif()
endforeach()
target_compile_features(${target} ${__visibility} ${COMMON_CXX_FEATURES})
get_target_property(_targetType ${target} TYPE)
if(_targetType STREQUAL "EXECUTABLE" AND CMAKE_CXX_COMPILE_OPTIONS_PIE)