diff options
author | Tim Jenssen <tim.jenssen@qt.io> | 2020-11-19 22:02:25 +0100 |
---|---|---|
committer | Tim Jenssen <tim.jenssen@qt.io> | 2020-11-23 12:26:23 +0000 |
commit | 5267efc234a75fd760b8c2841c1eae8c5ef6dde5 (patch) | |
tree | c99e8c372da51b99172c62cc729ddadab7c6a06c /cmake | |
parent | a8ceeaf7df085edfafcb1a64a67a7d885299ee9e (diff) |
cmake: disable reuse pch files for static libs with MSVC
Was not able to build something against these libraries
from another "cmake project".
Change-Id: I3876d102a320b4f5324e25fd8e840c181010c2a7
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/QtCreatorAPIInternal.cmake | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/cmake/QtCreatorAPIInternal.cmake b/cmake/QtCreatorAPIInternal.cmake index 6a8dc4c39c..0aafe289e6 100644 --- a/cmake/QtCreatorAPIInternal.cmake +++ b/cmake/QtCreatorAPIInternal.cmake @@ -291,6 +291,14 @@ function(enable_pch target) return() endif() + # static libs are maybe used by other projects, so they can not reuse same pch files + if (MSVC) + get_target_property(target_type "${target}" TYPE) + if (target_type MATCHES "STATIC") + return() + endif() + endif() + # Skip PCH for targets that do not have QT_NO_CAST_TO_ASCII get_target_property(target_defines "${target}" COMPILE_DEFINITIONS) if (NOT "QT_NO_CAST_TO_ASCII" IN_LIST target_defines) |