geo/qgis: fix build with llvm 22

- use -O0 on textrenderer/qgsfontmanager.cpp otherwise c++ spins forever
- set SKIP_PRECOMPILE_HEADERS ON on qgsexpression_texts.cpp otherwise llvm
errors with "OptimizationLevel differs in precompiled file vs. current file"

joint work with tb@, thanks!
This commit is contained in:
landry
2026-06-01 09:22:39 +00:00
parent 48824f3b16
commit 7e1a84ae4a
+17 -1
View File
@@ -1,5 +1,11 @@
https://github.com/qgis/QGIS/issues/61855
chunk2 : try to fix the build with llvm22, cf https://github.com/qgis/QGIS/issues/66293
set SKIP_PRECOMPILED_HEADERS ON on qgsexpression_texts.cpp otherwise clang complains about mismatching optimization levels:
error: OptimizationLevel differs in precompiled file '/usr/obj/ports/qgis-4.0.3/build-amd64/src/core/CMakeFiles/qgis_core.dir/cmake_pch.hxx.pch' vs. current file
use -O0 on textrenderer/qgsfontmanager.cpp otherwise c++ spins forever
Index: src/core/CMakeLists.txt
--- src/core/CMakeLists.txt.orig
+++ src/core/CMakeLists.txt
@@ -12,7 +18,17 @@ Index: src/core/CMakeLists.txt
SET(PDF4QT_BUILD_ONLY_CORE_LIBRARY TRUE)
SET(PDF4QT_ENABLE_OPENGL FALSE)
SUBDIRS(${CMAKE_SOURCE_DIR}/external/PDF4QT)
@@ -2675,10 +2675,15 @@ target_include_directories(qgis_core PUBLIC
@@ -2294,7 +2294,8 @@ if(MSVC)
)
else()
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" AND (CMAKE_BUILD_TYPE MATCHES Release OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo))
- set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/qgsexpression_texts.cpp PROPERTIES COMPILE_FLAGS "-O1")
+ set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/qgsexpression_texts.cpp PROPERTIES COMPILE_FLAGS "-O1" SKIP_PRECOMPILE_HEADERS ON)
+ set_source_files_properties(textrenderer/qgsfontmanager.cpp PROPERTIES COMPILE_FLAGS "-O0" SKIP_PRECOMPILE_HEADERS ON)
set_source_files_properties(proj/qgscoordinatereferencesystem.cpp PROPERTIES COMPILE_FLAGS "-mllvm -inline-threshold=128")
endif()
endif()
@@ -2675,10 +2676,15 @@ target_include_directories(qgis_core PUBLIC
${CMAKE_SOURCE_DIR}/external/earcut
)