Skip to content

Commit

Permalink
Update release notes and readme
Browse files Browse the repository at this point in the history
Document recent changes
  • Loading branch information
jschwe committed Sep 10, 2022
1 parent bf5655b commit f7f2d2c
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 3 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,11 @@ Some configuration options can be specified individually for each target. You ca
the `RUSTFLAGS` environment variable will contain the flags added via this function. Please note that any
dependencies (built by cargo) will also see these flags. In the future corrosion may offer a second function
to allow specifying flags only for the target in question, utilizing `cargo rustc` instead of `cargo build`.
- `corrosion_add_target_local_rustflags(target_name rustc_flag [more_flags ...])`: Support setting
rustflags for only the main target (crate ) and none of it's dependencies.
This is useful in cases where you only need rustflags on the main-crate, but need to set different
flags for different targets. Without "local" Rustflags this would require rebuilds of the
dependencies when switching targets.
- `corrosion_set_hostbuild(<target_name>)`: The target should be compiled for the Host target and ignore any
cross-compile configuration.
- `corrosion_set_features(<target_name> [ALL_FEATURES <Bool>] [NO_DEFAULT_FEATURES] [FEATURES <feature1> ... ])`:
Expand All @@ -229,6 +234,12 @@ Some configuration options can be specified individually for each target. You ca
- `corrosion_set_flags(<target_name> <flag1> ...])`:
For a given target, add options and flags at the end of `cargo build` invocation. This will be appended after any
arguments passed through the `FLAGS` during the crate import.
- `corrosion_set_linker(target_name linker)`: Use `linker` to link the target.
Please note that this only has an effect for targets where the final linker invocation is done
by cargo, i.e. targets where foreign code is linked into rust code and not the other way around.
Please also note that if you are cross-compiling and specify a linker such as `clang`, you are
responsible for also adding a rustflag which adds the necessary `--target=` argument for the
linker.

### Selecting a custom cargo profile

Expand Down
26 changes: 23 additions & 3 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,41 @@
# Unreleased

# Breaking
## Breaking

- The minimum supported rust version was increased to 1.46, due to a cargo issue that recently
surfaced on CI when using crates.io.
- Increase the minimum required CMake version to 3.15 (may be bumped to 3.16 before the next release).

# Potentially breaking
## Potentially breaking

- The working directory when invoking `cargo build` was changed to the directory of the Manifest
file. This now allows cargo to pick up `.cargo/config.toml` files located in the source tree.
([205](https://github.com/corrosion-rs/corrosion/pull/205))
- Corrosion internally invokes `cargo build`. When passing arguments to `cargo build`, Corrosion
now uses the CMake `VERBATIM` option. In rare cases this may require you to change how you quote
parameters passed to corrosion (e.g. via `corrosion_add_target_rustflags()`).
For example setting a `cfg` option previously required double escaping the rustflag like this
`"--cfg=something=\\\"value\\\""`, but now it can be passed to corrosion without any escapes:
`--cfg=something="value"`.


## New features

- Support setting rustflags for only the main target and none of it's dependencies ([215](https://github.com/corrosion-rs/corrosion/pull/215)).
A new function `corrosion_add_target_local_rustflags(target_name rustc_flag [more_flags ...])`
is added for this purpose.
This is useful in cases where you only need rustflags on the main-crate, but need to set different
flags for different targets. Without "local" Rustflags this would require rebuilds of the
dependencies when switching targets.
- Support explicitly selecting a linker ([208](https://github.com/corrosion-rs/corrosion/pull/208)).
The linker can be selected via `corrosion_set_linker(target_name linker)`.
Please note that this only has an effect for targets, where the final linker invocation is done
by cargo, i.e. targets where foreign code is linked into rust code and not the other way around.

## Fixes

- Fix a CMake developer Warning when a Multi-Config Generator and Rust executable targets
([#213](https://github.com/corrosion-rs/corrosion/pull/213)).

# 0.2.2 (2022-09-01)

## Fixes
Expand Down

0 comments on commit f7f2d2c

Please sign in to comment.