aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-10-05 07:15:55 +0200
committerdec05eba <dec05eba@protonmail.com>2020-07-06 07:39:33 +0200
commit45e00fd7c7695adb9d69e8621ab76fdfa085900b (patch)
tree167d2a660db7bc4bdc199a438b8255ffc8b45cca /src/main.cpp
parent5250cb90406693163763a214af95f670e0e3a4e0 (diff)
Fix for windows & mingw
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp29
1 files changed, 23 insertions, 6 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 3ffb264..29f6ba3 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1144,22 +1144,31 @@ static int packageProject(int argc, const _tinydir_char_t **argv)
case PackagingType::BUNDLE:
case PackagingType::BUNDLE_INSTALL:
{
- const char *bundleType = nullptr;
+ const _tinydir_char_t *bundleType = nullptr;
switch(packagingType)
{
case PackagingType::BUNDLE:
- bundleType = "--bundle";
+ bundleType = TINYDIR_STRING("--bundle");
break;
case PackagingType::BUNDLE_INSTALL:
- bundleType = "--bundle-install";
+ bundleType = TINYDIR_STRING("--bundle-install");
break;
}
- string packagePath = toUtf8(projectPath + TINYDIR_STRING("/sibs-build/package"));
- string executablePath = toUtf8(projectPath + TINYDIR_STRING("/sibs-build/release/") + sibsConfig.getPackageName());
+ FileString packagePath = projectPath + TINYDIR_STRING("/sibs-build/package");
+ FileString executablePath = projectPath + TINYDIR_STRING("/sibs-build/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 = "python3 \"" + packageScriptPath + "\" \"" + executablePath + "\" \"" + sibsConfig.version + "\" \"" + packagePath + "\" " + bundleType;
+ FileString cmd = TINYDIR_STRING("python3 \"") +
+ packageScriptPath +
+ TINYDIR_STRING("\" \"") +
+ executablePath +
+ TINYDIR_STRING("\" \"") +
+ toFileString(sibsConfig.version) +
+ TINYDIR_STRING("\" \"") +
+ packagePath +
+ TINYDIR_STRING("\" ") +
+ bundleType;
Result<ExecResult> bundleResult = exec(cmd.c_str(), true);
if(!bundleResult)
{
@@ -1413,3 +1422,11 @@ int wmain(int argc, const _tinydir_char_t **argv)
usage();
return 0;
}
+
+// Mingw needs this
+#if OS_FAMILY == OS_FAMILY_WINDOWS
+int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
+{
+ return wmain(__argc, (const _tinydir_char_t**)__wargv);
+}
+#endif \ No newline at end of file