Позиционно-независимый код для приложений
This commit is contained in:
parent
489f0cce72
commit
428dc84cfd
@ -8,6 +8,10 @@ function(common_target_properties Name)
|
||||
set(__visibility INTERFACE)
|
||||
endif()
|
||||
target_compile_features(${Name} ${__visibility} ${COMMON_CXX_FEATURES})
|
||||
get_target_property(_targetType ${Name} TYPE)
|
||||
if (_targetType STREQUAL "EXECUTABLE" AND CMAKE_CXX_COMPILE_OPTIONS_PIE)
|
||||
target_compile_options(${Name} PUBLIC "${CMAKE_CXX_COMPILE_OPTIONS_PIE}")
|
||||
endif()
|
||||
target_include_directories(
|
||||
${Name}
|
||||
PUBLIC $<INSTALL_INTERFACE:include>
|
||||
@ -19,8 +23,9 @@ function(common_target_properties Name)
|
||||
endif()
|
||||
if(NOT __interface)
|
||||
if(TARGET Qt5::Core)
|
||||
target_compile_options(${Name}
|
||||
PUBLIC "${Qt5Core_EXECUTABLE_COMPILE_FLAGS}")
|
||||
if (_targetType STREQUAL "EXECUTABLE")
|
||||
target_compile_options(${Name} PUBLIC "${Qt5Core_EXECUTABLE_COMPILE_FLAGS}")
|
||||
endif()
|
||||
set_target_properties(${Name} PROPERTIES AUTOMOC TRUE AUTORCC TRUE)
|
||||
endif()
|
||||
if(TARGET Qt5::Widgets)
|
||||
|
Loading…
Reference in New Issue
Block a user