aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRyan Liptak <squeek502@hotmail.com>2023-09-08 21:26:54 -0700
committerRyan Liptak <squeek502@hotmail.com>2023-09-17 03:09:45 -0700
commit4fac7a5263b9b14f63d2459f795ac9d2eee51c85 (patch)
tree88f9012d453abc1a278845ee134ce09cdddc7966 /src
parenta94d830a48ce82ea3fdf29c6c604f0972f095e61 (diff)
downloadzig-4fac7a5263b9b14f63d2459f795ac9d2eee51c85.tar.gz
zig-4fac7a5263b9b14f63d2459f795ac9d2eee51c85.zip
Only populate rc_include_dirs if there are .rc files in the compilation
Diffstat (limited to 'src')
-rw-r--r--src/Compilation.zig6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig
index fdc154e0eb..17d298b66d 100644
--- a/src/Compilation.zig
+++ b/src/Compilation.zig
@@ -1001,13 +1001,15 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation {
options.libc_installation,
);
- // .rc preprocessor needs to know the libc dirs even if we are not linking libc
const rc_dirs = try detectLibCIncludeDirs(
arena,
options.zig_lib_directory.path.?,
options.target,
options.is_native_abi,
- true,
+ // Set "link libc" to true here whenever there are rc files to compile, since
+ // the .rc preprocessor will need to know the libc include dirs even if we
+ // are not linking libc
+ options.rc_source_files.len > 0,
options.libc_installation,
);