fix: close the VBS-side gaps noted on Void/Library#61
This commit is contained in:
1 parent
4f581d1b51
commit
4d51331777
13 files changed
+158
-14
No files matched your search
@@ -2,6 +2,7 @@
|
||||
#include <Void/Build/Util/Json.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <cctype>
|
||||
#include <cstdlib>
|
||||
#include <set>
|
||||
#include <type_traits>
|
||||
@@ -567,6 +568,22 @@ std::string Profiles::to_json() const {
|
||||
'}';
|
||||
}
|
||||
|
||||
std::string dependency_option(std::string_view name) {
|
||||
std::string upper{name};
|
||||
for (char &c : upper) {
|
||||
c = static_cast<char>(std::toupper(static_cast<unsigned char>(c)));
|
||||
}
|
||||
// Consumers pass fixed keys verbatim first, then the upper-cased convention.
|
||||
if (const char *exact = std::getenv(("VBS_DEP_OPTION_" + std::string{name}).c_str());
|
||||
exact != nullptr) {
|
||||
return exact;
|
||||
}
|
||||
if (const char *value = std::getenv(("VBS_DEP_OPTION_" + upper).c_str()); value != nullptr) {
|
||||
return value;
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
Profiles default_profiles() {
|
||||
Profiles result;
|
||||
result.add("debug", {"-O0", "-g"});
|
||||
|
||||
Reference in new issue
Block a user