From fe08489408d52eff337791a4d5bf0e63ed53e61b Mon Sep 17 00:00:00 2001 From: Andreev Gregory Date: Wed, 14 Aug 2024 11:02:10 +0300 Subject: [PATCH] Bs script now uses env variables BS_SCRIPT_TYPE and BS_SCRIPT_TESTS --- building/main.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/building/main.cpp b/building/main.cpp index c74e000..bc680c1 100644 --- a/building/main.cpp +++ b/building/main.cpp @@ -8,7 +8,7 @@ struct Libregexis024BuildSystem { /* "debug" or "release" */ std::string build_type; - bool build_tests = false; + bool build_tests; std::vector warning_flags = {"-Wall", "-Wno-unused-variable", "-Werror=return-type","-pedantic", "-Wno-unused-but-set-variable", "-Wno-reorder"}; @@ -33,8 +33,8 @@ struct Libregexis024BuildSystem { return my_flag_collection; } - Libregexis024BuildSystem(const std::string& build_type, const NormalCBuildSystemCommandMeaning& cmd) - :build_type(build_type) + Libregexis024BuildSystem(const std::string& build_type, bool build_tests, const NormalCBuildSystemCommandMeaning& cmd) + :build_type(build_type), build_tests(build_tests) { ASSERT(build_type == "release" || build_type == "debug", "Unknown build type"); @@ -140,7 +140,9 @@ int main(int argc, char** argv) { } NormalCBuildSystemCommandMeaning cmd; regular_bs_cli_cmd_interpret(args, cmd); - Libregexis024BuildSystem bs("release", cmd); + const char* BS_SCRIPT_TYPE = getenv("BS_SCRIPT_TYPE"); + const char* BS_SCRIPT_TESTS = getenv("BS_SCRIPT_TESTS"); + Libregexis024BuildSystem bs(BS_SCRIPT_TYPE ? BS_SCRIPT_TYPE : "release", (bool)BS_SCRIPT_TESTS, cmd); if (cmd.need_to_build) complete_tasks_of_build_units(bs.runlevel_1); if (cmd.need_to_install)