aboutsummaryrefslogtreecommitdiff
path: root/src/CmakeModule.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/CmakeModule.cpp')
-rw-r--r--src/CmakeModule.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/CmakeModule.cpp b/src/CmakeModule.cpp
index a706e64..65e0c92 100644
--- a/src/CmakeModule.cpp
+++ b/src/CmakeModule.cpp
@@ -194,6 +194,7 @@ namespace sibs
_putenv("CXXFLAGS=-fPIC");
#endif
#endif
+
std::vector<FileString> cmd = { cmakePath };
FileString cflags = TINYDIR_STRING("-fPIC");
@@ -238,6 +239,9 @@ namespace sibs
}
}
+ if(!config.linker.empty())
+ cflags += TINYDIR_STRING(" -fuse-ld=") + toFileString(config.linker);
+
cxxflags = cflags;
cmd.push_back(TINYDIR_STRING("-DCMAKE_C_FLAGS=") + cflags);
cmd.push_back(TINYDIR_STRING("-DCMAKE_CXX_FLAGS=") + cxxflags);
@@ -299,14 +303,16 @@ namespace sibs
return Result<bool>::Err(execResult);
//nprintf("Compiling cmake generated ninja file: %s\n", buildPath.c_str());
- execResult = exec({ TINYDIR_STRING("ninja"), TINYDIR_STRING("-C"), buildPath }, true);
- if(execResult.isOk())
- {
- if(execResult.unwrap().exitCode != 0)
- return Result<bool>::Err(execResult.unwrap().execStdout);
+ if(config.skipCompile) {
+ execResult = exec({ TINYDIR_STRING("ninja"), TINYDIR_STRING("-C"), buildPath }, true);
+ if(execResult.isOk())
+ {
+ if(execResult.unwrap().exitCode != 0)
+ return Result<bool>::Err(execResult.unwrap().execStdout);
+ }
+ else
+ return Result<bool>::Err(execResult);
}
- else
- return Result<bool>::Err(execResult);
if(config.getPackageType() != PackageType::EXECUTABLE)
{