mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
resinator: Fix auto-detected includes only being used during preprocessing
Also need to pass them to the .res compilation step, since files (cursors, icons, etc) can be found in the system include directories.
This commit is contained in:
parent
c32e0d3000
commit
3f92cbef89
1 changed files with 21 additions and 16 deletions
|
|
@ -14,6 +14,10 @@ pub fn main() !void {
|
|||
defer std.debug.assert(gpa.deinit() == .ok);
|
||||
const allocator = gpa.allocator();
|
||||
|
||||
var arena_state = std.heap.ArenaAllocator.init(allocator);
|
||||
defer arena_state.deinit();
|
||||
const arena = arena_state.allocator();
|
||||
|
||||
const stderr = std.io.getStdErr();
|
||||
const stderr_config = std.io.tty.detectConfig(stderr);
|
||||
|
||||
|
|
@ -101,18 +105,7 @@ pub fn main() !void {
|
|||
}
|
||||
const maybe_dependencies_list: ?*std.ArrayList([]const u8) = if (options.depfile_path != null) &dependencies_list else null;
|
||||
|
||||
const full_input = full_input: {
|
||||
if (options.preprocess != .no) {
|
||||
var preprocessed_buf = std.ArrayList(u8).init(allocator);
|
||||
errdefer preprocessed_buf.deinit();
|
||||
|
||||
// We're going to throw away everything except the final preprocessed output anyway,
|
||||
// so we can use a scoped arena for everything else.
|
||||
var aro_arena_state = std.heap.ArenaAllocator.init(allocator);
|
||||
defer aro_arena_state.deinit();
|
||||
const aro_arena = aro_arena_state.allocator();
|
||||
|
||||
const include_paths = getIncludePaths(aro_arena, options.auto_includes, zig_lib_dir) catch |err| switch (err) {
|
||||
const include_paths = getIncludePaths(arena, options.auto_includes, zig_lib_dir) catch |err| switch (err) {
|
||||
error.OutOfMemory => |e| return e,
|
||||
else => |e| {
|
||||
switch (e) {
|
||||
|
|
@ -128,6 +121,17 @@ pub fn main() !void {
|
|||
},
|
||||
};
|
||||
|
||||
const full_input = full_input: {
|
||||
if (options.preprocess != .no) {
|
||||
var preprocessed_buf = std.ArrayList(u8).init(allocator);
|
||||
errdefer preprocessed_buf.deinit();
|
||||
|
||||
// We're going to throw away everything except the final preprocessed output anyway,
|
||||
// so we can use a scoped arena for everything else.
|
||||
var aro_arena_state = std.heap.ArenaAllocator.init(allocator);
|
||||
defer aro_arena_state.deinit();
|
||||
const aro_arena = aro_arena_state.allocator();
|
||||
|
||||
var comp = aro.Compilation.init(aro_arena);
|
||||
defer comp.deinit();
|
||||
|
||||
|
|
@ -211,6 +215,7 @@ pub fn main() !void {
|
|||
.dependencies_list = maybe_dependencies_list,
|
||||
.ignore_include_env_var = options.ignore_include_env_var,
|
||||
.extra_include_paths = options.extra_include_paths.items,
|
||||
.system_include_paths = include_paths,
|
||||
.default_language_id = options.default_language_id,
|
||||
.default_code_page = options.default_code_page orelse .windows1252,
|
||||
.verbose = options.verbose,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue