From be24a3ec4f2c4a1bf2d43d74b6ca5c6005c21dc4 Mon Sep 17 00:00:00 2001 From: sawinglogz <3787776-sawinglogz@users.noreply.gitlab.com> Date: Mon, 6 Dec 2021 15:46:49 -0500 Subject: [PATCH] Add -O3 flag when compiling crypto libraries. The optimized code is surprisingly fast, only a small percent slower than specialized instructions, which can't really be used with an amalgamation build of Botan. This makes DS2 regression tests way faster. --- oscar/oscar.pro | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/oscar/oscar.pro b/oscar/oscar.pro index f791dfc2..58317ad4 100644 --- a/oscar/oscar.pro +++ b/oscar/oscar.pro @@ -311,8 +311,6 @@ SOURCES += \ SleepLib/loader_plugins/somnopose_loader.cpp \ SleepLib/loader_plugins/viatom_loader.cpp \ SleepLib/loader_plugins/zeo_loader.cpp \ - SleepLib/thirdparty/botan_all.cpp \ - SleepLib/crypto.cpp \ zip.cpp \ SleepLib/thirdparty/miniz.c \ csv.cpp \ @@ -343,6 +341,19 @@ SOURCES += \ SOURCES += help.cpp } +# The crypto libraries need to be optimized to avoid a 5x slowdown or worse. +# Don't use this for everything, as it interferes with debugging. +SOURCES_OPTIMIZE = \ + SleepLib/thirdparty/botan_all.cpp \ + SleepLib/crypto.cpp +optimize.name = optimize +optimize.input = SOURCES_OPTIMIZE +optimize.dependency_type = TYPE_C +optimize.variable_out = OBJECTS +optimize.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_IN_BASE}$${first(QMAKE_EXT_OBJ)} +optimize.commands = $${QMAKE_CXX} -c $(CXXFLAGS) -O3 $(INCPATH) -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_IN} +QMAKE_EXTRA_COMPILERS += optimize + HEADERS += \ checkupdates.h \ common_gui.h \