aboutsummaryrefslogtreecommitdiff
path: root/backend/ninja
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-11-05 01:32:29 +0100
committerdec05eba <dec05eba@protonmail.com>2020-07-06 07:39:33 +0200
commit74fe535c397626cdaf5f51dfe6e32706abc4b468 (patch)
tree0e7c81633302df7a0b1d98829953ffd85da68a88 /backend/ninja
parent7c0ec4cc4360d086b09ea4ad2d05c3294d16cfb3 (diff)
Move build files into platform specific location
Diffstat (limited to 'backend/ninja')
-rw-r--r--backend/ninja/Ninja.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/backend/ninja/Ninja.cpp b/backend/ninja/Ninja.cpp
index f8c3ae9..37669da 100644
--- a/backend/ninja/Ninja.cpp
+++ b/backend/ninja/Ninja.cpp
@@ -746,7 +746,9 @@ namespace backend
if (!createBuildDirResult)
return createBuildDirResult;
- FileString generatedHeadersDir = config.getProjectPath() + TINYDIR_STRING("/sibs-build/generated-headers");
+ FileString generatedHeadersDir = config.getProjectPath() + TINYDIR_STRING("/sibs-build/");
+ generatedHeadersDir += toFileString(asString(config.platform)) + TINYDIR_STRING("/");
+ generatedHeadersDir += TINYDIR_STRING("generated-headers");
Result<bool> createGeneratedHeadersDirResult = createDirectoryRecursive(generatedHeadersDir.c_str());
if (!createGeneratedHeadersDirResult)
return createGeneratedHeadersDirResult;
@@ -780,7 +782,7 @@ namespace backend
string globalIncDir;
for(const auto &includeDir : config.getIncludeDirs())
{
- string includeDirRelative = "../../";
+ string includeDirRelative = "../../../";
includeDirRelative += includeDir;
globalIncDir += " ";
globalIncDir += getIncludeOptionFlag(config.getCompiler(), includeDirRelative);
@@ -1099,7 +1101,7 @@ namespace backend
// TODO: Remove --library c if project does not depend on c libraries or project only has .zig files
vector<ninja::NinjaArg> commonZigArgs = {
- ninja::NinjaArg::createRaw("-isystem ../../"),
+ ninja::NinjaArg::createRaw("-isystem ../../../"),
ninja::NinjaArg::createRaw("--color on"),
ninja::NinjaArg::createRaw("$globalIncDirZig")
};
@@ -1182,9 +1184,9 @@ namespace backend
ninja::NinjaArgValue zigHeaderFileValue = { zigHeaderFile, '"' + toUtf8(zigHeaderFileDir) + '/' + headerName + '"' };
ninja::NinjaBuild *ninjaBuild = nullptr;
if(zigTest)
- ninjaBuild = testZigRule->build("../../" + sourceFile.filepath, objectName, { zigHeaderFileValue });
+ ninjaBuild = testZigRule->build("../../../" + sourceFile.filepath, objectName, { zigHeaderFileValue });
else
- ninjaBuild = compileZigRule->build("../../" + sourceFile.filepath, objectName, { zigHeaderFileValue });
+ ninjaBuild = compileZigRule->build("../../../" + sourceFile.filepath, objectName, { zigHeaderFileValue });
zigBuilds.push_back(ninjaBuild);
objectNames.emplace_back(move(objectName));
@@ -1203,7 +1205,7 @@ namespace backend
{
objectName += config.getPackageName() + "@exe/" + sourceFile.filepath;
objectName += getObjectFileExtension(config.getCompiler());
- compileCRule->build("../../" + sourceFile.filepath, objectName, {}, zigBuilds);
+ compileCRule->build("../../../" + sourceFile.filepath, objectName, {}, zigBuilds);
usesCFiles = true;
break;
}
@@ -1211,7 +1213,7 @@ namespace backend
{
objectName += config.getPackageName() + "@exe/" + sourceFile.filepath;
objectName += getObjectFileExtension(config.getCompiler());
- compileCppRule->build("../../" + sourceFile.filepath, objectName, {}, zigBuilds);
+ compileCppRule->build("../../../" + sourceFile.filepath, objectName, {}, zigBuilds);
usesCppFiles = true;
break;
}
@@ -1776,13 +1778,14 @@ namespace backend
if(!ninja.getSourceFiles().empty())
{
FileString buildPath = testSourceDirNative;
+ buildPath += TINYDIR_STRING("/sibs-build/") + toFileString(asString(config.platform));
switch(sibsTestConfig.getOptimizationLevel())
{
case OPT_LEV_DEBUG:
- buildPath += TINYDIR_STRING("/sibs-build/debug");
+ buildPath += TINYDIR_STRING("/debug");
break;
case OPT_LEV_RELEASE:
- buildPath += TINYDIR_STRING("/sibs-build/release");
+ buildPath += TINYDIR_STRING("/release");
break;
}