From c206fd07db07dc6271185dabac822e10d78b4443 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 2 Oct 2018 00:52:30 +0200 Subject: Add sibs package command Currently in testing phase. Builds a redistributable binary by statically linking libraries (including standard library). --- src/Conf.cpp | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'src/Conf.cpp') 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::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()) -- cgit v1.2.3