I’m writing a build.zig in which I need to generate a file in order to set the libc for Android.
Right now I have the following in my build.zig:
const write_file = b.addWriteFile("android-29-armabi.conf",
\\include_dir=/home/juan/Downloads/android/android-ndk-r26c/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include
\\sys_include_dir=/home/juan/Downloads/android/android-ndk-r26c/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/arm-linux-androideabi
\\crt_dir=/home/juan/Downloads/android/android-ndk-r26c/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/arm-linux-androideabi/29
\\msvc_lib_dir=
\\kernel32_lib_dir=
\\gcc_dir=
\\
);
b.getInstallStep().dependOn(&write_file.step);
After that I need to use the file in the following lines:
lib.libc_file = b.path("android-29-armabi.conf");
lib.libc_file.?.addStepDependencies(&lib.step);
The problem is that the generated file lives somewhere in the .zig-cache
folder.
How can I access the generated file?
Do I have to copy it from the cache into the root of my project?
Is this the right/intended way to generate files from within the build.zig script?
Please help me!
I’m not being able to understand how to do this, as described in: https://ziglang.org/learn/build-system/
.