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

Use different namespaces for each PSM #71

Open
jdumas opened this issue Mar 1, 2023 · 3 comments
Open

Use different namespaces for each PSM #71

jdumas opened this issue Mar 1, 2023 · 3 comments

Comments

@jdumas
Copy link
Contributor

jdumas commented Mar 1, 2023

Ideally each PSM should use different root namespaces to avoid symbol collisions between them. E.g. GEO_Delaunay or GEO_Predicates instead of simply GEO.

@BrunoLevy
Copy link
Owner

You mean you want to be able to use both Delaunay_PSM and Predicates_PSM in the same project ? But when you drag Delaunay_PSM, it also has the predicates, so maybe it is just a question of keeping the declarations of the predicates in the .h of the PSM ? (or maybe I did not understand the use case).

@jdumas
Copy link
Contributor Author

jdumas commented Mar 2, 2023

It's really about dependency management and whether each "PSM" should be considered to be a separate entity unrelated to the main "Geogram" library.

Let's say I have two lib A and B. The first one uses the Delaunay_PSM, and will thus look for an #include <Delaunay_psm.h>. The second one only requires the Geogram predicates, and will thus do an #include <Predicates_psm.h>. Right now I wouldn't be able to compile an app that depends on both A and B, since they use different dependencies with conflicting symbols (everything is in the GEO namespace). Even if I linked both A and B against the full Geogram library, they'd be looking for different headers, so it wouldn't compile easily.

My suggested solution would be to consider each PSM as a different library, using different namespaces, so they could coexist with each other inside the same application.

@BrunoLevy
Copy link
Owner

Thank you for the clarification !

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

No branches or pull requests

2 participants