aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backend/ninja/Ninja.cpp6
-rw-r--r--src/main.cpp12
2 files changed, 10 insertions, 8 deletions
diff --git a/backend/ninja/Ninja.cpp b/backend/ninja/Ninja.cpp
index c642a4c..fc1142b 100644
--- a/backend/ninja/Ninja.cpp
+++ b/backend/ninja/Ninja.cpp
@@ -551,7 +551,7 @@ namespace backend
if(strncmp(&cLibraries[libraryIndexStart], "-l", 2) == 0)
libraryIndexStart += 2;
- else if(strcmp(&cLibraries[libraryIndexStart], "-pthread") == 0)
+ else if(strncmp(&cLibraries[libraryIndexStart], "-pthread", libraryIndexEnd - libraryIndexStart) == 0)
continue;
size_t libraryPathLength = libraryIndexEnd - libraryIndexStart;
@@ -571,13 +571,15 @@ namespace backend
if(strncmp(&cLibraries[libraryIndexStart], "-l", 2) == 0)
libraryIndexStart += 2;
- else if(strcmp(&cLibraries[libraryIndexStart], "-pthread") == 0)
+ else if(strncmp(&cLibraries[libraryIndexStart], "-pthread", libraryIndexEnd - libraryIndexStart) == 0)
continue;
size_t libraryPathLength = libraryIndexEnd - libraryIndexStart;
if(libraryPathLength > 0)
result.push_back(ninja::NinjaArg::createRaw(cLibraries.substr(libraryIndexStart, libraryPathLength)));
}
+ else
+ ++i;
}
return result;
diff --git a/src/main.cpp b/src/main.cpp
index 6c9df97..b232d93 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -285,6 +285,12 @@ int buildProject(const FileString &projectPath, const FileString &projectConfFil
break;
}
}
+
+ if(sibsConfig.shouldBuildTests() && sibsConfig.getTestPath().empty() && !sibsConfig.zigTestAllFiles && sibsConfig.zigTestFiles.empty())
+ {
+ printf("Project is missing package.tests config. No tests to build\n");
+ exit(50);
+ }
backend::BackendUtils::collectSourceFiles(projectPath.c_str(), &ninja, sibsConfig);
sibsConfig.setMainProject(true);
@@ -526,12 +532,6 @@ int testProject(int argc, const _tinydir_char_t **argv)
sibsConfig.zigTestFiles = move(filesToTest);
sibsConfig.zigTestAllFiles = testAllFiles;
- if(sibsConfig.getTestPath().empty() && !sibsConfig.zigTestAllFiles && sibsConfig.zigTestFiles.empty())
- {
- printf("Project is missing package.tests config. No tests to build\n");
- exit(50);
- }
-
return buildProject(projectPath, projectConfFilePath, sibsConfig);
}