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.
This commit is contained in:
sawinglogz 2021-12-06 15:46:49 -05:00
parent b96718afeb
commit be24a3ec4f

View File

@ -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 \