GCC warnings. Don't use PCH if use ccache.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2015-10-26 12:04:20 +02:00
parent d1f18dc9a0
commit f1796eaf90
5 changed files with 22 additions and 14 deletions

View File

@ -100,18 +100,20 @@ defineTest(forceCopyToDestdir) {
# We use precompiled headers for more fast compilation source code. # We use precompiled headers for more fast compilation source code.
defineReplace(set_PCH){ defineReplace(set_PCH){
macx:clang*{ unix:no_ccache|win32{
# Precompiled headers don't work with clang on macx. macx:clang*{
} else { # Precompiled headers don't work with clang on macx.
CONFIG += precompile_header # Turn on creation precompiled headers (PCH). } else {
export(CONFIG) # export value to global variable. 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. PRECOMPILED_HEADER = stable.h # Header file with all all static headers: libraries, static local headers.
export(PRECOMPILED_HEADER) # export value to global variable export(PRECOMPILED_HEADER) # export value to global variable
win32-msvc* { win32-msvc* {
PRECOMPILED_SOURCE = stable.cpp # MSVC need also cpp file. PRECOMPILED_SOURCE = stable.cpp # MSVC need also cpp file.
export(PRECOMPILED_SOURCE) # export value to global variable. export(PRECOMPILED_SOURCE) # export value to global variable.
}
} }
} }
return(true) return(true)

View File

@ -322,8 +322,8 @@ void QmuParser::InitFun()
*/ */
void QmuParser::InitConst() void QmuParser::InitConst()
{ {
DefineConst("_pi", (qreal)M_PI); DefineConst("_pi", static_cast<qreal>(M_PI));
DefineConst("_e", (qreal)M_E); DefineConst("_e", static_cast<qreal>(M_E));
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -1264,8 +1264,8 @@ int QmuParserTester::EqnTest ( const QString &a_str, double a_fRes, bool a_fPass
p1.reset ( new qmu::QmuParser() ); p1.reset ( new qmu::QmuParser() );
// Add constants // Add constants
p1->DefineConst ( "pi", ( qreal ) M_PI ); p1->DefineConst ( "pi", static_cast<qreal>(M_PI) );
p1->DefineConst ( "e", ( qreal ) M_E ); p1->DefineConst ( "e", static_cast<qreal>(M_E) );
p1->DefineConst ( "const", 1 ); p1->DefineConst ( "const", 1 );
p1->DefineConst ( "const1", 2 ); p1->DefineConst ( "const1", 2 );
p1->DefineConst ( "const2", 3 ); p1->DefineConst ( "const2", 3 );

View File

@ -31,6 +31,7 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <QtGlobal>
#include "dl_writer_ascii.h" #include "dl_writer_ascii.h"

View File

@ -59,6 +59,11 @@ CONFIG(debug, debug|release){
-isystem "$${OUT_PWD}/$${RCC_DIR}" \ -isystem "$${OUT_PWD}/$${RCC_DIR}" \
$$GCC_DEBUG_CXXFLAGS # See common.pri for more details. $$GCC_DEBUG_CXXFLAGS # See common.pri for more details.
# -isystem key works only for headers. In some cases it's not enough. But we can't delete these warnings and
# want them in the global list. Compromise decision is to delete them from the local list.
QMAKE_CXXFLAGS -= \
-Wno-long-long \
noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer
# do nothing # do nothing
} else { } else {