diff options
author | Cristian Adam <cristian.adam@qt.io> | 2021-05-20 17:43:17 +0200 |
---|---|---|
committer | Cristian Adam <cristian.adam@qt.io> | 2021-05-21 14:02:33 +0000 |
commit | 9449bfbf043b88d7acf300930dda0b1af3f179f7 (patch) | |
tree | e45d340408fc04e05cce21eb5ffc2a8680f6a109 /cmake | |
parent | ad167901403dd0ff9c8b4792e0be915f55da2bf3 (diff) |
CMake: Fix build with MSVC 2019 and Qt 6.2
Qt 6.2 requires __cplusplus preprocessor set to at least 201703L
According to https://docs.microsoft.com/en-us/cpp/build/reference/zc-cplusplus
one needs to add the compiler flag /Zc:__cplusplus
CMake doesn't set the flag, there is an issue opened at
https://gitlab.kitware.com/cmake/cmake/-/issues/18837
This flag is passed to any target that links to Qt6::Core, unless
the flags are not manually copied for some reason.
Task-number: QTCREATORBUG-25730
Change-Id: I271e85fe857b5d4ac8980f77c723e5704a8eb743
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/QtCreatorAPIInternal.cmake | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/cmake/QtCreatorAPIInternal.cmake b/cmake/QtCreatorAPIInternal.cmake index 549f05a9448..45aa8246dbe 100644 --- a/cmake/QtCreatorAPIInternal.cmake +++ b/cmake/QtCreatorAPIInternal.cmake @@ -295,10 +295,12 @@ function(add_qtc_depends target_name) endif() 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>) 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>) endforeach() |