Skip to content
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

Enable delayed loading of VTK libraries on Windows #5642

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

CSBVision
Copy link
Contributor

Currently, VTK is a relatively large but mandatory dependency of PCL. However, it is mostly (if not only) needed for visualization/debugging/etc. such that a significant amount of library functionalities are actually independent of VTK. Still, VTK libraries will always be required since they are a link-time dependency even though they might be not used at all in many applications. For this reasoning, we propose to make the VTK libraries delay loaded on Windows using the /DELAYLOAD linker option. This allows to skip the VTK modules while distributing PCL, which makes the distribution process relatively lightweight (in particular, if the other dependencies are statically linked).

The respective changes are rather small, after VTK was found only the respective linker flags are defined.

@larshg
Copy link
Contributor

larshg commented Mar 27, 2023

You can omit using VTK entirely if you build PCL yourself. But I guess it doesn't hurt to do be able to delayload it as an option anyways.

@CSBVision
Copy link
Contributor Author

Might be true, thanks for pointing out, we did not test this at all because to our knowledge VTK is a mandatory dependency. Even though it can be omitted, it is still extremely useful during development or for debugging purposes, i.e. we don't want to exclude it from the build. Here, delay load allows to use it only where needed, but to skip it elsewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants