#install header files only (installHeadersDirectory)

1 messages · Page 1 of 1 (latest)

fresh plover
#

I am trying to create a build.zig and build.zig.zon for zstd. However, it seems like the zstd devs don't use a separate include/ directory and instead put the headers directly next to the .c source files in lib.

I tried the following but it ends up copying the entire lib directory and not the .h files - causing a Makefile and a BUCK build file to be copied along with the headers. For example, cmake allows you to specify a FILES_MATCHING *.h with the install function but zig does not seem to have this option.

lib.installHeadersDirectory(b.pathJoin(&.{ repo_path, "lib" }), "zstd");

Not sure what the best solution is here.

willow hawk
#

Probably iterate through all the headers and call installHeader individually

#

since installHeadersDir is just a dir copy

fresh plover
#

oh

#

i want a include_extensions though 😦

#

now i have to list every possible file that could be in the lib folder

#

maybe ill just do it mnaually and iterate through the headers, but i forgot how to do that with subdirs. the only up to date example is on a reddit thread 😂

dreamy spade
#

i mean how many other extensions are there?

fresh plover
#

actually wait one of the files doesnt even have an extension so

#

"BUCK"

#

same with Makefile

#

ill just have to iterate

dreamy spade
#

lol

fresh plover
#

turns out the entire time i only actually needed 3 files