Comments (3)
I could try to tackle this with some guidance if it's relatively straightforward.
from corrosion.
Roughly, you'll need to do some updates to _add_cargo_build
- You'll need to add a
${CMAKE_COMMAND} -E copy
call in theadd_custom_target
call towards the end of the function to move the build artifacts to the target location from the cargo build tree - by default I think this would be ${CMAKE_CURRENT_BINARY_DIR} for all target types - You'll need to use the overloaded target output directories (listed above) if they're set in place of CMAKE_CURRENT_BINARY_DIR
- This has a rub - normally you'd want to use generator expressions to make sure if the user changes those target properties after they import the crate, the property is still respected. Unfortunately, the
BYPRODUCTS
portion ofadd_custom_target
doesn't support generator expressions, and settingBYPRODUCTS
is necessary for using the Ninja generator. You can either just useget_target_property
in all cases, with the downside that you won't be able to useset_target_property
to set the property, or useget_target_property
when using the Ninja generator and generator expressions for all other generators. I probably prefer the former option so that the behavior is uniform no matter what generator you're using. There's some existing discussion of this issue here: #50
- This has a rub - normally you'd want to use generator expressions to make sure if the user changes those target properties after they import the crate, the property is still respected. Unfortunately, the
- You'll need to update the
byproducts
variable to point to the new build location - this should be fairly easy in the default case, sinceBYPRODUCTS
is relative to CMAKE_CURRENT_BINARY_DIR by default, but you'll also need to implement it when using the custom locations
We currently don't track the pdb files at all, but those should be fairly easy to implement - should be output in the same place as all the other artifacts. However, if you're not on a Windows machine, then don't worry about it - I can add support for copying those later.
from corrosion.
I can't figure out how to get the TYPE of each target in cmake. It always reports UTILITY
. My current thinking is that we would need to pass it as an argument to _add_cargo_build
since it's known here: https://github.com/AndrewGaspar/corrosion/blob/master/generator/src/subcommands/gen_cmake/target.rs#L109-L129
from corrosion.
Related Issues (20)
- Multi configuration builds don't work HOT 2
- Investigate FOLDER property for targets HOT 2
- Relevant upstream Cmake issues for corrosion custom target name improvements
- [Question]: How to maintain order of libraries HOT 2
- Cross-Compiling Rust cdylibs with clang as the linker is likely broken HOT 1
- Cross-compiling with clang and (c)dylibs in the dependency graph is broken
- Support installing libraries HOT 4
- MacOS fat binaries support HOT 8
- CMake sometimes hangs after Cargo finishes a crate when using sccache HOT 5
- [Bug]: detecting native-static-libs on Windows with Rust 1.71 fails when linking crate from a workspace HOT 22
- Custom target support HOT 4
- Multi-crate setup: Recompiling shared dependencies HOT 4
- [Bug]: toxic `proc-macro2` version HOT 6
- `cargo rustc --crate-type` support HOT 8
- [Example Request]: How to integrate 2+ cxx crate HOT 2
- `corrosion_import_public_crate(CRATE_NAME "libc" VERSION "0.2")`-like feature / CMake-Crates.io integration? HOT 2
- Support `$<CONFIG>` in `OUTPUT_DIRECTORY` HOT 6
- [Bug]: Some crate requires AR_<triple> environment to cross-compile HOT 1
- [Bug]: Regression caused by passing AR? commit b72c8ceb52f5d0235ce0fc268cfeff20ce56e8d8? HOT 1
- Upstream Rust language support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from corrosion.