aboutsummaryrefslogtreecommitdiff
path: root/src
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 /src
parent7c0ec4cc4360d086b09ea4ad2d05c3294d16cfb3 (diff)
Move build files into platform specific location
Diffstat (limited to 'src')
-rw-r--r--src/Conf.cpp2
-rw-r--r--src/GlobalLib.cpp2
-rw-r--r--src/main.cpp12
3 files changed, 11 insertions, 5 deletions
diff --git a/src/Conf.cpp b/src/Conf.cpp
index 7ae589e..aade4f7 100644
--- a/src/Conf.cpp
+++ b/src/Conf.cpp
@@ -527,7 +527,7 @@ namespace sibs
exit(6);
}
- buildPath = projectPath + TINYDIR_STRING("/sibs-build/");
+ buildPath = projectPath + TINYDIR_STRING("/sibs-build/") + toFileString(asString(sibsConfig.platform)) + TINYDIR_STRING("/");
if(sibsConfig.packaging)
{
buildPath += TINYDIR_STRING("package");
diff --git a/src/GlobalLib.cpp b/src/GlobalLib.cpp
index 5c0e16d..1a795bf 100644
--- a/src/GlobalLib.cpp
+++ b/src/GlobalLib.cpp
@@ -219,7 +219,7 @@ namespace sibs
return Result<bool>::Err(errMsg);
}
- FileString buildPath = packageDir + TINYDIR_STRING("/sibs-build/");
+ FileString buildPath = packageDir + TINYDIR_STRING("/sibs-build/") + toFileString(asString(sibsConfig.platform)) + TINYDIR_STRING("/");
switch (sibsConfig.getOptimizationLevel())
{
case OPT_LEV_DEBUG:
diff --git a/src/main.cpp b/src/main.cpp
index c8e9b27..c954634 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -126,6 +126,7 @@ static void usage()
printf(" init\t\tInitialize project in an existing directory\n");
printf(" test\t\tBuild and run tests for a sibs project\n");
printf(" package\t\tCreate a redistributable package from a sibs project. Note: Redistributable packages can't use system packages to build\n");
+ printf(" platform\t\tPrint name of platform (to stdout) and exit\n");
exit(1);
}
@@ -1153,7 +1154,7 @@ static int packageProject(int argc, const _tinydir_char_t **argv)
{
case PackagingType::STATIC:
{
- string packagePath = toUtf8(projectPath + TINYDIR_STRING("/sibs-build/package"));
+ string packagePath = toUtf8(projectPath + TINYDIR_STRING("/sibs-build/") + toFileString(asString(sibsConfig.platform)) + TINYDIR_STRING("/package"));
printf("Project %s was successfully packaged and can be found at %s\n", sibsConfig.getPackageName().c_str(), packagePath.c_str());
break;
}
@@ -1171,8 +1172,8 @@ static int packageProject(int argc, const _tinydir_char_t **argv)
break;
}
- FileString packagePath = projectPath + TINYDIR_STRING("/sibs-build/package");
- FileString executablePath = projectPath + TINYDIR_STRING("/sibs-build/release/") + toFileString(sibsConfig.getPackageName());
+ FileString packagePath = projectPath + TINYDIR_STRING("/sibs-build/") + toFileString(asString(sibsConfig.platform)) + TINYDIR_STRING("/package");
+ FileString executablePath = projectPath + TINYDIR_STRING("/sibs-build/") + toFileString(asString(sibsConfig.platform)) + TINYDIR_STRING("/release/")+ toFileString(sibsConfig.getPackageName());
printf("Creating a package from project and dependencies...\n");
// args: executable_path program_version destination_path <--bundle|--bundle-install>
FileString cmd = TINYDIR_STRING("python3 \"") +
@@ -1428,6 +1429,11 @@ int wmain(int argc, const _tinydir_char_t **argv)
{
return packageProject(subCommandArgCount, subCommandArgPtr);
}
+ else if(_tinydir_strcmp(arg, TINYDIR_STRING("platform")) == 0)
+ {
+ printf("%s\n", asString(SYSTEM_PLATFORM));
+ return 0;
+ }
else
{
ferr << "Expected command to be either 'build', 'new' or 'test', was: " << arg << endl << endl;