-
-
Notifications
You must be signed in to change notification settings - Fork 111
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
Corrosion is incompatible with Ninja Multi-Config #50
Comments
I went to look into this and remembered that I had run into this before... The issue that makes this "hard" ultimately comes down to the problem that you can't use generator expressions in the I initially thought I'd make the "debug" and "release" builds separate custom targets. However, that doesn't work either because once you go to generate the imported targets (e.g. An "easy" solution is to instead use the A harder solution would be to instead copy all the outputs to a different location, which honestly might be a good idea anyway - they should probably go directly in the binary dir. Having to go digging for libs and executables in the cargo output directory is annoying, and is honestly not in the spirit of Corrosion. |
I am worried that you experienced the exactly same issues than what I have
encountered beginning of this week in my project. Did you try to raise this
with the CMake developers? I suppose it could be something that cannot be
solved (easily), since dependency management is configuration time :(.
I initially thought I'd make the "debug" and "release" builds separate custom targets. However, that doesn't work either because once you go to generate the imported targets (e.g. `foo`, in your case), you can't use generator expressions in the `add_dependencies` call either - so no `add_dependencies(foo $<IF:$<CONFIG:Debug>,cargo-build-debug_foo,cargo-build-release_foo>)`.
An "easy" solution is to instead use the `--out-dir` flag to `cargo` to place debug and release builds in the same relative path. Unfortunately, it's not stable yet, so it would require a nightly rust toolchain: rust-lang/cargo#6790
We could try to raise awareness on the Rust side. Would it be possible to
enable this unstable feature using an option? Or would it be too hard to
implement two paths?
A harder solution would be to instead copy all the outputs to a different location, which honestly might be a good idea anyway - they should probably go directly in the binary dir. Having to go digging for libs and executables in the cargo output directory is annoying, and is honestly not in the spirit of Corrosion.
Sure, but at least the final build artefact location is stable, isn't it? Did
you mean "is not a good idea" :)?
I would like to make progress here. The CMake side seems difficult to me
because I suspect it's the way CMake is build that this feature is impossible.
`--out-dir` seems to be mostly an issue of "how do we handle x" and in the
spirit of having an embedded working group, that should be able to be
prioritised, if we have good arguments.
Thanks
|
OK, so I tried to implement the copying method and discovered that it would not solve the issue of not allowing generator expressions in I'll make a note on the CMake issue. In the mean time, I'm going to rename this issue - this doesn't affect all multi-config generators, just Ninja multi-config. |
…hem in byproducts Does not work with any existing version of CMake Related to #50
Looks like this will be supported in CMake 3.20: https://gitlab.kitware.com/cmake/cmake/-/merge_requests/5402 |
Great news.
|
CMake 3.20.0 was released few weeks ago. If it indeed fixed the issue, then the Corrosion's generator check regarding Ninja Multi-Config could be extended to check for compatible CMake version. |
How is this going now? on |
Could you specify what you mean by "broken" ? |
I'm using |
it was showing the exact error as above. I will upload some logs later |
1 similar comment
it was showing the exact error as above. I will upload some logs later |
Ahh, great - yes please :). Please also include the command line you're using to invoke cmake. Do you have a |
When I try to build my project with Corrosion and the Ninja Multi-Config generator, I get a mesage like this:
If I use
-G Ninja
, it works. I had this issue with single-conf vs. multi-conf. in my project as well. It usually boils doin to a few generator expressions at places where paths are constructed.Thanks :-)
The text was updated successfully, but these errors were encountered: