D package that compiles C code into a library for dub

mio ccec149c9b Add initial git commit as hash to example 6 ماه پیش
example ccec149c9b Add initial git commit as hash to example 6 ماه پیش
source 9ad955346e Initial commit 6 ماه پیش
.gitignore 9ad955346e Initial commit 6 ماه پیش
LICENSE 9ad955346e Initial commit 6 ماه پیش
README.adoc 9ad955346e Initial commit 6 ماه پیش
dub.json 9ad955346e Initial commit 6 ماه پیش

README.adoc

= PCC
:url-dub: https://dub.pm
:url-importc: https://dlang.org/spec/importc.html

PCC is a library that allows you to compile a set of C source code files into a static archive that can be linked to by {url-dub}[DUB] when compiling your project.

== Usage

Please see the example provided in the link:./example[`example/`] directory.

== Requirements

This package requires access to a C compiler when the build script is being run -- it does not provide a C compiler itself. On UNIX platforms this requires `cc` to be a C compiler, which is typically GCC or Clang.

== How Does It Compared to ImportC?

If you're unfamiliar with {url-importc}[ImportC], it is a relatively new feature of D implementations (first released with D 2.098, which was published on October 10, 2021). It allows you to import C code as if it were D code by using the standard `import` statement. For projects only supporting D 2.101 and newer, I'd suggest taking a look at {url-importc}[ImportC] instead of PCC.

PCC is meant to make it easier to distribute C source code files with your D projects and compile them "on-the-fly" for D 2.100 and older.

== Future Improvements

* [ ] Toggling of common C flags (`-Wall`, for example)
* [ ] C++ support.
* [ ] Allow choosing GCC or Clang specifically.

'''

PCC was inspired by the https://docs.rs/cc[`cc`] rust crate.