From aca4d044103d6a67c5aaa9cabf2be1155199ccc5 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 31 Jan 2022 11:19:21 +0200 Subject: Add initial build system driver initialization --- bpkg/bpkg.cxx | 33 +++++++++++++++++++++++++++++++++ bpkg/buildfile | 2 ++ 2 files changed, 35 insertions(+) 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 // backtrace() +// Embedded build system driver. +// +#include +#include + +#include +#include +#include +#include +#include +#include +#include + #include #include @@ -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} -- cgit v1.1