浏览代码

fix android-libc.txt generation

Previously, the libc paths file `android-libc.txt` was written to
the folder from which the user ran `zig build`. This caused
problems when using raylib as a dependency in other zig
projects, since raylib is not built in the project root, but the
`android-libc.txt` file was still generated in the project root. The file
should now be generated in .zig-cache, which should fix the isssue (and
leave the project root folder cleaner).
pull/4871/head
Lumen Keyes 1周前
父节点
当前提交
33b2829a89
共有 1 个文件被更改,包括 6 次插入8 次删除
  1. +6
    -8
      build.zig

+ 6
- 8
build.zig 查看文件

@ -238,17 +238,15 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.
raylib.addSystemIncludePath( .{ .cwd_relative = androidAsmPath}); raylib.addSystemIncludePath( .{ .cwd_relative = androidAsmPath});
raylib.addSystemIncludePath(.{ .cwd_relative = androidGluePath}); raylib.addSystemIncludePath(.{ .cwd_relative = androidGluePath});
const libcFile = try std.fs.cwd().createFile("android-libc.txt", .{}); var libcData = std.ArrayList(u8).init(b.allocator).writer();
const writer = libcFile.writer(); const writer = libcData.writer();
const libc = std.zig.LibCInstallation{ try (std.zig.LibCInstallation{
.include_dir = androidIncludePath, .include_dir = androidIncludePath,
.sys_include_dir = androidIncludePath, .sys_include_dir = androidIncludePath,
.crt_dir = androidApiSpecificPath, .crt_dir = androidApiSpecificPath,
}; }).render(writer);
try libc.render(writer); const libcFile = b.addWriteFiles().add("android-libc.txt", try libcData.toOwnedSlice());
libcFile.close(); raylib.setLibCFile(libcFile);
raylib.setLibCFile(b.path("android-libc.txt"));
if (options.opengl_version == .auto) { if (options.opengl_version == .auto) {
raylib.root_module.linkSystemLibrary("GLESv2", .{}); raylib.root_module.linkSystemLibrary("GLESv2", .{});

||||||
x
 
000:0
正在加载...
取消
保存