diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 055d540798ee..1c7157027c75 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -2339,6 +2339,14 @@ add_library(qgis_core ${LIBRARY_TYPE} ${QGIS_CORE_SRCS} ${QGIS_CORE_HDRS} ${QGIS target_precompile_headers(qgis_core PRIVATE $<$:qgis.h>) +set_target_properties(qgis_core PROPERTIES UNITY_BUILD ON) + +# Exclude below files because they include tiny_gltf.h with different #define settings +set_source_files_properties(tiledscene/qgsgltfutils.cpp + tiledscene/qgsquantizedmeshtiles.cpp + tiledscene/qgstiledscenelayerrenderer.cpp + PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON) + # Add meshoptimizer if(WITH_INTERNAL_MESHOPTIMIZER) target_sources(qgis_core PRIVATE