-
-
Notifications
You must be signed in to change notification settings - Fork 94
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
Add parameter to corrosion_import_crate to return list of added targets. #218
Comments
Yeah, this is definitely needed in actual developement. |
I'm curious what your usecase is that you "definitely need" this. From my point of view it's just a minor convenience improvement. Could you elaborate? |
We have a situation where we have to compile multiple crates inside a workspace crate. Since our repository is public, it is https://github.com/cunarist/app-template. It's a template for app development written in Flutter and Rust We have a workspace rust crate
With this situation, we can compile multiple library crates at once with a CMAKE file like this: # Part of CMAKE file
corrosion_import_crate(MANIFEST_PATH ../native/Cargo.toml)
set(CRATE_NAME "first_crate")
target_link_libraries(${BINARY_NAME} PRIVATE ${CRATE_NAME})\
set(CRATE_NAME "second_crate")
target_link_libraries(${BINARY_NAME} PRIVATE ${CRATE_NAME}) However, if we add new library crate inside the # Part of CMAKE file
corrosion_import_crate(MANIFEST_PATH ../native/Cargo.toml)
foreach(LIB ${LIBS}) # Assuming that a list name LIBS is from corrosion_import_crate
target_link_libraries(${BINARY_NAME} PRIVATE ${LIB})
endforeach() |
I'm currently a bit tight on time, but if you would be interested in opening a PR, this feature would be quite simple to implement. We already save the information here in |
Actually things happened, and this issue has moved up on my priority list. I'll probably be able to work on this at the end of the week. |
I did make a pull request as you described. Please tell me if there is any problem. |
I didn't have the time yet, so definitely thanks for doing this! Closing, since #312 is merged now. |
This could be used by the caller to set some properties for all (or a filtered subset) of targets.
You can already manually set the properties, but in cases where there are a lot of targets, it may be more convenient to just iterate over a list that corrosion provides.
The text was updated successfully, but these errors were encountered: