aboutsummaryrefslogtreecommitdiff
path: root/src/CmakeModule.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-05-24 03:23:50 +0200
committerdec05eba <dec05eba@protonmail.com>2020-07-06 07:39:32 +0200
commit25601fbac722b9af61ebaf69014e4b73517aaf94 (patch)
treea89ed3fe91e1aae153e832f1362c5765e064f533 /src/CmakeModule.cpp
parent2cee880ef4ba9f4369b7e464eec87c4fec55d7fc (diff)
Add sanitize build/test option, currently ignored if gcc is not used
Diffstat (limited to 'src/CmakeModule.cpp')
-rw-r--r--src/CmakeModule.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/CmakeModule.cpp b/src/CmakeModule.cpp
index 15597cb..27047ba 100644
--- a/src/CmakeModule.cpp
+++ b/src/CmakeModule.cpp
@@ -121,6 +121,14 @@ namespace sibs
return createBuildDirResult;
FileString cmd = TINYDIR_STRING("cmake ");
+ if(config.getCompiler() == Compiler::GCC)
+ {
+ if(config.getSanitize())
+ {
+ cmd += TINYDIR_STRING(" \"-CMAKE_C_FLAGS=-fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined -lasan -lubsan\" "
+ "\"-CMAKE_CXX_FLAGS=-fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined -lasan -lubsan\"");
+ }
+ }
switch(config.getPackageType())
{
case PackageType::EXECUTABLE: