aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-10-02 21:14:45 +0200
committerdec05eba <dec05eba@protonmail.com>2020-07-06 07:39:33 +0200
commitd22001283a49ad723da0023039c904dc6db7c5a0 (patch)
tree4ec8b61a33b57ad2ccec5cc1309ea1f927620ef2 /src
parent7a483ac5f0e483dd9dff2a22ee4f0480ab75f039 (diff)
Fix bundle for non system libraries
Diffstat (limited to 'src')
-rw-r--r--src/Conf.cpp5
-rw-r--r--src/FileUtil.cpp2
-rw-r--r--src/main.cpp2
3 files changed, 7 insertions, 2 deletions
diff --git a/src/Conf.cpp b/src/Conf.cpp
index 365cf38..fa92bf5 100644
--- a/src/Conf.cpp
+++ b/src/Conf.cpp
@@ -487,6 +487,9 @@ namespace sibs
else
fprintf(stderr, "Warning: Project contains tests directory but we got an error while retrieving the full path to it\n");
}
+
+ if(config.isMainProject() && (config.packaging || config.bundling) && config.getPackageType() != PackageType::EXECUTABLE)
+ return Result<bool>::Err("Packaging is only supported for projects that are of type executable");
}
return parseResult;
@@ -1235,7 +1238,7 @@ namespace sibs
if(prependSpace)
cmakeArgs += TINYDIR_STRING(" ");
cmakeArgs += TINYDIR_STRING("\"-D");
- cmakeArgs += toFileString(string(arg.data, arg.size));
+ cmakeArgs += toFileString(arg);
cmakeArgs += TINYDIR_STRING("\"");
}
}
diff --git a/src/FileUtil.cpp b/src/FileUtil.cpp
index f52dd1f..498f638 100644
--- a/src/FileUtil.cpp
+++ b/src/FileUtil.cpp
@@ -52,7 +52,7 @@ namespace sibs
FileString toFileString(const StringView &utf8Str)
{
- return FileString(utf8Str.data, utf8Str.size);
+ return FileString(utf8Str.data, utf8Str.data + utf8Str.size);
}
#else
std::string toUtf8(const sibs::FileString &input)
diff --git a/src/main.cpp b/src/main.cpp
index f33b1f6..119aafb 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1071,6 +1071,7 @@ static int packageProject(int argc, const _tinydir_char_t **argv)
SibsConfig sibsConfig(compiler, projectPath, OPT_LEV_RELEASE, false);
sibsConfig.showWarnings = true;
sibsConfig.packaging = packagingType == PackagingType::STATIC;
+ sibsConfig.bundling = packagingType == PackagingType::BUNDLE;
int result = buildProject(projectPath, projectConfFilePath, sibsConfig);
if(result != 0)
return result;
@@ -1087,6 +1088,7 @@ static int packageProject(int argc, const _tinydir_char_t **argv)
{
string packagePath = toUtf8(projectPath + TINYDIR_STRING("/sibs-build/package"));
string executablePath = toUtf8(projectPath + TINYDIR_STRING("/sibs-build/release/") + sibsConfig.getPackageName());
+ printf("Creating a package from project and dependencies...\n");
FileString cmd = "python3 \"" + packageScriptPath + "\" \"" + executablePath + "\" \"" + packagePath + "\"";
Result<ExecResult> bundleResult = exec(cmd.c_str(), true);
if(!bundleResult)