diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp index 8282889..a812b8a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -137,6 +137,7 @@ static void usageBuild(bool run) printf(" --debug|--release Optimization level to build project and dependencies with (if not a system package) - Optional (default: --debug)\n"); printf(" --sanitize Add runtime address/undefined behavior sanitization. Program can be up to 3 times slower and use 10 times as much RAM. Ignored if compiler doesn't support sanitization - Optional (default: none)\n"); printf(" --platform The platform to build for - Optional (default: the running platform)\n"); + printf(" --flto Use link-time optimization. May increase compile times - Optional (default: false)\n"); printf("Examples:\n"); printf(" sibs %s\n", run ? "run" : "build"); if(run) @@ -515,6 +516,7 @@ static int buildProject(int argc, const _tinydir_char_t **argv, bool run) FileString projectPath; Sanitize sanitize = Sanitize::NONE; FileString platformName; + bool use_flto = false; std::vector<const _tinydir_char_t*> run_args; for(int i = 0; i < argc; ++i) @@ -538,6 +540,10 @@ static int buildProject(int argc, const _tinydir_char_t **argv, bool run) } optimizationLevel = OPT_LEV_RELEASE; } + else if(_tinydir_strcmp(arg, TINYDIR_STRING("--flto")) == 0) + { + use_flto = true; + } else if(_tinydir_strncmp(arg, TINYDIR_STRING("--sanitize="), 11) == 0) { sanitize = sanitize_string_to_type(arg + 11); @@ -645,6 +651,7 @@ static int buildProject(int argc, const _tinydir_char_t **argv, bool run) sibsConfig.showWarnings = true; sibsConfig.platform = platform; sibsConfig.setSanitize(sanitize); + sibsConfig.use_flto = use_flto; return buildProject(projectPath, projectConfFilePath, sibsConfig, run, escape_args(run_args)); } @@ -1228,6 +1235,7 @@ static int packageProject(int argc, const _tinydir_char_t **argv) sibsConfig.showWarnings = true; sibsConfig.packaging = packagingType == PackagingType::STATIC; sibsConfig.bundling = (packagingType == PackagingType::BUNDLE) || (packagingType == PackagingType::BUNDLE_INSTALL); + sibsConfig.use_flto = true; int result = buildProject(projectPath, projectConfFilePath, sibsConfig, false, TINYDIR_STRING("")); if(result != 0) return result; |