aboutsummaryrefslogtreecommitdiff
path: root/src/CmakeModule.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2023-06-27 02:27:44 +0200
committerdec05eba <dec05eba@protonmail.com>2023-06-27 02:28:47 +0200
commitcf0c9479deedcbfc0592ac6d207b22ebf3655567 (patch)
tree008982a234f0a5ea7d1021dc151278dd143e669f /src/CmakeModule.cpp
parent0697f410b05085cdaf767d5b6fd3fea056ec5bd3 (diff)
Add --cpu=baseline|native option, propagate sanitize setting to sub projectsHEADmaster
Diffstat (limited to 'src/CmakeModule.cpp')
-rw-r--r--src/CmakeModule.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/CmakeModule.cpp b/src/CmakeModule.cpp
index 063cced..62aaf34 100644
--- a/src/CmakeModule.cpp
+++ b/src/CmakeModule.cpp
@@ -200,6 +200,19 @@ namespace sibs
FileString cflags = TINYDIR_STRING("-fPIC");
FileString cxxflags;
+ // TODO: msvc
+ if(config.getCompiler() == Compiler::GCC || config.getCompiler() == Compiler::MINGW_W64)
+ {
+ switch(config.cpu) {
+ case sibs::CPU_INVALID:
+ case sibs::CPU_BASELINE:
+ break;
+ case sibs::CPU_NATIVE:
+ cflags += TINYDIR_STRING(" -march=native");
+ break;
+ }
+ }
+
if(config.getCompiler() == Compiler::GCC || config.getCompiler() == Compiler::MINGW_W64)
{
cflags += TINYDIR_STRING(" -fno-omit-frame-pointer");