From c1c8ceafc243389d8eb94feca99de1239da32408 Mon Sep 17 00:00:00 2001 From: Ian Lilley Date: Sun, 7 Aug 2022 17:52:29 -0400 Subject: find windows sdk bin path for rc.exe --- src/main.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index beefec702..7fa04cc37 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -283,6 +283,9 @@ i32 linker_stage(lbGenerator *gen) { String vs_exe_path = path_to_string(heap_allocator(), build_context.build_paths[BuildPath_VS_EXE]); defer (gb_free(heap_allocator(), vs_exe_path.text)); + String windows_sdk_bin_path = path_to_string(heap_allocator(), build_context.build_paths[BuildPath_Win_SDK_Bin_Path]); + defer (gb_free(heap_allocator(), windows_sdk_bin_path.text)); + char const *subsystem_str = build_context.use_subsystem_windows ? "WINDOWS" : "CONSOLE"; if (!build_context.use_lld) { // msvc if (build_context.has_resource) { @@ -292,7 +295,8 @@ i32 linker_stage(lbGenerator *gen) { defer (gb_free(heap_allocator(), res_path.text)); result = system_exec_command_line_app("msvc-link", - "\"rc.exe\" /nologo /fo \"%.*s\" \"%.*s\"", + "\"%.*src.exe\" /nologo /fo \"%.*s\" \"%.*s\"", + LIT(windows_sdk_bin_path), LIT(res_path), LIT(rc_path) ); -- cgit v1.2.3 From 28f440dd9e9e9674738b243d284a4394b22a5bc4 Mon Sep 17 00:00:00 2001 From: Joakim Hentula Date: Wed, 10 Aug 2022 13:58:33 +0100 Subject: Do not remove .rc extension from resource path to prevent expansion to full path assuming it's a directory if a folder with the same name exists in the same folder as the resource file --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 7fa04cc37..ef1b8dda1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1562,7 +1562,7 @@ bool parse_build_flags(Array args) { bad_flags = true; break; } - build_context.resource_filepath = substring(path, 0, string_extension_position(path)); + build_context.resource_filepath = path; build_context.has_resource = true; } else { gb_printf_err("Invalid -resource path, got %.*s\n", LIT(path)); -- cgit v1.2.3