Open wusticality opened 3 months ago
Huh, I was under an impression that intermediate libraries shouldn't need to care how dependencies are linked at all. I would've expected them to get figured out during the final link of the executable.
Either way, I'm happy for you all to explore the solution space and propose a fix here. I'm not really familiar with the in-depth details of how the Microsoft's ecosystem is meant to work here, so my input is also prone to not be particularly insightful here.
Huh, I was under an impression that intermediate libraries shouldn't need to care how dependencies are linked at all. I would've expected them to get figured out during the final link of the executable.
Either way, I'm happy for you all to explore the solution space and propose a fix here. I'm not really familiar with the in-depth details of how the Microsoft's ecosystem is meant to work here, so my input is also prone to not be particularly insightful here.
Hey @nagisa, thanks for your reply. This only appears to be an issue on Windows. There, all libraries you link against (whether static or dynamic) must link against the C runtime the same way. Since this happens in build.rs
, I suppose a quick and dirty hack would be to add like a "statically-linked" feature flag on Windows, but perhaps a better way would be via an environment variable that you parse and then iterate over to pass things along, maybe like:
TRACY_CLIENT_CC_FLAGS = "/MT" "some_other_flag"
Thoughts?
We already have an ability to pass in the C(++) flags via an environment variable: TRACY_CLIENT_SYS_CXXFLAGS
In
tracy-client-sys
inbuild.rs
, inside thebuild_tracy_client
function, you buildlibtracy-client.a
via thecc
package. On Windows, we are being provided externaldll
's that link against the C runtime statically. Unfortunately, your code links against the C runtime dynamically, and on Windows, all libraries that your exectuable links against must link against the C runtime the same way (either statically or dynamically). Being able to control this would be very helpful. At present this is only a problem on Windows. Our hack looks something like this:You can see our branch here. Perhaps the best way to handle this is through a feature flag? Thanks in advance.