Enable Ccache+clang+pch combination.

This commit is contained in:
Roman Telezhynskyi 2024-01-10 14:22:23 +02:00
parent bd25db3610
commit 67bcc9ee59
3 changed files with 19 additions and 11 deletions

View File

@ -113,7 +113,7 @@ linux_task:
<< : *LINUX_QT5_QBS_TASK_TEMPLATE << : *LINUX_QT5_QBS_TASK_TEMPLATE
env: env:
QT_SELECT: "qt5" QT_SELECT: "qt5"
ENABLE_CCACHE: false ENABLE_CCACHE: true
container: container:
cpu: 2 cpu: 2
memory: 6G # Set to 6GB to avoid OOM. https://cirrus-ci.org/guide/linux/#linux-container memory: 6G # Set to 6GB to avoid OOM. https://cirrus-ci.org/guide/linux/#linux-container
@ -121,7 +121,7 @@ linux_task:
<< : *LINUX_QT6_TASK_TEMPLATE << : *LINUX_QT6_TASK_TEMPLATE
env: env:
QT_SELECT: "qt6" QT_SELECT: "qt6"
ENABLE_CCACHE: false ENABLE_CCACHE: true
container: container:
cpu: 8 cpu: 8
memory: 8G # Set to 8GB to avoid OOM. https://cirrus-ci.org/guide/linux/#linux-container memory: 8G # Set to 8GB to avoid OOM. https://cirrus-ci.org/guide/linux/#linux-container
@ -301,7 +301,7 @@ macos_task:
ARCH: armv8 ARCH: armv8
PLATFORM: "macOS_12.4+" PLATFORM: "macOS_12.4+"
MACOS_DEPLOYMENT_TARGET: 12.0 MACOS_DEPLOYMENT_TARGET: 12.0
ENABLE_CCACHE: false ENABLE_CCACHE: true
matrix: matrix:
- name: 'macOS Monterey 12 [signle bundle, no tests]' - name: 'macOS Monterey 12 [signle bundle, no tests]'
env: env:

View File

@ -739,8 +739,8 @@ for:
- qbs setup-qt $(brew --prefix qt6)/bin/qmake qt6 - qbs setup-qt $(brew --prefix qt6)/bin/qmake qt6
- qbs config defaultProfile qt6 - qbs config defaultProfile qt6
- qbs config profiles.qt6.baseProfile clang - qbs config profiles.qt6.baseProfile clang
- qbs build -f valentina.qbs -d ${APPVEYOR_BUILD_FOLDER}/build --jobs $(nproc) config:release modules.buildconfig.enableUnitTests:false modules.buildconfig.enableMultiBundle:${MULTI_BUNDLE} qbs.installRoot:${APPVEYOR_BUILD_FOLDER}/build/install-root profile:qt6 project.minimumMacosVersion:${MACOS_DEPLOYMENT_TARGET} modules.buildconfig.enableCcache:false moduleProviders.qbspkgconfig.extraPaths:$(brew --prefix xerces-c)/lib/pkgconfig,$(brew --prefix qt6)/lib/pkgconfig,$(brew --prefix openssl@1.1)/lib/pkgconfig "modules.buildconfig.signingIdentity:$MACOS_CERTIFICATE_NAME" modules.macdeployqt.libpath:$(brew --prefix qt6)/lib,$(brew --prefix poppler)/lib modules.macdeployqt.macdeployqtProgramBinPath:${HOME}/macdeployqt-install-dir - qbs build -f valentina.qbs -d ${APPVEYOR_BUILD_FOLDER}/build --jobs $(nproc) config:release modules.buildconfig.enableUnitTests:false modules.buildconfig.enableMultiBundle:${MULTI_BUNDLE} qbs.installRoot:${APPVEYOR_BUILD_FOLDER}/build/install-root profile:qt6 project.minimumMacosVersion:${MACOS_DEPLOYMENT_TARGET} modules.buildconfig.enableCcache:true moduleProviders.qbspkgconfig.extraPaths:$(brew --prefix xerces-c)/lib/pkgconfig,$(brew --prefix qt6)/lib/pkgconfig,$(brew --prefix openssl@1.1)/lib/pkgconfig "modules.buildconfig.signingIdentity:$MACOS_CERTIFICATE_NAME" modules.macdeployqt.libpath:$(brew --prefix qt6)/lib,$(brew --prefix poppler)/lib modules.macdeployqt.macdeployqtProgramBinPath:${HOME}/macdeployqt-install-dir
- qbs build -f valentina.qbs -d ${APPVEYOR_BUILD_FOLDER}/build -p 'Valentina DMG' --force-probe-execution --jobs $(nproc) config:release modules.buildconfig.enableUnitTests:false modules.buildconfig.enableMultiBundle:${MULTI_BUNDLE} qbs.installRoot:${APPVEYOR_BUILD_FOLDER}/build/install-root profile:qt6 project.minimumMacosVersion:${MACOS_DEPLOYMENT_TARGET} modules.buildconfig.enableCcache:false moduleProviders.qbspkgconfig.extraPaths:$(brew --prefix xerces-c)/lib/pkgconfig,$(brew --prefix qt6)/lib/pkgconfig,$(brew --prefix openssl@1.1)/lib/pkgconfig "modules.buildconfig.signingIdentity:$MACOS_CERTIFICATE_NAME" modules.macdeployqt.libpath:$(brew --prefix qt6)/lib,$(brew --prefix poppler)/lib modules.macdeployqt.macdeployqtProgramBinPath:${HOME}/macdeployqt-install-dir - qbs build -f valentina.qbs -d ${APPVEYOR_BUILD_FOLDER}/build -p 'Valentina DMG' --force-probe-execution --jobs $(nproc) config:release modules.buildconfig.enableUnitTests:false modules.buildconfig.enableMultiBundle:${MULTI_BUNDLE} qbs.installRoot:${APPVEYOR_BUILD_FOLDER}/build/install-root profile:qt6 project.minimumMacosVersion:${MACOS_DEPLOYMENT_TARGET} modules.buildconfig.enableCcache:true moduleProviders.qbspkgconfig.extraPaths:$(brew --prefix xerces-c)/lib/pkgconfig,$(brew --prefix qt6)/lib/pkgconfig,$(brew --prefix openssl@1.1)/lib/pkgconfig "modules.buildconfig.signingIdentity:$MACOS_CERTIFICATE_NAME" modules.macdeployqt.libpath:$(brew --prefix qt6)/lib,$(brew --prefix poppler)/lib modules.macdeployqt.macdeployqtProgramBinPath:${HOME}/macdeployqt-install-dir
# Store the notarization credentials so that we can prevent a UI password dialog # Store the notarization credentials so that we can prevent a UI password dialog
# from blocking the CI # from blocking the CI
- echo "Create keychain profile" - echo "Create keychain profile"
@ -922,8 +922,8 @@ for:
- qbs setup-qt ${QTDIR}/bin/qmake qt5 - qbs setup-qt ${QTDIR}/bin/qmake qt5
- qbs config defaultProfile qt5 - qbs config defaultProfile qt5
- qbs config profiles.qt5.baseProfile clang - qbs config profiles.qt5.baseProfile clang
- qbs build -f valentina.qbs -d ${APPVEYOR_BUILD_FOLDER}/build --jobs $(nproc) config:release modules.buildconfig.enableUnitTests:false modules.buildconfig.enableMultiBundle:${MULTI_BUNDLE} qbs.installRoot:${APPVEYOR_BUILD_FOLDER}/build/install-root profile:qt5 project.minimumMacosVersion:${MACOS_DEPLOYMENT_TARGET} modules.buildconfig.enableCcache:false moduleProviders.qbspkgconfig.extraPaths:$(brew --prefix xerces-c)/lib/pkgconfig "modules.buildconfig.signingIdentity:$MACOS_CERTIFICATE_NAME" modules.macdeployqt.libpath:${QTDIR}/lib modules.macdeployqt.pluginspath:${QTDIR}/plugins modules.macdeployqt.macdeployqtProgramBinPath:${HOME}/macdeployqt-install-dir - qbs build -f valentina.qbs -d ${APPVEYOR_BUILD_FOLDER}/build --jobs $(nproc) config:release modules.buildconfig.enableUnitTests:false modules.buildconfig.enableMultiBundle:${MULTI_BUNDLE} qbs.installRoot:${APPVEYOR_BUILD_FOLDER}/build/install-root profile:qt5 project.minimumMacosVersion:${MACOS_DEPLOYMENT_TARGET} modules.buildconfig.enableCcache:true moduleProviders.qbspkgconfig.extraPaths:$(brew --prefix xerces-c)/lib/pkgconfig "modules.buildconfig.signingIdentity:$MACOS_CERTIFICATE_NAME" modules.macdeployqt.libpath:${QTDIR}/lib modules.macdeployqt.pluginspath:${QTDIR}/plugins modules.macdeployqt.macdeployqtProgramBinPath:${HOME}/macdeployqt-install-dir
- qbs build -f valentina.qbs -d ${APPVEYOR_BUILD_FOLDER}/build -p 'Valentina DMG' --force-probe-execution --jobs $(nproc) config:release modules.buildconfig.enableUnitTests:false modules.buildconfig.enableMultiBundle:${MULTI_BUNDLE} qbs.installRoot:${APPVEYOR_BUILD_FOLDER}/build/install-root profile:qt5 project.minimumMacosVersion:${MACOS_DEPLOYMENT_TARGET} modules.buildconfig.enableCcache:false moduleProviders.qbspkgconfig.extraPaths:$(brew --prefix xerces-c)/lib/pkgconfig "modules.buildconfig.signingIdentity:$MACOS_CERTIFICATE_NAME" modules.macdeployqt.libpath:${QTDIR}/lib modules.macdeployqt.pluginspath:${QTDIR}/plugins modules.macdeployqt.macdeployqtProgramBinPath:${HOME}/macdeployqt-install-dir - qbs build -f valentina.qbs -d ${APPVEYOR_BUILD_FOLDER}/build -p 'Valentina DMG' --force-probe-execution --jobs $(nproc) config:release modules.buildconfig.enableUnitTests:false modules.buildconfig.enableMultiBundle:${MULTI_BUNDLE} qbs.installRoot:${APPVEYOR_BUILD_FOLDER}/build/install-root profile:qt5 project.minimumMacosVersion:${MACOS_DEPLOYMENT_TARGET} modules.buildconfig.enableCcache:true moduleProviders.qbspkgconfig.extraPaths:$(brew --prefix xerces-c)/lib/pkgconfig "modules.buildconfig.signingIdentity:$MACOS_CERTIFICATE_NAME" modules.macdeployqt.libpath:${QTDIR}/lib modules.macdeployqt.pluginspath:${QTDIR}/plugins modules.macdeployqt.macdeployqtProgramBinPath:${HOME}/macdeployqt-install-dir
# Store the notarization credentials so that we can prevent a UI password dialog # Store the notarization credentials so that we can prevent a UI password dialog
# from blocking the CI # from blocking the CI
- echo "Create keychain profile" - echo "Create keychain profile"

View File

@ -42,6 +42,8 @@ Module {
property bool pchSupport property bool pchSupport
readonly property bool clangToolchain: product.qbs.toolchain.contains("gcc") && product.qbs.toolchain.contains("clang")
configure: { configure: {
var detector = new Process(); var detector = new Process();
try { try {
@ -49,13 +51,19 @@ Module {
var version = detector.readStdOut().trim(); // we can read only one time var version = detector.readStdOut().trim(); // we can read only one time
pchSupport = Utilities.versionCompare(version, "3.1.0") >= 0; pchSupport = Utilities.versionCompare(version, "3.1.0") >= 0;
if (!pchSupport && Utilities.versionCompare(version, "3.1.0") < 0){ if (!pchSupport){
console.info("ccache is tool old, version >= 3.1.0 required to work with precompiled headers."); console.info("ccache is tool old, version >= 3.1.0 required to work with precompiled headers.");
pchSupport = false; pchSupport = false;
}else{
if (clangToolchain) {
if (Utilities.versionCompare(version, "4.6") < 0) {
console.info("ccache version < 4.6 is not compatible with Clang and precompiled headers.");
pchSupport = false;
}
} else {
console.info("ccache supports compilation with precompiled headers.");
}
} }
if (pchSupport)
console.info("ccache supports compilation with precompiled headers.")
} }
} finally { } finally {
detector.close(); detector.close();