cmake build: Fix building with PCHs

- fix target name
- build pchs without extensions like all other targets
- require CMake 3.10 for plugins

Amends c038abb0ab

Change-Id: I0eae58a9e7ce91c0df6103790cb91a5229d06051
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
Eike Ziller
2020-11-16 10:54:32 +01:00
parent d661c2ed12
commit 9ff91ef0d9
2 changed files with 5 additions and 3 deletions
+4 -2
View File
@@ -324,7 +324,9 @@ function(enable_pch target)
set_target_properties(${pch_target} PROPERTIES
PRECOMPILE_HEADERS ${pch_file}
CXX_VISIBILITY_PRESET hidden
VISIBILITY_INLINES_HIDDEN ON)
VISIBILITY_INLINES_HIDDEN ON
CXX_EXTENSIONS OFF
)
target_link_libraries(${pch_target} PRIVATE ${pch_dependency})
endif()
endfunction()
@@ -351,7 +353,7 @@ function(enable_pch target)
if ("Qt5::Widgets" IN_LIST dependencies)
set(PCH_TARGET ${PROJECT_NAME}PchGui)
elseif ("Qt5::Core" IN_LIST dependencies)
set(PCH_TARGET ${PROJECT_NAME}Console)
set(PCH_TARGET ${PROJECT_NAME}PchConsole)
endif()
if (TARGET "${PCH_TARGET}")