From cc73e06a46cbefd2afa4caa7ef95ba6d9ab64eb9 Mon Sep 17 00:00:00 2001 From: Jeroen van Rijn Date: Wed, 10 Jul 2024 15:09:13 +0200 Subject: Allow precompiled resources with -resource:foo.res And add them to the magic new feature. --- src/cached.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/cached.cpp') diff --git a/src/cached.cpp b/src/cached.cpp index 02cb1ae96..36927496d 100644 --- a/src/cached.cpp +++ b/src/cached.cpp @@ -200,6 +200,17 @@ gb_internal bool try_cached_build(Checker *c, Array const &args) { } } + // Add Windows resource file to file list, if applicable + if (build_context.has_resource) { + String res_path = {}; + if (build_context.build_paths[BuildPath_RC].basename == "") { + res_path = path_to_string(heap_allocator(), build_context.build_paths[BuildPath_RES]); + } else { + res_path = path_to_string(heap_allocator(), build_context.build_paths[BuildPath_RC]); + } + array_add(&files, res_path); + } + for (auto const &entry : c->info.load_file_cache) { auto *cache = entry.value; if (!cache || !cache->exists) { -- cgit v1.2.3 From 4148c6d6c749eac62b7d1a978f820b82de7d3bea Mon Sep 17 00:00:00 2001 From: Jeroen van Rijn Date: Wed, 10 Jul 2024 15:25:49 +0200 Subject: #if WINDOWS --- src/cached.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/cached.cpp') diff --git a/src/cached.cpp b/src/cached.cpp index 36927496d..7f213ba21 100644 --- a/src/cached.cpp +++ b/src/cached.cpp @@ -200,16 +200,17 @@ gb_internal bool try_cached_build(Checker *c, Array const &args) { } } - // Add Windows resource file to file list, if applicable - if (build_context.has_resource) { - String res_path = {}; - if (build_context.build_paths[BuildPath_RC].basename == "") { - res_path = path_to_string(heap_allocator(), build_context.build_paths[BuildPath_RES]); - } else { - res_path = path_to_string(heap_allocator(), build_context.build_paths[BuildPath_RC]); + #if defined(GB_SYSTEM_WINDOWS) + if (build_context.has_resource) { + String res_path = {}; + if (build_context.build_paths[BuildPath_RC].basename == "") { + res_path = path_to_string(permanent_allocator(), build_context.build_paths[BuildPath_RES]); + } else { + res_path = path_to_string(permanent_allocator(), build_context.build_paths[BuildPath_RC]); + } + array_add(&files, res_path); } - array_add(&files, res_path); - } + #endif for (auto const &entry : c->info.load_file_cache) { auto *cache = entry.value; -- cgit v1.2.3