From 7038c25c393338d6b366275dc7e8f5f332cfb3e2 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 16 Nov 2015 12:22:34 +0200 Subject: [PATCH] Turn on PCH on mac os x. --HG-- branch : develop --- common.pri | 29 ++++++++++--------- src/app/tape/tape.pro | 11 +------ src/app/valentina/valentina.pro | 10 +------ src/libs/ifc/ifc.pro | 3 -- src/libs/qmuparser/qmuparser.pro | 3 -- src/libs/vdxf/vdxf.pro | 3 -- src/libs/vformat/vformat.pro | 3 -- src/libs/vgeometry/vgeometry.pro | 3 -- src/libs/vlayout/vlayout.pro | 3 -- src/libs/vmisc/vmisc.pro | 3 -- src/libs/vobj/vobj.pro | 3 -- src/libs/vpatterndb/vpatterndb.pro | 3 -- .../vpropertyexplorer/vpropertyexplorer.pro | 3 -- src/libs/vtools/vtools.pro | 3 -- src/libs/vwidgets/vwidgets.pro | 3 -- src/test/ParserTest/ParserTest.pro | 3 -- src/test/ValentinaTest/ValentinaTest.pro | 3 -- 17 files changed, 18 insertions(+), 74 deletions(-) diff --git a/common.pri b/common.pri index dbf41753a..d66462cd6 100644 --- a/common.pri +++ b/common.pri @@ -13,6 +13,11 @@ win32{ QMAKE_INSTALL_PROGRAM = xcopy /y } +macx{ + # QTBUG-31034 qmake doesn't allow override QMAKE_CXX + CONFIG+=no_ccache +} + CONFIG(release, debug|release){ !noDebugSymbols:win32:!win32-msvc*{ unset(QMAKE_STRIP) @@ -100,20 +105,16 @@ defineTest(forceCopyToDestdir) { # We use precompiled headers for more fast compilation source code. defineReplace(set_PCH){ - unix:no_ccache|win32{ - macx:clang*{ - # Precompiled headers don't work with clang on macx. - } else { - CONFIG += precompile_header # Turn on creation precompiled headers (PCH). - export(CONFIG) # export value to global variable. + no_ccache{ + CONFIG += precompile_header # Turn on creation precompiled headers (PCH). + export(CONFIG) # export value to global variable. - PRECOMPILED_HEADER = stable.h # Header file with all all static headers: libraries, static local headers. - export(PRECOMPILED_HEADER) # export value to global variable + PRECOMPILED_HEADER = stable.h # Header file with all all static headers: libraries, static local headers. + export(PRECOMPILED_HEADER) # export value to global variable - win32-msvc* { - PRECOMPILED_SOURCE = stable.cpp # MSVC need also cpp file. - export(PRECOMPILED_SOURCE) # export value to global variable. - } + win32-msvc* { + PRECOMPILED_SOURCE = stable.cpp # MSVC need also cpp file. + export(PRECOMPILED_SOURCE) # export value to global variable. } } return(true) @@ -121,7 +122,7 @@ defineReplace(set_PCH){ defineReplace(enable_ccache){ no_ccache{ # For enable run qmake with CONFIG+=no_ccache - # do nothing + $$set_PCH() } else { # ccache support only Unix systems. unix:{ @@ -140,6 +141,8 @@ defineReplace(enable_ccache){ QMAKE_CXX = ccache clang++ export(QMAKE_CXX) # export value to global variable. } + } else { + $$set_PCH() } } return(true) diff --git a/src/app/tape/tape.pro b/src/app/tape/tape.pro index 2a0ff498d..d44fdc787 100644 --- a/src/app/tape/tape.pro +++ b/src/app/tape/tape.pro @@ -59,16 +59,7 @@ OTHER_FILES += \ $$DATA_RESOURCE # Set using ccache. Function enable_ccache() defined in common.pri. -macx { - CONFIG(debug, debug|release){ - $$enable_ccache()# Use only in debug mode on Mac - } -} else { - $$enable_ccache() -} - -# Set precompiled headers. Function set_PCH() defined in common.pri. -$$set_PCH() +$$enable_ccache() CONFIG(debug, debug|release){ # Debug mode diff --git a/src/app/valentina/valentina.pro b/src/app/valentina/valentina.pro index 707cc2254..81b9b0589 100644 --- a/src/app/valentina/valentina.pro +++ b/src/app/valentina/valentina.pro @@ -57,16 +57,8 @@ OTHER_FILES += \ share/resources/icon/64x64/icon64x64.ico # Valentina's logo. # Set using ccache. Function enable_ccache() defined in common.pri. -macx { - CONFIG(debug, debug|release){ - $$enable_ccache()# Use only in debug mode on Mac - } -} else { - $$enable_ccache() -} +$$enable_ccache() -# Set precompiled headers. Function set_PCH() defined in common.pri. -$$set_PCH() CONFIG(debug, debug|release){ # Debug mode diff --git a/src/libs/ifc/ifc.pro b/src/libs/ifc/ifc.pro index 34cde58e8..aa213c227 100644 --- a/src/libs/ifc/ifc.pro +++ b/src/libs/ifc/ifc.pro @@ -53,9 +53,6 @@ RESOURCES += \ # Set using ccache. Function enable_ccache() defined in common.pri. $$enable_ccache() -# Set precompiled headers. Function set_PCH() defined in common.pri. -$$set_PCH() - CONFIG(debug, debug|release){ # Debug mode unix { diff --git a/src/libs/qmuparser/qmuparser.pro b/src/libs/qmuparser/qmuparser.pro index ae73947dc..026c57a4f 100644 --- a/src/libs/qmuparser/qmuparser.pro +++ b/src/libs/qmuparser/qmuparser.pro @@ -62,9 +62,6 @@ unix:!macx{ # Set using ccache. Function enable_ccache() defined in common.pri. $$enable_ccache() -# Set precompiled headers. Function set_PCH() defined in common.pri. -$$set_PCH() - CONFIG(debug, debug|release){ # Debug mode unix { diff --git a/src/libs/vdxf/vdxf.pro b/src/libs/vdxf/vdxf.pro index 5072670b3..7155fcaf7 100644 --- a/src/libs/vdxf/vdxf.pro +++ b/src/libs/vdxf/vdxf.pro @@ -40,9 +40,6 @@ OBJECTS_DIR = obj # Set using ccache. Function enable_ccache() defined in common.pri. $$enable_ccache() -# Set precompiled headers. Function set_PCH() defined in common.pri. -$$set_PCH() - CONFIG(debug, debug|release){ # Debug mode unix { diff --git a/src/libs/vformat/vformat.pro b/src/libs/vformat/vformat.pro index a15b528fc..e75fc6c3d 100644 --- a/src/libs/vformat/vformat.pro +++ b/src/libs/vformat/vformat.pro @@ -46,9 +46,6 @@ OBJECTS_DIR = obj # Set using ccache. Function enable_ccache() defined in common.pri. $$enable_ccache() -# Set precompiled headers. Function set_PCH() defined in common.pri. -$$set_PCH() - CONFIG(debug, debug|release){ # Debug mode unix { diff --git a/src/libs/vgeometry/vgeometry.pro b/src/libs/vgeometry/vgeometry.pro index 05ee6a629..61861480f 100644 --- a/src/libs/vgeometry/vgeometry.pro +++ b/src/libs/vgeometry/vgeometry.pro @@ -40,9 +40,6 @@ OBJECTS_DIR = obj # Set using ccache. Function enable_ccache() defined in common.pri. $$enable_ccache() -# Set precompiled headers. Function set_PCH() defined in common.pri. -$$set_PCH() - CONFIG(debug, debug|release){ # Debug mode unix { diff --git a/src/libs/vlayout/vlayout.pro b/src/libs/vlayout/vlayout.pro index 694a78248..80467fefc 100644 --- a/src/libs/vlayout/vlayout.pro +++ b/src/libs/vlayout/vlayout.pro @@ -45,9 +45,6 @@ RCC_DIR = rcc # Set using ccache. Function enable_ccache() defined in common.pri. $$enable_ccache() -# Set precompiled headers. Function set_PCH() defined in common.pri. -$$set_PCH() - CONFIG(debug, debug|release){ # Debug mode unix { diff --git a/src/libs/vmisc/vmisc.pro b/src/libs/vmisc/vmisc.pro index 0072a2f51..a674a672f 100644 --- a/src/libs/vmisc/vmisc.pro +++ b/src/libs/vmisc/vmisc.pro @@ -48,9 +48,6 @@ OBJECTS_DIR = obj # Set using ccache. Function enable_ccache() defined in common.pri. $$enable_ccache() -# Set precompiled headers. Function set_PCH() defined in common.pri. -$$set_PCH() - CONFIG(debug, debug|release){ # Debug mode unix { diff --git a/src/libs/vobj/vobj.pro b/src/libs/vobj/vobj.pro index 62d9595e1..7008b2559 100644 --- a/src/libs/vobj/vobj.pro +++ b/src/libs/vobj/vobj.pro @@ -40,9 +40,6 @@ OBJECTS_DIR = obj # Set using ccache. Function enable_ccache() defined in common.pri. $$enable_ccache() -# Set precompiled headers. Function set_PCH() defined in common.pri. -$$set_PCH() - CONFIG(debug, debug|release){ # Debug mode unix { diff --git a/src/libs/vpatterndb/vpatterndb.pro b/src/libs/vpatterndb/vpatterndb.pro index f560bbec6..28d254840 100644 --- a/src/libs/vpatterndb/vpatterndb.pro +++ b/src/libs/vpatterndb/vpatterndb.pro @@ -43,9 +43,6 @@ OBJECTS_DIR = obj # Set using ccache. Function enable_ccache() defined in common.pri. $$enable_ccache() -# Set precompiled headers. Function set_PCH() defined in common.pri. -$$set_PCH() - CONFIG(debug, debug|release){ # Debug mode unix { diff --git a/src/libs/vpropertyexplorer/vpropertyexplorer.pro b/src/libs/vpropertyexplorer/vpropertyexplorer.pro index f471efb0f..36302808b 100644 --- a/src/libs/vpropertyexplorer/vpropertyexplorer.pro +++ b/src/libs/vpropertyexplorer/vpropertyexplorer.pro @@ -60,9 +60,6 @@ unix:!macx{ # Set using ccache. Function enable_ccache() defined in common.pri. $$enable_ccache() -# Set precompiled headers. Function set_PCH() defined in common.pri. -$$set_PCH() - CONFIG(debug, debug|release){ # Debug mode unix { diff --git a/src/libs/vtools/vtools.pro b/src/libs/vtools/vtools.pro index 53ed935a5..fe30de8e8 100644 --- a/src/libs/vtools/vtools.pro +++ b/src/libs/vtools/vtools.pro @@ -48,9 +48,6 @@ UI_DIR = uic # Set using ccache. Function enable_ccache() defined in common.pri. $$enable_ccache() -# Set precompiled headers. Function set_PCH() defined in common.pri. -$$set_PCH() - INCLUDEPATH += $$PWD/../vpatterndb CONFIG(debug, debug|release){ diff --git a/src/libs/vwidgets/vwidgets.pro b/src/libs/vwidgets/vwidgets.pro index 83210ebe3..8eb426b73 100644 --- a/src/libs/vwidgets/vwidgets.pro +++ b/src/libs/vwidgets/vwidgets.pro @@ -42,9 +42,6 @@ OBJECTS_DIR = obj # Set using ccache. Function enable_ccache() defined in common.pri. $$enable_ccache() -# Set precompiled headers. Function set_PCH() defined in common.pri. -$$set_PCH() - CONFIG(debug, debug|release){ # Debug mode unix { diff --git a/src/test/ParserTest/ParserTest.pro b/src/test/ParserTest/ParserTest.pro index d54585f8d..bd360e7f6 100644 --- a/src/test/ParserTest/ParserTest.pro +++ b/src/test/ParserTest/ParserTest.pro @@ -48,9 +48,6 @@ SOURCES += \ # Set using ccache. Function enable_ccache() defined in common.pri. $$enable_ccache() -# Set precompiled headers. Function set_PCH() defined in common.pri. -$$set_PCH() - CONFIG(debug, debug|release){ # Debug mode unix { diff --git a/src/test/ValentinaTest/ValentinaTest.pro b/src/test/ValentinaTest/ValentinaTest.pro index eeb5058d2..db9955b56 100644 --- a/src/test/ValentinaTest/ValentinaTest.pro +++ b/src/test/ValentinaTest/ValentinaTest.pro @@ -75,9 +75,6 @@ HEADERS += \ # Set using ccache. Function enable_ccache() defined in common.pri. $$enable_ccache() -# Set precompiled headers. Function set_PCH() defined in common.pri. -$$set_PCH() - CONFIG(debug, debug|release){ # Debug mode unix {