From 45e00fd7c7695adb9d69e8621ab76fdfa085900b Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 5 Oct 2018 07:15:55 +0200 Subject: Fix for windows & mingw --- src/main.cpp | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) (limited to 'src/main.cpp') 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 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 -- cgit v1.2.3