#Using build.zig for a C++ project
1 messages · Page 1 of 1 (latest)
A static library is an archive of one object per compilation unit, so in C that's one per C source file.
Confused as you can have multiple C files compile to a single object file by having them in the same compilation unit
i.e. clang a.c b.c -o ab.o
That's not doing what you think it is: clang by default is going to try and make an executable, not an object. To tell it to generate object files you have to pass -c, but then you'll get error: cannot specify -o when generating multiple output files. One compilation unit is precisely the same as one C file, and as such there's always a 1:1 correspondence between input C files and object files
ah ok, so addCSourceFiles() already handles separate obj generation?