Implement VoidBuildSystem v1 (Plans 01-19) with VoidLibrary integration
VoidBuildSystem CI / build-and-test-gcc16 (push) Failing after 3s
VoidBuildSystem CI / build-and-test-gcc16 (push) Failing after 3s
This commit is contained in:
1 parent
3cac890ce9
commit
ab64147f9d
114 files changed
+23777
-1392
No files matched your search
@@ -0,0 +1,44 @@
|
||||
#include <Void/Build.hpp>
|
||||
#include <Void/Build/BootstrapConfig.hpp>
|
||||
#include <Void/Configuration/Argparse.hpp>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
std::string profile;
|
||||
std::string compiler;
|
||||
Void::Argparse::Parser parser{
|
||||
"vbs_describe",
|
||||
"Evaluate the compiled example description; no target compiler is invoked."};
|
||||
parser.option_default("--profile", "", "profile: debug or release", profile, "debug")
|
||||
.option_default("--compiler", "", "target compiler context: gcc or clang", compiler, "gcc");
|
||||
if (argc == 2 && (std::string_view{argv[1]} == "--help" || std::string_view{argv[1]} == "-h")) {
|
||||
std::cout << parser.help();
|
||||
return 0;
|
||||
}
|
||||
// Help is deliberately successful only as a standalone request.
|
||||
for (int i = 1; i < argc; ++i) {
|
||||
if (std::string_view{argv[i]} == "--help" || std::string_view{argv[i]} == "-h") {
|
||||
std::cerr << "vbs_describe: --help must be used alone\n";
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
const auto parsed = parser.parse(argc, argv);
|
||||
if (!parsed) {
|
||||
std::cerr << "vbs_describe: " << parsed.error() << '\n';
|
||||
return 2;
|
||||
}
|
||||
try {
|
||||
Void::Build::Profiles descriptions;
|
||||
profiles(descriptions);
|
||||
Void::Build::Project project{descriptions.resolve(
|
||||
profile, Void::Build::parse_compiler(compiler), std::string{Void::Build::Bootstrap::os},
|
||||
std::string{Void::Build::Bootstrap::architecture})};
|
||||
build(project);
|
||||
std::cout << project.to_json() << '\n';
|
||||
return 0;
|
||||
} catch (const std::exception &error) {
|
||||
std::cerr << "vbs_describe: " << error.what() << '\n';
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user