diff options
author | dec05eba <dec05eba@protonmail.com> | 2018-10-02 00:52:30 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-07-06 07:39:33 +0200 |
commit | c206fd07db07dc6271185dabac822e10d78b4443 (patch) | |
tree | 91d3608a7a5abfb39a1e96a3c8926270c40e759f /src/Conf.cpp | |
parent | 3e401d97546fe407ca72e9766cbdbb9c9212091e (diff) |
Add sibs package command
Currently in testing phase.
Builds a redistributable binary by statically linking libraries
(including standard library).
Diffstat (limited to 'src/Conf.cpp')
-rw-r--r-- | src/Conf.cpp | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/src/Conf.cpp b/src/Conf.cpp index 090e1e1..d981794 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.packaging && (!config.getDebugStaticLibs().empty() || !config.getReleaseStaticLibs().empty())) + return Result<bool>::Err("Project " + config.getPackageName() + " contains external static libraries, such projects are not supported when building a package"); } return parseResult; @@ -502,14 +505,21 @@ namespace sibs } buildPath = projectPath + TINYDIR_STRING("/sibs-build/"); - switch(sibsConfig.getOptimizationLevel()) + if(sibsConfig.packaging) + { + buildPath += TINYDIR_STRING("package"); + } + else { - case OPT_LEV_DEBUG: - buildPath += TINYDIR_STRING("debug"); - break; - case OPT_LEV_RELEASE: - buildPath += TINYDIR_STRING("release"); - break; + switch(sibsConfig.getOptimizationLevel()) + { + case OPT_LEV_DEBUG: + buildPath += TINYDIR_STRING("debug"); + break; + case OPT_LEV_RELEASE: + buildPath += TINYDIR_STRING("release"); + break; + } } } @@ -1163,6 +1173,7 @@ namespace sibs string SibsConfig::parsePlatformConfigStatic(const StringView &fieldName, const ConfigValue &fieldValue) { + // TODO: Verify the library is actually a static library if (fieldName.equals("lib")) { if (fieldValue.isSingle()) |