Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport recent changes to stable/v0.4 #517

Merged
merged 11 commits into from
May 11, 2024

Conversation

jschwe
Copy link
Collaborator

@jschwe jschwe commented May 10, 2024

No description provided.

jschwe and others added 2 commits May 10, 2024 20:56
Fix hostbuild when crosscompiling to windows from a different OS.

(cherry picked from commit ce8427f)
(cherry picked from commit b25a1fa)
@jschwe jschwe changed the base branch from master to stable/v0.4 May 10, 2024 19:10
jschwe and others added 5 commits May 11, 2024 11:03
Backport changes from:

- cbindgen: Automatically detect package name.
  b11a338
- cbindgen: Pass Rust target-triple to cbindgen
  3bf5f1c
- cbindgen: Allow generating multiple headers on one Rust target
  d60944e
- Set the `AR_<triple>` variable for cc-rs.
- Simplify condition for CC_<triple> and CXX_<triple>.
  The target is always defined in corrosion,
  so there is no need to check if it set.
- Don't set `AR` for `msvc` targets

(cherry picked from commit b72c8ce)
(cherry picked from commit 03e4617)
If a user tries to use `corrosion_link_libraries` on static libraries,
forward the dependencies to C/C++ consumers by internally calling
`target_link_libraries()`.

(cherry picked from commit 10da46b)
* msvc: handle flags that come from native-static-libs

As of https://github.com/rust-lang/rust/pull/122268/files, rust emits /defaultlib:msvcrt in native-static-libs

This ends up in INTERFACE_LINK_LIBRARIES, and then ninja thinks it's a file:

ninja: error: '/defaultlib:msvcrt', needed by 'cpp-exe.exe', missing and no known rule to make it

This check to see if libraries start with a slash, and then assuming that they are a flag, and putting those in INTERFACE_LINK_OPTIONS instead.

(cherry picked from commit fce4fe5)
jschwe and others added 3 commits May 11, 2024 11:13
We don't need the is_binary parameter, since we can check the
target property.

(cherry picked from commit 4f2847f)
The value of the `_CORROSION_VERBOSE_OUTPUT_FLAG` variable (set based on
the `CORROSION_VERBOSE_OUTPUT` option) isn't propagated to the
`_add_cargo_build` function where it is used: https://github.com/corrosion-rs/corrosion/blob/0a3bdf452995803c334d79dc9a2affbfad51b720/cmake/Corrosion.cmake#L768
Setting it as cache entry fixes that.

(cherry picked from commit 74fb8cc)
line 71 does the same thing.

(cherry picked from commit 5bfa8ac)
@jschwe jschwe merged commit 04f378c into corrosion-rs:stable/v0.4 May 11, 2024
34 of 38 checks passed
@jschwe jschwe deleted the jschwender/backports branch May 11, 2024 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants