summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2020-08-20 17:28:12 +0300
committerMonty <monty@mariadb.org>2020-08-20 19:34:11 +0300
commit76a922700184f9aef021719f3f5b165a60a1ed50 (patch)
tree9cff8d058a08e188e54bda5e9111717004552a0d /CMakeLists.txt
parent65c43bcfe276dba545b1985443322fbb07c1a49a (diff)
downloadmariadb-git-76a922700184f9aef021719f3f5b165a60a1ed50.tar.gz
Added support of WITH_GPROF to cmake
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt7
1 files changed, 6 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 80fac4b2ccc..36922e04368 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -242,13 +242,18 @@ IF (WITH_MSAN)
MY_CHECK_AND_SET_COMPILER_FLAG("-fsanitize=memory -fsanitize-memory-track-origins -U_FORTIFY_SOURCE" DEBUG RELWITHDEBINFO)
ENDIF()
+OPTION(WITH_GPROF "Enable profilingg with gprof" OFF)
+IF (WITH_GPROF)
+ MY_CHECK_AND_SET_COMPILER_FLAG("-pg -g -no-pie -fPIC")
+ENDIF()
+
# Be nice to profilers etc
MY_CHECK_AND_SET_COMPILER_FLAG("-fno-omit-frame-pointer" RELWITHDEBINFO)
# enable security hardening features, like most distributions do
# in our benchmarks that costs about ~1% of performance, depending on the load
OPTION(SECURITY_HARDENED "Use security-enhancing compiler features (stack protector, relro, etc)" ON)
-IF(SECURITY_HARDENED AND NOT WITH_ASAN AND NOT WITH_UBSAN AND NOT WITH_TSAN)
+IF(SECURITY_HARDENED AND NOT WITH_ASAN AND NOT WITH_UBSAN AND NOT WITH_TSAN AND NOT WITH_GPROF)
# security-enhancing flags
MY_CHECK_AND_SET_COMPILER_FLAG("-pie -fPIC")
MY_CHECK_AND_SET_LINKER_FLAG("-Wl,-z,relro,-z,now")