aboutsummaryrefslogtreecommitdiff
path: root/src/CmakeModule.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/CmakeModule.cpp')
-rw-r--r--src/CmakeModule.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/CmakeModule.cpp b/src/CmakeModule.cpp
index e3b3918..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");
@@ -239,7 +252,9 @@ namespace sibs
}
}
- if(!config.linker.empty())
+ if(config.linker == "mold")
+ cflags += TINYDIR_STRING(" -B/usr/lib/mold/");
+ else if(!config.linker.empty())
cflags += TINYDIR_STRING(" -fuse-ld=") + toFileString(config.linker);
cxxflags = cflags;