-
Notifications
You must be signed in to change notification settings - Fork 407
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Zig support improvement #602
Comments
@plajjan It would be very convenient to support CFLAGS_EXTRA option, could you please add it? |
With "replace -Denable_threads=false to -fsingle-threaded", do you mean we should replace the user visible input? I don't think that is possible. I think the idea with zig build is that you don't just let users pass compiler flags straight to the compiler but rather expose them as project specific options (the If on the other hand you mean that we should set |
@ivmai yes, I can add a simple CFLAGS_EXTRA option that just passes through its value to the compiler. I don't see any added value in parsing it to separate arguments etc, so straight pass-through it is! :) |
I mean expose change build.zig to let client build single-threaded library using -fsingle-threaded option (more nature way in zig world if I understand it correctly) instead of -Denable_threads=false option. I.e.: |
Similarly, it looks like |
@ivmai I'm no authoritative zig expert but as far as I know this is not possible. Just testing
|
Okay (about -fsingle-threaded). I am removing it from issue description. |
@plajjan Could we make test names as given in cmake script? (hugetest, subthreadcreatetest, etc.) |
It seems that cmake's separate_arguments() is needed, see #607 (comment) |
@plajjan I will remove this option. If you agree it is redundant. |
I'll do it. |
Issue #602 (bdwgc). The tests are built only if "test" step is requested (similar to Makefile), thus no need for the build_tests option. * build.zig (build_tests): Remove option (const); assume it is always true; add comment.
Issue #602 (bdwgc). * README.md (Zig): Update sample zig build command to run the tests as well.
Issue #602 (bdwgc). * build.zig (build): Pass specific filename to each addTest() call. * build.zig (addTest): Add filename argument instead of computing it from testname.
Issue #602 (bdwgc). If MISSING_MACH_O_GETSECT_H is defined (manually), then do not include mach-o/getsect.h file. * dyn_load.c [DARWIN]: Do not include getsect.h if MISSING_MACH_O_GETSECT_H. * dyn_load.c [DARWIN && MISSING_MACH_O_GETSECT_H] (getsectiondata): Declare extern function. * dyn_load.c [DARWIN] (GC_MACH_HEADER): Move definition upper (to be before getsectiondata() declaration).
Taking advantage of the Zig toolchain topic. What is the level of support between C++ ABI? |
@kassane when I built C++ things with Zig I have had to add |
Yes. By adding So, bdwgc supports it has no restriction in C++ABI. Right? |
Right. It should not, at least. |
It would be good to add building of libgccpp.so, libgctba.so and cpptest to build.zig (at least to have a working sample of C++ support). |
also, add msvc support using zig-build. // zig v0.12.0 - for C++ build on msvc or gnu
// https://github.com/ziglang/zig/issues/5312
if (exe.rootModuleTarget().abi != .msvc)
exe.linkLibCpp() // libc++ + libunwind [static]
else
exe.linkLibC(); // search VSCrt + winSDK |
New (mix C++/D) |
Issue #602 (bdwgc). The final version of zig v0.12.0 has been released recently. * build.zig (zig_min_required_version): Update to "0.12.0"; remove TODO item.
(refactoring) Issue #602 (bdwgc). * build.zig (build): Rename lib variable to gc one. * build.zig (addTest): Rename lib argument to gc one.
Issue #602 (bdwgc). This commit adds support of build_cord option to Zig script (to match that of CMake script). * build.zig (build): Add build_cord const (option); define cord variable. * build.zig [build_cord] (build): Define cord_src_files variable; specify source files and dependency library for cord; install cord artifact; call addTestExt() for cordtest; add TODO item about de. * build.zig [install_headers && build_cord] (build): Install cord headers. * build.zig (addTestExt): New function (move most code from addTest except for added lib2 argument). * build.zig (addTest): Redirect to addTestExt().
Colleagues, I've added build of cord library (7201f3f) - the code is work, but maybe you could suggest me tips to improve the code if any (cordtest request linking against 2 libs, so I've added addTestExt to be able to pass 2 libs for a test). |
(refactoring) Issue #602 (bdwgc). * build.zig (build): Use append() instead of appendSlice() for source_files, flags, gctba_src_files where only 1 element is appended.
Continuation of #557 and PR #598.
What to improve in build.zig:
What to improve in GH Actions:
The text was updated successfully, but these errors were encountered: