Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd 'Compile a C library while setting custom defines' (#295) #323
Conversation
budziq
requested changes
Oct 11, 2017
| [![cc-badge]][cc] [![cat-development-tools-badge]][cat-development-tools] | ||
| It is simple to build bundled C code with custom defines using [`cc::Build::define`][cc-build-define]. |
This comment has been minimized.
This comment has been minimized.
budziq
Oct 11, 2017
Collaborator
Instead of
[cc::Build::define][cc-build-define]
we can use link descriptor with just
[cc::Build::define]
| [![cc-badge]][cc] [![cat-development-tools-badge]][cat-development-tools] | ||
| It is simple to build bundled C code with custom defines using [`cc::Build::define`][cc-build-define]. | ||
| It takes an [`Option`] value, so it is possible to create defines such as `#define FLAG` |
This comment has been minimized.
This comment has been minimized.
budziq
Oct 11, 2017
Collaborator
I would suggest referencing the defines actually used in the snippet below instead of VALUE and FLAG or use these in the actual snippet.
also I would try to emphasize that #define FLAG type is created with None
| {{#include links.md}} | ||
|
|
||
| <!-- Other Reference --> | ||
|
|
||
| [build-script-docs]: http://doc.crates.io/build-script.html | ||
| [playground]: https://play.rust-lang.org | ||
| [cc-build]: https://docs.rs/cc/*/cc/struct.Build.html | ||
| [cc-build-define]: https://docs.rs/cc/1.0.0/cc/struct.Build.html#method.define |
This comment has been minimized.
This comment has been minimized.
budziq
Oct 11, 2017
Collaborator
please use wildcard version numbers
also we can use
[Build::define]: https://docs.rs/cc/*/cc/struct.Build.html#method.define
directly instead.
It would be great help if you could cleanup the other examples here with this type of reference (but this will not be a blocker for this PR ;) )
| It is simple to build bundled C code with custom defines using [`cc::Build::define`][cc-build-define]. | ||
| It takes an [`Option`] value, so it is possible to create defines such as `#define FLAG` | ||
| as well as `#define VALUE 123`. This example builds a bundled C file with dynamic defines set in | ||
| `build.rs` and prints `Welcome to foo - version 1.0.2` when run. Cargo sets some [environment |
This comment has been minimized.
This comment has been minimized.
budziq
Oct 11, 2017
Collaborator
build.rsand printsWelcome to foo - version 1.0.2
Lets leave the backtick "`" emphasis for code. I would suggest bold emphasis here.
This comment has been minimized.
This comment has been minimized.
|
Hi @budziq, updated based on your feedback. How's it looking now? |
budziq
merged commit ac20edd
into
rust-lang-nursery:master
Oct 12, 2017
This comment has been minimized.
This comment has been minimized.
|
Thanks @bobbo! |
bobbo commentedOct 9, 2017
•
edited
Fixes #295