-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
use zig as a c compiler #490
Labels
accepted
This proposal is planned.
enhancement
Solving this issue will likely involve adding new logic or components to the codebase.
proposal
This issue suggests modifications. If it also has the "accepted" label then it is planned.
Milestone
Comments
andrewrk
added
accepted
This proposal is planned.
enhancement
Solving this issue will likely involve adding new logic or components to the codebase.
proposal
This issue suggests modifications. If it also has the "accepted" label then it is planned.
labels
Sep 17, 2017
There should be some macro identifying that it is "zig compiler" and its version. |
Sure, we can do: #define __zig__ 1
#define __zig_version__ "0.0.0"
#define __zig_major__ 0
#define __zig_minor__ 0
#define __zig_patchlevel__ 0 to match clang. The corresponding clang defines will still exist. |
Closed
tiehuis
added a commit
that referenced
this issue
Apr 12, 2018
Commands are now separated more precisely from one another. Arguments are parsed mostly using a custom argument parser instead of manually. This should be on parity feature-wise with the previous main.zig but adds a few extra code-paths as well that were not yet implemented. Subcommands are much more prominent and consistent. The first argument is always a sub-command and then all following arguments refer to that command. Different commands display there own usage messages and options based on what they can do instead of a one-for-all usage message that was only applicable for the build commands previously. The `cc` command is added and is intended for driving a c compiler. See #490. This is currently a wrapper over the system cc and assumes that it exists, but it should suffice as a starting point.
andrewrk
added a commit
that referenced
this issue
Feb 24, 2019
This was referenced Feb 25, 2019
@andrewrk said:
This doesn't seem to be the case when using zig cc in version Is there another approved way to detect compilation under zig? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
accepted
This proposal is planned.
enhancement
Solving this issue will likely involve adding new logic or components to the codebase.
proposal
This issue suggests modifications. If it also has the "accepted" label then it is planned.
All args after
cc
are args exactly as you would pass to clang. We depend on libclang, might as well expose it.In the std build API, the default way to compile C code would be with this, instead of with an external compiler. Using an external compiler is still useful and supported, however.
Being a C++ compiler is a little tricker, since we would need to know the location of libstdc++ in addition to libc, and all the weird versioning stuff that goes along with it.
The text was updated successfully, but these errors were encountered: