README.adoc 1.3 KB

123456789101112131415161718192021222324252627282930
  1. = PCC
  2. :url-dub: https://dub.pm
  3. :url-importc: https://dlang.org/spec/importc.html
  4. 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.
  5. == Usage
  6. Please see the example provided in the link:./example[`example/`] directory.
  7. == Requirements
  8. 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.
  9. == How Does It Compared to ImportC?
  10. 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.
  11. 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.
  12. == Future Improvements
  13. * [ ] Toggling of common C flags (`-Wall`, for example)
  14. * [ ] C++ support.
  15. * [ ] Allow choosing GCC or Clang specifically.
  16. '''
  17. PCC was inspired by the https://docs.rs/cc[`cc`] rust crate.