Skip to content

Commit

Permalink
doc: Update Readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Maroon502 committed Apr 11, 2024
1 parent acaa9ab commit de7dc22
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,18 @@
`coin-build-tools` provides a set of tools to build [Coin-OR] libraries from source.

## Usage

Just add the following to your `Cargo.toml`:

```toml
[build-dependencies]
coin-build-tools = "0.2"
coin-build-tools = "\*"
```

## Configuration

### Environment

The package build from the source and link statically by default. It also provide the following environment variables to allow users to link to system library customly:

* `CARGO_${LIB_NAME}_STATIC` to link to CoinUtils statically;
Expand All @@ -23,8 +26,8 @@ Set the environment variable to `1` to enable the feature. For example, to link

## Windows and vcpkg

On Windows, if `${LIB_NAME}_SYSTEM` is set to `1`, `osi-src` will use
[vcpkg] to find Osi. Before building, you must have the correct Osi
On Windows, if `${LIB_NAME}_SYSTEM` is set to `1`, `osi-src` will use
[vcpkg] to find Osi. Before building, you must have the correct Osi
installed for your target triplet and kind of linking. For instance,
to link dynamically for the `x86_64-pc-windows-msvc` toolchain, install
`osi` for the `x64-windows` triplet:
Expand All @@ -47,37 +50,39 @@ vcpkg install osi --triplet x64-windows-static

and build with `+crt-static` option

```
```sh
RUSTFLAGS='-C target-feature=+crt-static' cargo build --target x86_64-pc-windows-msvc
```

Please see the ["Static and dynamic C runtimes" in The Rust reference](https://doc.rust-lang.org/reference/linkage.html#static-and-dynamic-c-runtimes) for detail.

## Cross Compilation
you can use it for the other target by providing the `--target` option to
`cargo build`.

you can use it for the other target by providing the `--target` option to
`cargo build`.

| Target | supported |
|--------------------------------------|:-----------:|
| `arm-unknown-linux-gnueabi` ||
| `arm-unknown-linux-gnueabihf` ||
| `armv7-linux-androideabi` ||
| `armv7-unknown-linux-gnueabi` ||
| `armv7-unknown-linux-gnueabihf` ||
| `armv7-unknown-linux-musleabi` ||
| `armv7-unknown-linux-musleabihf` ||
| `aarch64-unknown-linux-gnu` ||
| `aarch64-unknown-linux-musl` ||
| `riscv64gc-unknown-linux-gnu` ||
| `x86_64-pc-windows-gnu` ||
| `x86_64-pc-windows-msvc` ||
| `x86_64-unknown-linux-gnu` ||
| `x86_64-unknown-linux-musl` ||
| others | not test |

## Contribution

Your contribution is highly appreciated. Do not hesitate to open an issue or a
pull request. Note that any contribution submitted for inclusion in the project
will be licensed according to the terms given in [LICENSE](license-url).


[vcpkg]: https://github.com/Microsoft/vcpkg

[documentation-img]: https://docs.rs/coin-build-tools/badge.svg
Expand Down

0 comments on commit de7dc22

Please sign in to comment.