Skip to content

Commit

Permalink
qmake bugfix ccache on MinGW
Browse files Browse the repository at this point in the history
g++ doesn't work still, it reports Preprocessing failed.
  • Loading branch information
silverqx committed Jun 20, 2024
1 parent d487c8c commit dfb646b
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions qmake/features/tiny_ccache_win32.prf
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
# Target the g++, clang++, msvc, and clang-cl with msvc compilers
!win32|!msvc|mingw: return()
# Target the g++, clang++, MSVC, and Clang-cl with MSVC compilers and also MinGW
if(!win32|!msvc):!mingw: return()

# https://github.com/ccache/ccache/issues/1040
for(cfFlags, \
$$list(QMAKE_CFLAGS QMAKE_CXXFLAGS \
QMAKE_CFLAGS_DEBUG QMAKE_CXXFLAGS_DEBUG \
QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO \
# The Release build type shouldn't contain this flag but replace it anyway
QMAKE_CFLAGS_RELEASE QMAKE_CXXFLAGS_RELEASE) \
): \
!isEmpty($$cfFlags): \
# Replace -Zi and -ZI with the -Z7
# The ~= doesn't work with \/ character
$$cfFlags = $$replace($$cfFlags, "(?:-|\/)(?:Zi|ZI)", -Z7)
msvc: \
for(cfFlags, \
$$list(QMAKE_CFLAGS QMAKE_CXXFLAGS \
QMAKE_CFLAGS_DEBUG QMAKE_CXXFLAGS_DEBUG \
QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO \
# The Release build type shouldn't contain this flag but replace it anyway
QMAKE_CFLAGS_RELEASE QMAKE_CXXFLAGS_RELEASE) \
): \
!isEmpty($$cfFlags): \
# Replace -Zi and -ZI with the -Z7
# The ~= doesn't work with \/ character
$$cfFlags = $$replace($$cfFlags, "(?:-|\/)(?:Zi|ZI)", -Z7)

load(private/tiny_ccache_version)

Expand Down

0 comments on commit dfb646b

Please sign in to comment.