From 94551e3e6186a69128b4bac8a408b82646cd5cd8 Mon Sep 17 00:00:00 2001 From: Max Regan Date: Mon, 19 Feb 2018 04:34:33 +0000 Subject: [PATCH] build: add -flto flag for performance and perf configuration --- configure | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 026ecfb..a98488b 100755 --- a/configure +++ b/configure @@ -20,6 +20,9 @@ for arg in $@; do --coverage) coverage="yes" ;; + --perf) + perf="yes" + ;; *) echo "unknown option $arg" exit 1 @@ -62,8 +65,13 @@ if [[ "$coverage" == "yes" ]]; then ldflags_extra="$ldflags_extra -lgcov --coverage" fi +release_cflags="-O3 -flto" if [[ "$release" == "yes" ]]; then - ccflags_extra="$ccflags_extra -O3" + ccflags_extra="$ccflags_extra $release_cflags" +fi + +if [[ "$perf" == "yes" ]]; then + ccflags_extra="$ccflags_extra $release_cflags -ggdb" fi add_define CCFLAGS_EXTRA "$ccflags_extra"