aboutsummaryrefslogtreecommitdiff
path: root/src/build_settings.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/build_settings.cpp
parente05e99253b16c4ffd1c51d50072292dd99ff5e5b (diff)
parent4148c6d6c749eac62b7d1a978f820b82de7d3bea (diff)
Merge pull request #3900 from Kelimion/winres
Allow precompiled resources with `-resource:foo.res`
Diffstat (limited to 'src/build_settings.cpp')
-rw-r--r--src/build_settings.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/build_settings.cpp b/src/build_settings.cpp
index 28ca0f088..4d3e20a7a 100644
--- a/src/build_settings.cpp
+++ b/src/build_settings.cpp
@@ -1805,10 +1805,11 @@ gb_internal bool init_build_paths(String init_filename) {
#if defined(GB_SYSTEM_WINDOWS)
if (bc->metrics.os == TargetOs_windows) {
if (bc->resource_filepath.len > 0) {
- bc->build_paths[BuildPath_RC] = path_from_string(ha, bc->resource_filepath);
- bc->build_paths[BuildPath_RES] = path_from_string(ha, bc->resource_filepath);
- bc->build_paths[BuildPath_RC].ext = copy_string(ha, STR_LIT("rc"));
- bc->build_paths[BuildPath_RES].ext = copy_string(ha, STR_LIT("res"));
+ bc->build_paths[BuildPath_RES] = path_from_string(ha, bc->resource_filepath);
+ if (!string_ends_with(bc->resource_filepath, str_lit(".res"))) {
+ bc->build_paths[BuildPath_RC] = path_from_string(ha, bc->resource_filepath);
+ bc->build_paths[BuildPath_RC].ext = copy_string(ha, STR_LIT("rc"));
+ }
}
if (bc->pdb_filepath.len > 0) {