-
Notifications
You must be signed in to change notification settings - Fork 359
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] Don't pull massive 3rd party dependencies via CMAKE by default #213
Comments
The main culprit on my side was that I used SDL3 as the CMAKE target name, and CLAY uses SDL. It would make sense to list the target names in the build section. And maybe be more specific if it's SDL3 or SDL2. |
Hello, thanks for opening this issue 👋 |
Yes, I understand. The thing is when you are working on a bigger project using CMAKE. What you usually do is something like this: FetchContent_Declare(
clay
GIT_REPOSITORY https://github.com/nicbarker/clay.git
GIT_TAG main
)
FetchContent_MakeAvailable(clay) This makes it super simple to have CLAY available, the IDE finding all necessary files, etc. In bigger projects it's more convenient to use CMAKE for all the dependencies that adding a single .h file manually. Further, it simplifies using specific release-/tag-versions. Even CLAY being a single-header-only thing, I think it makes sense to provide a CMAKE compatible way of including it via FetchContent_Declare. |
Is the answer to create an OPTION that only builds examples if the option is set to true? option(CLAY_BUILD_EXAMPLES "Build example programs" OFF)
# ...
if(CLAY_BUILD_EXAMPLES)
add_subdirectory("examples/cpp-project-example")
# ...
endif() EDIT: Oops. I see this is what #216 does. |
See: https://discord.com/channels/1291501630973415474/1328824444009054291/1330582239721029735
CLAY is announced as non-dependency lib, but pulls a ton of 3rd party dependencies via CMAKE, which pollutes/conflicts other projects using CLAY.
Make all those dependencies, like SDL3, optional or guard them.
The text was updated successfully, but these errors were encountered: