mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-22 00:06:12 -05:00
Fix issue with .gch ccach'ing not working with QT6 and gcc
This commit is contained in:
parent
ddaca73dbf
commit
8dd4f8455c
@ -14,7 +14,7 @@ ccache -M 2.0G
|
|||||||
ccache -z
|
ccache -z
|
||||||
|
|
||||||
# To make ccache work properly with precompiled headers
|
# To make ccache work properly with precompiled headers
|
||||||
ccache --set-config sloppiness=pch_defines,time_macros
|
ccache --set-config sloppiness=pch_defines,time_macros,include_file_mtime,include_file_ctime
|
||||||
|
|
||||||
cmake -GNinja \
|
cmake -GNinja \
|
||||||
-DUSE_CCACHE=ON \
|
-DUSE_CCACHE=ON \
|
||||||
|
@ -19,7 +19,7 @@ ccache -M 2.0G
|
|||||||
ccache -z
|
ccache -z
|
||||||
|
|
||||||
# To make ccache work properly with precompiled headers
|
# To make ccache work properly with precompiled headers
|
||||||
ccache --set-config sloppiness=pch_defines,time_macros
|
ccache --set-config sloppiness=pch_defines,time_macros,include_file_mtime,include_file_ctime
|
||||||
|
|
||||||
##############################
|
##############################
|
||||||
# Variables for output styling
|
# Variables for output styling
|
||||||
|
2
.github/workflows/macos-build.yml
vendored
2
.github/workflows/macos-build.yml
vendored
@ -109,7 +109,7 @@ jobs:
|
|||||||
brew install ccache
|
brew install ccache
|
||||||
ccache --set-config=max_size=2.0G
|
ccache --set-config=max_size=2.0G
|
||||||
# To make ccache work properly with precompiled headers
|
# To make ccache work properly with precompiled headers
|
||||||
ccache --set-config sloppiness=pch_defines,time_macros
|
ccache --set-config sloppiness=pch_defines,time_macros,include_file_mtime,include_file_ctime
|
||||||
ccache -s
|
ccache -s
|
||||||
|
|
||||||
- name: Run cmake
|
- name: Run cmake
|
||||||
|
2
.github/workflows/windows-qt6.yml
vendored
2
.github/workflows/windows-qt6.yml
vendored
@ -57,7 +57,7 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
# To make ccache work properly with precompiled headers
|
# To make ccache work properly with precompiled headers
|
||||||
ccache --set-config sloppiness=pch_defines,time_macros
|
ccache --set-config sloppiness=pch_defines,time_macros,include_file_mtime,include_file_ctime
|
||||||
|
|
||||||
- name: 🌱 Install dependencies and generate project files
|
- name: 🌱 Install dependencies and generate project files
|
||||||
shell: bash
|
shell: bash
|
||||||
|
@ -128,25 +128,46 @@ if (USE_CCACHE)
|
|||||||
message(STATUS "ccache found")
|
message(STATUS "ccache found")
|
||||||
execute_process(COMMAND ccache --help OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE CCACHE_HELP)
|
execute_process(COMMAND ccache --help OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE CCACHE_HELP)
|
||||||
execute_process(COMMAND ccache --get-config sloppiness OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE CCACHE_SLOPPINESS)
|
execute_process(COMMAND ccache --get-config sloppiness OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE CCACHE_SLOPPINESS)
|
||||||
|
execute_process(COMMAND ccache --get-config compiler_type OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE CCACHE_COMPILER_TYPE)
|
||||||
string(FIND "${CCACHE_SLOPPINESS}" "pch_defines" fpch_defines_found_index)
|
string(FIND "${CCACHE_SLOPPINESS}" "pch_defines" fpch_defines_found_index)
|
||||||
string(FIND "${CCACHE_SLOPPINESS}" "time_macros" time_macros_found_index)
|
string(FIND "${CCACHE_SLOPPINESS}" "time_macros" time_macros_found_index)
|
||||||
|
string(FIND "${CCACHE_SLOPPINESS}" "include_file_mtime" include_file_mtime_found_index)
|
||||||
|
string(FIND "${CCACHE_SLOPPINESS}" "include_file_ctime" include_file_ctime_found_index)
|
||||||
# Detect if we have ccache >= 4.8 which accepts passing configuration settings when invoking the compiler
|
# Detect if we have ccache >= 4.8 which accepts passing configuration settings when invoking the compiler
|
||||||
string(FIND "${CCACHE_HELP}" "ccache [KEY=VALUE ...] compiler" ccache_key_value_found_index)
|
string(FIND "${CCACHE_HELP}" "ccache [KEY=VALUE ...] compiler" ccache_key_value_found_index)
|
||||||
if (ccache_key_value_found_index EQUAL -1 )
|
if (fpch_defines_found_index EQUAL -1 OR time_macros_found_index EQUAL -1 OR
|
||||||
if (fpch_defines_found_index EQUAL -1 OR time_macros_found_index EQUAL -1)
|
(BUILD_WITH_QT6 AND (include_file_mtime_found_index EQUAL -1 OR include_file_ctime_found_index EQUAL -1)))
|
||||||
message(FATAL_ERROR "The use of precompiled headers only work if the ccache 'sloppiness' settings contains 'pch_defines' and 'time_macros'. Consider running 'ccache --set-config sloppiness=pch_defines,time_macros' to define them")
|
set(CCACHE_SLOPPINESS_REQUIRED "pch_defines,time_macros")
|
||||||
endif()
|
if (BUILD_WITH_QT6 AND (include_file_mtime_found_index EQUAL -1 OR include_file_ctime_found_index EQUAL -1))
|
||||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
|
string(APPEND CCACHE_SLOPPINESS_REQUIRED ",include_file_mtime,include_file_ctime")
|
||||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
|
endif()
|
||||||
else()
|
else()
|
||||||
if (fpch_defines_found_index EQUAL -1 OR time_macros_found_index EQUAL -1)
|
set(CCACHE_SLOPPINESS_REQUIRED "")
|
||||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "ccache sloppiness=pch_defines,time_macros")
|
endif()
|
||||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "ccache sloppiness=pch_defines,time_macros")
|
if (BUILD_WITH_QT6 AND CMAKE_CXX_COMPILER STREQUAL "/usr/bin/c++" AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT "${CCACHE_COMPILER_TYPE}" STREQUAL "gcc")
|
||||||
else()
|
# Cf https://github.com/ccache/ccache/discussions/959
|
||||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
|
set(CCACHE_COMPILER_TYPE_GCC_REQUIRED ON)
|
||||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
|
else()
|
||||||
|
set(CCACHE_COMPILER_TYPE_GCC_REQUIRED OFF)
|
||||||
|
endif()
|
||||||
|
set(CCACHE_INVOCATION_COMMAND "ccache")
|
||||||
|
if (ccache_key_value_found_index EQUAL -1 )
|
||||||
|
if (CCACHE_SLOPPINESS_REQUIRED)
|
||||||
|
message(FATAL_ERROR "The use of precompiled headers only works if the ccache 'sloppiness' settings contains 'pch_defines' and 'time_macros'. Consider running 'ccache --set-config sloppiness=${CCACHE_SLOPPINESS_REQUIRED}' to define them")
|
||||||
|
endif()
|
||||||
|
if (CCACHE_COMPILER_TYPE_GCC_REQUIRED)
|
||||||
|
message(FATAL_ERROR "The use of precompiled headers only works properly with QT6 if the ccache 'compiler_type' settings is set to 'gcc'. Consider running 'ccache --set-config compiler_type=gcc'")
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
if (CCACHE_SLOPPINESS_REQUIRED)
|
||||||
|
string(APPEND CCACHE_INVOCATION_COMMAND " sloppiness=${CCACHE_SLOPPINESS_REQUIRED}")
|
||||||
|
endif()
|
||||||
|
if (CCACHE_COMPILER_TYPE_GCC_REQUIRED)
|
||||||
|
string(APPEND CCACHE_INVOCATION_COMMAND " compiler_type=gcc")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_INVOCATION_COMMAND}")
|
||||||
|
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "${CCACHE_INVOCATION_COMMAND}")
|
||||||
endif(CCACHE_FOUND)
|
endif(CCACHE_FOUND)
|
||||||
endif(USE_CCACHE)
|
endif(USE_CCACHE)
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ installroot="$BUILDDIR/dist"
|
|||||||
installprefix="$installroot/usr/$arch-w64-mingw32/sys-root/mingw"
|
installprefix="$installroot/usr/$arch-w64-mingw32/sys-root/mingw"
|
||||||
|
|
||||||
# To make ccache work properly with precompiled headers
|
# To make ccache work properly with precompiled headers
|
||||||
ccache --set-config sloppiness=pch_defines,time_macros
|
ccache --set-config sloppiness=pch_defines,time_macros,include_file_mtime,include_file_ctime
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
rm -rf "$installroot"
|
rm -rf "$installroot"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user