Ability to prefix library names #40347
ulfllorenz
started this conversation in
Ideas
Replies: 1 comment
-
It sounds like you can solve this by just creating a custom registry that tracks your custom ports: https://learn.microsoft.com/vcpkg/maintainers/registries Then you could name the ports something like -portname. Usually, companies using vcpkg will append their company name as a prefix. For example, Microsoft could name a port something like msft-libA. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We would like to implement namespacing. Under Windows, a process can load only one library with a given name. In some use cases ,for example an embedded Python, it may happen that our process uses other libraries that in turn may depend on libraries with the same name as those that we use ourselves. This has arbitrary potential for run-time problems.
The general idea in the Python community at least is "namespacing"; your own dependencies are not called, say, "tbb.dll", but you give them a unique name like "tbb_.dll", which avoids name clashes, and everthing is happy.
Suggested solution
Enable this feature in ports. I am aware that this is a pretty extensive requirement, but it would definitely help here.
Ideally, you could specify a VCPKG_PREFIX or something like this in the triplet file, and ports (this we could patch / submit ourselves) patch their libraries to produce the correct prefix.
Workarounds
We can also patch the files after the fact, but this is pretty dirty. Not only do you have to rename the dlls, you also need to change import tables of the dependent dlls, rewrite the import libraries and patch the CMakeFiles.
Beta Was this translation helpful? Give feedback.
All reactions