|
// Find TranslateC dependencies and add system path |
|
var iter = artifact.root_module.import_table.iterator(); |
|
while (iter.next()) |it| { |
|
const module = it.value_ptr.*; |
|
const root_source_file = module.root_source_file orelse continue; |
|
switch (root_source_file) { |
|
.generated => |gen| { |
|
const step = gen.file.step; |
|
if (step.id != .translate_c) { |
|
continue; |
|
} |
|
const c_translate_target = module.resolved_target orelse continue; |
|
if (!c_translate_target.result.abi.isAndroid()) { |
|
continue; |
|
} |
|
const translate_c: *std.Build.Step.TranslateC = @fieldParentPtr("step", step); |
|
translate_c.addIncludePath(.{ .cwd_relative = apk.ndk.include_path }); |
|
translate_c.addSystemIncludePath(.{ .cwd_relative = apk.getSystemIncludePath(c_translate_target) }); |
|
}, |
|
else => continue, |
|
} |
|
} |
This does not work for TranslateC steps in dependencies of the root module.
As std.Build.Step.TranslateC is also going to be removed in favour of a package, it might be preferable to add a public API to get the include paths for a given target.
zig-android-sdk/src/androidbuild/Apk.zig
Lines 510 to 531 in a73fc01
This does not work for TranslateC steps in dependencies of the root module.
As
std.Build.Step.TranslateCis also going to be removed in favour of a package, it might be preferable to add a public API to get the include paths for a given target.