Closed sls1005 closed 1 year ago
Add an option: --cc:zig to support zig cc as a C compiler for the C backend of Nim, and zig c++ for the C++ backend.
--cc:zig
zig cc
zig c++
The command zig cc can be used as a C cross-compiler. And as a replacement for MinGW. So I hope it could be supported.
See: https://andrewkelley.me/post/zig-cc-powerful-drop-in-replacement-gcc-clang.html
The command is zig cc for C, and zig c++ for C++. The other cmdline options are the same as that of clang.
clang
For example:
zig cc *.nim.c -I/usr/lib/nim/lib -o a.out
No response
This doesn't need any Nim support. It's already possible using this package https://github.com/nim-lang/packages/pull/2323
I see.
Abstract
Add an option:
--cc:zig
to supportzig cc
as a C compiler for the C backend of Nim, andzig c++
for the C++ backend.Motivation
The command
zig cc
can be used as a C cross-compiler. And as a replacement for MinGW. So I hope it could be supported.See: https://andrewkelley.me/post/zig-cc-powerful-drop-in-replacement-gcc-clang.html
Description
The command is
zig cc
for C, andzig c++
for C++. The other cmdline options are the same as that ofclang
.For example:
Code Examples
No response
Backwards Compatibility
No response