summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLi Xinwei <1326710505@qq.com>2021-07-29 17:53:03 +0800
committerLi Xinwei <1326710505@qq.com>2021-08-03 04:18:42 +0800
commit74083c239db8ac65f143187ba9cafa11262d427b (patch)
tree331d5d3052e95b75ffbd2593c6aefa839f59c505
parentAvoid to call _qt_internal_set_up_static_runtime_library() twice (diff)
downloadqtbase-74083c239db8ac65f143187ba9cafa11262d427b.tar.xz
qtbase-74083c239db8ac65f143187ba9cafa11262d427b.zip
Use correct MSVC runtime library for targets created by qt_add_*()
Use _qt_internal_set_up_static_runtime_library() to set correct MSVC runtime library for targets created by qt_add_executable(), qt_add_library(), qt_add_plugin() and qt_add_big_resources(), to bring convenience to user projects. Pick-to: 6.2 Change-Id: Ia49f1e90989c464820824be3e1eef3df1351cdcf Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
-rw-r--r--src/corelib/Qt6CoreMacros.cmake3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/corelib/Qt6CoreMacros.cmake b/src/corelib/Qt6CoreMacros.cmake
index 42116cba69..882863c5cb 100644
--- a/src/corelib/Qt6CoreMacros.cmake
+++ b/src/corelib/Qt6CoreMacros.cmake
@@ -409,6 +409,7 @@ function(qt6_add_big_resources outfiles )
VERBATIM)
add_custom_target(big_resources_${outfilename} ALL DEPENDS ${tmpoutfile})
add_library(rcc_object_${outfilename} OBJECT ${tmpoutfile})
+ _qt_internal_set_up_static_runtime_library(rcc_object_${outfilename})
target_compile_definitions(rcc_object_${outfilename} PUBLIC "$<TARGET_PROPERTY:Qt6::Core,INTERFACE_COMPILE_DEFINITIONS>")
set_target_properties(rcc_object_${outfilename} PROPERTIES AUTOMOC OFF)
set_target_properties(rcc_object_${outfilename} PROPERTIES AUTOUIC OFF)
@@ -524,6 +525,7 @@ function(_qt_internal_create_executable target)
endif()
target_link_libraries("${target}" PRIVATE Qt6::Core)
+ _qt_internal_set_up_static_runtime_library("${target}")
endfunction()
function(_qt_internal_finalize_executable target)
@@ -1957,6 +1959,7 @@ function(_qt_internal_add_library target)
endif()
add_library(${target} ${type_to_create} ${arg_UNPARSED_ARGUMENTS})
+ _qt_internal_set_up_static_runtime_library(${target})
if(NOT type_to_create STREQUAL "INTERFACE" AND NOT type_to_create STREQUAL "OBJECT")
_qt_internal_apply_win_prefix_and_suffix("${target}")