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

Always set IMPORTED_LOCATION #213

Merged
merged 2 commits into from
Sep 10, 2022
Merged

Always set IMPORTED_LOCATION #213

merged 2 commits into from
Sep 10, 2022

Conversation

jschwe
Copy link
Collaborator

@jschwe jschwe commented Sep 6, 2022

Not setting IMPORTED_LOCATION on imported executables causes CMake
developer warnings. Setting IMPORTED_LOCATION_<CONFIG> is not sufficient.
The issue only affects Multi-Config Generators like Ninja-MultiConfig or
Visual Studio, since otherwise IMPORTED_LOCATION is already always set.

For Multi-Config builds there is no "correct" thing to set
IMPORTED_LOCATION to, so we just always set it, and the last configuration
wins. This is not a problem since the more specific IMPORTED_LOCATION_<CONFIG>
variants are also set in the multi-config case.

Also test that rust dependencies link with foreign code
Not setting IMPORTED_LOCATION on imported executables causes CMake
developer warnings. Setting IMPORTED_LOCATION_<CONFIG> is not sufficient.
The issue only affects Multi-Config Generators like Ninja-MultiConfig or
Visual Studio, since otherwise IMPORTED_LOCATION is already always set.

For Multi-Config builds there is no "correct" thing to set
IMPORTED_LOCATION to, so we just always set it, and the last configuration
wins. This is not a problem since the more specific IMPORTED_LOCATION_<CONFIG>
variants are also set in the multi-config case.

This commit refactors a bit of common code into a function, so that both
CorrosionGenerator.cmake and the Rust based CMake Generator can use it.
@jschwe jschwe requested a review from ogoffart September 6, 2022 11:18
@jschwe jschwe merged commit 63ba831 into master Sep 10, 2022
@jschwe jschwe deleted the imported_location branch September 10, 2022 13:21
@jschwe jschwe added this to the v0.3 milestone Sep 18, 2022
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.

None yet

1 participant