aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp12
1 files changed, 9 insertions, 3 deletions
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;