diff options
| author | gingerBill <gingerBill@users.noreply.github.com> | 2025-10-12 10:19:45 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-12 10:19:45 +0100 |
| commit | 85005babc2fbcec380d2649a3a4f61316370d2fa (patch) | |
| tree | d7e0681d5179d02cedd836db21d1bcc9977b0355 /src/build_settings.cpp | |
| parent | 9e836a2e4996ca0df32329f15b6257ea88a9231a (diff) | |
| parent | c4a8af0f0d2d8c5d052f075df524f10b67306730 (diff) | |
Merge pull request #5794 from alsakandari/improve-target-features
Improve target features flag by allowing the user to disable a target feature
Diffstat (limited to 'src/build_settings.cpp')
| -rw-r--r-- | src/build_settings.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/build_settings.cpp b/src/build_settings.cpp index 53953600e..694ba1142 100644 --- a/src/build_settings.cpp +++ b/src/build_settings.cpp @@ -2093,7 +2093,19 @@ gb_internal bool check_target_feature_is_enabled(String const &feature, String * for (;;) { String str = string_split_iterator(&it, ','); if (str == "") break; + if (!string_set_exists(&build_context.target_features_set, str)) { + String plus_str = concatenate_strings(temporary_allocator(), make_string_c("+"), str); + + if (!string_set_exists(&build_context.target_features_set, plus_str)) { + if (not_enabled) *not_enabled = str; + return false; + } + } + + String minus_str = concatenate_strings(temporary_allocator(), make_string_c("-"), str); + + if (string_set_exists(&build_context.target_features_set, minus_str)) { if (not_enabled) *not_enabled = str; return false; } |