-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
BUILD_SHARED_LIBS #207
Comments
Currently I am maintaining cJSON, haven't heard from Dave in a while. Anyway, I don't quite understand what you mean. My understanding is that you somehow use To be honest, I still don't fully understand how the scope and lifetime of different variables and options in CMake work. Avoiding global namespace issues would have required the CMake options to have the name of the library in them, which not all of them do. But I can't just rename them, without breaking compatibility, maybe you have an idea how this can be done. If you use Maybe there is something you can do with CMake's import/export feature (cJSON can export it's targets via CMake). Or with CMake's external project functionality. |
Hi Max, Thanks |
Ok, I think I understand the problem now. I am not sure though if it is possible to introduce a new cJSON-only option while still honoring the One possibility would be to still set If you have more ideas please tell me. |
What you suggest would be perfect I think, it keeps the current behaviour by default while giving the user the possibility to override it when needed. Best regards |
Yes, I haven't really considered the use of cJSONs CMakeLists.txt in the context of another CMake project so far. That would definitely be an improvement, thank you for the feedback. |
This has been implemented on the |
Great, thanks! |
Hi Dave,
the CMakeList.txt for cJSON sets the BUILD_SHARED_LIBS global flag to ON.
This can cause surprising results when cJSON is built inside a bigger project
where this variable was not set.
Would it be possible to modify the CMakeList to avoid this?
Best regards
Maurizio
The text was updated successfully, but these errors were encountered: