diff options
Diffstat (limited to 'src/build_settings.cpp')
| -rw-r--r-- | src/build_settings.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/build_settings.cpp b/src/build_settings.cpp index fc5a9d19f..02de22ec4 100644 --- a/src/build_settings.cpp +++ b/src/build_settings.cpp @@ -986,6 +986,15 @@ String get_fullpath_relative(gbAllocator a, String base_dir, String path) { gb_memmove(str+i, path.text, path.len); i += path.len; str[i] = 0; + // IMPORTANT NOTE(bill): Remove trailing path separators + // this is required to make sure there is a conventional + // notation for the path + for (/**/; i > 0; i--) { + u8 c = str[i-1]; + if (c != '/' && c != '\\') { + break; + } + } String res = make_string(str, i); res = string_trim_whitespace(res); @@ -1302,13 +1311,16 @@ void enable_target_feature(TokenPos pos, String const &target_feature_list) { defer (mutex_unlock(&bc->target_features_mutex)); auto items = split_by_comma(target_feature_list); - array_free(&items); for_array(i, items) { String const &item = items.data[i]; if (!check_target_feature_is_valid(pos, item)) { error(pos, "Target feature '%.*s' is not valid", LIT(item)); + continue; } + + string_set_add(&bc->target_features_set, item); } + array_free(&items); } @@ -1331,7 +1343,7 @@ char const *target_features_set_to_cstring(gbAllocator allocator, bool with_quot if (with_quotes) features[len++] = '"'; String feature = build_context.target_features_set.entries[i].value; - gb_memmove(features, feature.text, feature.len); + gb_memmove(features + len, feature.text, feature.len); len += feature.len; if (with_quotes) features[len++] = '"'; } |