aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeroen van Rijn <Kelimion@users.noreply.github.com>2024-06-16 19:27:13 +0200
committerGitHub <noreply@github.com>2024-06-16 19:27:13 +0200
commita66ce4f871c446846954e8e20eef606613232c87 (patch)
tree0cf9d7dececc9bc144816f177c3023c70509bbf6 /src
parentfe3baae7a6f779037743041e0d8f8a696006eb6f (diff)
parenteebc0dd026b50df123eaf40dd286af870354ea40 (diff)
Merge pull request #3773 from Kelimion/res_path_bug
Fix `rc.exe` bug with double-quoted `.res` path.
Diffstat (limited to 'src')
-rw-r--r--src/linker.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/linker.cpp b/src/linker.cpp
index 25c54a6ab..9eed14ea9 100644
--- a/src/linker.cpp
+++ b/src/linker.cpp
@@ -265,16 +265,20 @@ gb_internal i32 linker_stage(LinkerData *gen) {
if (!build_context.use_lld) { // msvc
String res_path = {};
defer (gb_free(heap_allocator(), res_path.text));
+
+ // TODO(Jeroen): Add ability to reuse .res file instead of recompiling, if `-resource:file.res` is given.
if (build_context.has_resource) {
String temp_res_path = path_to_string(heap_allocator(), build_context.build_paths[BuildPath_RES]);
res_path = concatenate3_strings(heap_allocator(), str_lit("\""), temp_res_path, str_lit("\""));
gb_free(heap_allocator(), temp_res_path.text);
- String rc_path = path_to_string(heap_allocator(), build_context.build_paths[BuildPath_RC]);
+ String temp_rc_path = path_to_string(heap_allocator(), build_context.build_paths[BuildPath_RC]);
+ String rc_path = concatenate3_strings(heap_allocator(), str_lit("\""), temp_rc_path, str_lit("\""));
+ gb_free(heap_allocator(), temp_rc_path.text);
defer (gb_free(heap_allocator(), rc_path.text));
result = system_exec_command_line_app("msvc-link",
- "\"%.*src.exe\" /nologo /fo \"%.*s\" \"%.*s\"",
+ "\"%.*src.exe\" /nologo /fo %.*s %.*s",
LIT(windows_sdk_bin_path),
LIT(res_path),
LIT(rc_path)