-
-
Notifications
You must be signed in to change notification settings - Fork 346
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
CMake: Support CMake build within an isolated Conda environment for Linux #5322
Conversation
Does this take into account the recent PR #5305? |
Yes, I used the latest main branch and I saw that merged code. |
The CI is not using conda, so I assume this works well without conda. (?) |
Yes, tested without Conda as well. |
Regarding Iconv: I suggest to configure with I very much doubt linking every dependency to our libraries as "PUBLIC" is the best approach. I believe it rather conceal the real problem, which we rather should try to find out what it is. |
If I depend on A, I assume it will bring all its dependencies, i.e., the transitive dependencies should be implicitly carried over. Is that what we are talking about here? |
Makes sense. I'm doing the same for Linux anyway. Ah.. never thought about that! |
Yes, you're right. A explicitly depends on B, which depends on C. A doesn't directly depends on C. We still need to carry over both B and C for A, unless we want to accumulate all these dependencies manually in CMakeLists.txt. |
It might be a
|
Yay! That was it! |
Great that we could sort that out! What PUBLIC linking is doing is passing any dependency of a (in this case) library to the target, leading to overlinking. Let us take an example
Looking at the above makes it clear, that quite obviously, the PRIVATE linking is the preferred way in this/our case. |
This PR fixes two issues when building with Conda libraries for Linux:
libgrass_gis.so
is compiled with the built-in iconv (function namesiconv_open/close
), but buildingdb/drivers/pg
, which depends onlibgrass_gis.so
, fails because its another dependency PostgreSQL requires libiconv (function nameslibiconv_open/close
).cmake .. -DIconv_IS_BUILT_IN=FALSE
DEPENDS
publicdb/driver/pg
fails because it cannot find the dependency libraries oflibgrass_gis.so
.