aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2024-07-11 12:51:25 +0100
committerGitHub <noreply@github.com>2024-07-11 12:51:25 +0100
commitfc7c7cd8abbe23cf34cc378c3450dc38a6324773 (patch)
treeb9cabde297f382f7ebf8d2e1a16dab7a5190da24 /src/main.cpp
parente05e99253b16c4ffd1c51d50072292dd99ff5e5b (diff)
parent4148c6d6c749eac62b7d1a978f820b82de7d3bea (diff)
Merge pull request #3900 from Kelimion/winres
Allow precompiled resources with `-resource:foo.res`
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 7763ccd23..e6a0aecf0 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1452,8 +1452,9 @@ gb_internal bool parse_build_flags(Array<String> args) {
String path = value.value_string;
path = string_trim_whitespace(path);
if (is_build_flag_path_valid(path)) {
- if(!string_ends_with(path, str_lit(".rc"))) {
- gb_printf_err("Invalid -resource path %.*s, missing .rc\n", LIT(path));
+ bool is_resource = string_ends_with(path, str_lit(".rc")) || string_ends_with(path, str_lit(".res"));
+ if(!is_resource) {
+ gb_printf_err("Invalid -resource path %.*s, missing .rc or .res file\n", LIT(path));
bad_flags = true;
break;
} else if (!gb_file_exists((const char *)path.text)) {
@@ -2552,6 +2553,7 @@ gb_internal void print_show_help(String const arg0, String const &command) {
print_usage_line(2, "[Windows only]");
print_usage_line(2, "Defines the resource file for the executable.");
print_usage_line(2, "Example: -resource:path/to/file.rc");
+ print_usage_line(2, "or: -resource:path/to/file.res for a precompiled one.");
print_usage_line(0, "");
print_usage_line(1, "-pdb-name:<filepath>");