Git Product home page Git Product logo

Comments (3)

kjeremy avatar kjeremy commented on May 9, 2024

I could try to tackle this with some guidance if it's relatively straightforward.

from corrosion.

AndrewGaspar avatar AndrewGaspar commented on May 9, 2024

Roughly, you'll need to do some updates to _add_cargo_build

  • You'll need to add a ${CMAKE_COMMAND} -E copy call in the add_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 of add_custom_target doesn't support generator expressions, and setting BYPRODUCTS is necessary for using the Ninja generator. You can either just use get_target_property in all cases, with the downside that you won't be able to use set_target_property to set the property, or use get_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
  • You'll need to update the byproducts variable to point to the new build location - this should be fairly easy in the default case, since BYPRODUCTS 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.

kjeremy avatar kjeremy commented on May 9, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.