diff options
-rw-r--r-- | bpkg/bpkg.cxx | 33 | ||||
-rw-r--r-- | bpkg/buildfile | 2 |
2 files changed, 35 insertions, 0 deletions
diff --git a/bpkg/bpkg.cxx b/bpkg/bpkg.cxx index a4946fe..c1a4908 100644 --- a/bpkg/bpkg.cxx +++ b/bpkg/bpkg.cxx @@ -12,6 +12,19 @@ #include <libbutl/backtrace.hxx> // backtrace() +// Embedded build system driver. +// +#include <libbuild2/types.hxx> +#include <libbuild2/utility.hxx> + +#include <libbuild2/in/init.hxx> +#include <libbuild2/bin/init.hxx> +#include <libbuild2/c/init.hxx> +#include <libbuild2/cc/init.hxx> +#include <libbuild2/cxx/init.hxx> +#include <libbuild2/bash/init.hxx> +#include <libbuild2/version/init.hxx> + #include <bpkg/types.hxx> #include <bpkg/utility.hxx> @@ -371,6 +384,26 @@ init (const common_options& co, if (tmp) init_tmp (dir_path (cfg_dir (&o))); + // Build system driver. + // + // @@ TODO: perhaps we should only do it for commands that need it? + // + { + using namespace build2; + + // @@ TMP: pass proper values instead of dummies. + // + init_diag (1); + init (nullptr, "bpkg" /*argv[0]*/); + + bin::build2_bin_load (); + cc::build2_cc_load (); + c::build2_c_load (); + cxx::build2_cxx_load (); + version::build2_version_load (); + in::build2_in_load (); + } + return o; } diff --git a/bpkg/buildfile b/bpkg/buildfile index 93f8712..cc9e7b5 100644 --- a/bpkg/buildfile +++ b/bpkg/buildfile @@ -10,6 +10,8 @@ xml{*}: extension = xml import libs = build2%lib{build2} +# NOTE: see also module loading in bpkg.cxx if adding anything here. +# for m: bin c cc cxx in version import libs += build2%lib{build2-$m} |