diff options
Diffstat (limited to 'backend/ninja')
-rw-r--r-- | backend/ninja/Ninja.cpp | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/backend/ninja/Ninja.cpp b/backend/ninja/Ninja.cpp index be8e303..7c0e9c0 100644 --- a/backend/ninja/Ninja.cpp +++ b/backend/ninja/Ninja.cpp @@ -809,6 +809,10 @@ namespace backend // TODO: Allow configuring default linking flags. Maybe have `package.useThreads = false` to disable this flag string allLinkerFlags; + + if(!config.linker.empty()) + allLinkerFlags += " -fuse-ld=" + config.linker; + if(isSamePlatformFamily(config.platform, PLATFORM_LINUX)) allLinkerFlags = "-pthread"; @@ -1703,13 +1707,15 @@ namespace backend if (fileOverwriteResult.isErr()) return fileOverwriteResult; - Result<bool> buildResult = compile(savePath); - if (!buildResult) - return buildResult; + if(config.skipCompile) { + Result<bool> buildResult = compile(savePath); + if (!buildResult) + return buildResult; + } if((config.isMainProject() && !config.shouldBuildTests()) || config.isTest()) { - buildResult = buildCompilationDatabase(savePath, config.getProjectPath()); + Result<bool> buildResult = buildCompilationDatabase(savePath, config.getProjectPath()); if(!buildResult) return buildResult; } @@ -1750,6 +1756,10 @@ namespace backend sibsTestConfig.setSanitize(config.getSanitize()); sibsTestConfig.zigTestFiles = move(config.zigTestFiles); sibsTestConfig.zigTestAllFiles = config.zigTestAllFiles; + sibsTestConfig.cVersion = config.cVersion; + sibsTestConfig.cppVersion = config.cppVersion; + sibsTestConfig.linker = config.linker; + sibsTestConfig.skipCompile = config.skipCompile; if(projectConfFileType == FileType::REGULAR) { Result<bool> result = Config::readFromFile(projectConfFilePath.data.c_str(), sibsTestConfig); @@ -1831,7 +1841,7 @@ namespace backend if (!buildFileResult) return buildFileResult; - if(!zigTest) + if(!zigTest && !config.testsBuildOnly) { Result<ExecResult> runTestResult = exec({ Path(buildPath).join(toFileString(sibsTestConfig.getPackageName())).data }, true); if(!runTestResult) |