forked from qt-creator/qt-creator
Botan: Enable optimizations in release mode
Because we override the cxx flags manually to silence some warnings, we have to pass the -O flag too. On my machine, this results in a speed-up of factor four when uplading via SFTP. Change-Id: I3279f0cc95624530fdb5b7ea868a8a51962fb4f8 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -33,9 +33,14 @@ msvc: BOTAN_CXX_FLAGS += /wd4100 /wd4800 /wd4127 /wd4244 /wd4250 /wd4267 /wd4334
|
|||||||
else: BOTAN_CXX_FLAGS += -Wno-unused-parameter
|
else: BOTAN_CXX_FLAGS += -Wno-unused-parameter
|
||||||
macos: BOTAN_CXX_FLAGS += -mmacosx-version-min=$$QMAKE_MACOSX_DEPLOYMENT_TARGET -isysroot $$shell_quote($$QMAKE_MAC_SDK_PATH)
|
macos: BOTAN_CXX_FLAGS += -mmacosx-version-min=$$QMAKE_MACOSX_DEPLOYMENT_TARGET -isysroot $$shell_quote($$QMAKE_MAC_SDK_PATH)
|
||||||
unix: BOTAN_CXX_FLAGS += -fPIC
|
unix: BOTAN_CXX_FLAGS += -fPIC
|
||||||
!isEmpty(BOTAN_CXX_FLAGS): OTHER_FLAGS += --cxxflags=$$shell_quote($$BOTAN_CXX_FLAGS)
|
|
||||||
win32: OTHER_FLAGS += --link-method=hardlink
|
win32: OTHER_FLAGS += --link-method=hardlink
|
||||||
CONFIG(debug, debug|release): OTHER_FLAGS += --debug-mode
|
CONFIG(debug, debug|release) {
|
||||||
|
OTHER_FLAGS += --with-debug-info
|
||||||
|
} else {
|
||||||
|
msvc: BOTAN_CXX_FLAGS += /O2
|
||||||
|
else: BOTAN_CXX_FLAGS += -O3
|
||||||
|
}
|
||||||
|
!isEmpty(BOTAN_CXX_FLAGS): OTHER_FLAGS += --cxxflags=$$shell_quote($$BOTAN_CXX_FLAGS)
|
||||||
CONFIGURE_FILE_PATH_FOR_SHELL = $$shell_quote($$shell_path($$BOTAN_SOURCE_DIR/configure.py))
|
CONFIGURE_FILE_PATH_FOR_SHELL = $$shell_quote($$shell_path($$BOTAN_SOURCE_DIR/configure.py))
|
||||||
|
|
||||||
configure_inputs = $$BOTAN_SOURCE_DIR/configure.py
|
configure_inputs = $$BOTAN_SOURCE_DIR/configure.py
|
||||||
|
@@ -42,7 +42,8 @@ Product {
|
|||||||
+ "sha2_32,sha2_32_x86,sha2_64,simd,system_rng,emsa_pkcs1,pbes2,pbkdf2";
|
+ "sha2_32,sha2_32_x86,sha2_64,simd,system_rng,emsa_pkcs1,pbes2,pbkdf2";
|
||||||
args.push("--enable-modules=" + modules);
|
args.push("--enable-modules=" + modules);
|
||||||
var cxxFlags = [];
|
var cxxFlags = [];
|
||||||
if (product.qbs.toolchain.contains("msvc")) {
|
var tc = product.qbs.toolchain;
|
||||||
|
if (tc.contains("msvc")) {
|
||||||
cxxFlags.push("/wd4100", "/wd4800", "/wd4127", "/wd4244", "/wd4250", "/wd4267",
|
cxxFlags.push("/wd4100", "/wd4800", "/wd4127", "/wd4244", "/wd4250", "/wd4267",
|
||||||
"/wd4334", "/wd4702", "/wd4996", "/D_ENABLE_EXTENDED_ALIGNED_STORAGE");
|
"/wd4334", "/wd4702", "/wd4996", "/D_ENABLE_EXTENDED_ALIGNED_STORAGE");
|
||||||
}
|
}
|
||||||
@@ -55,10 +56,11 @@ Product {
|
|||||||
}
|
}
|
||||||
if (product.qbs.targetOS.contains("unix"))
|
if (product.qbs.targetOS.contains("unix"))
|
||||||
cxxFlags.push("-fPIC");
|
cxxFlags.push("-fPIC");
|
||||||
|
if (product.qbs.buildVariant === "release")
|
||||||
|
cxxFlags.push(tc.contains("msvc") ? "/O2" : "-O3");
|
||||||
if (cxxFlags.length > 0)
|
if (cxxFlags.length > 0)
|
||||||
args.push("--cxxflags=" + cxxFlags.join(" "));
|
args.push("--cxxflags=" + cxxFlags.join(" "));
|
||||||
var ccOption = "--cc=";
|
var ccOption = "--cc=";
|
||||||
var tc = product.qbs.toolchain;
|
|
||||||
if (tc.contains("msvc"))
|
if (tc.contains("msvc"))
|
||||||
ccOption += "msvc";
|
ccOption += "msvc";
|
||||||
else if (tc.contains("clang"))
|
else if (tc.contains("clang"))
|
||||||
|
Reference in New Issue
Block a user