-
Notifications
You must be signed in to change notification settings - Fork 369
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] Make Examples Optional in CMAKE #216
Conversation
Makes including the examples optional. SDL2/SDL3 specifically have long download/build times. If they aren't being used, then this can dramatically speed up build times.
I'm not sure I understand what use case exists for running CMake with the flag disabled... The only thing the CMake project does is compile the examples, so with it disabled, CMake does nothing at all. |
I'm not a CMAKE expert by any means, so I could be doing the following wrong. I'm using FetchContent to add Clay to my project. This adds the examples, which then adds all the dependencies. That being said, this was just a quick solution to my specific problem. A more practical solution would probably be to have the option take a string to allow you to select which example you want to build. For example, someone that only wants to build the Raylib example shouldn't be required to download and build both versions of SDL. |
See #213 same problem, same suggestion. |
Thanks for figuring this out! I'm fine with this as long as we flip the default option to |
Added separate CMAKE options to include each of the individual examples as well as one global option to include all examples. I set build all examples to OFF as a default since downloading all of SDL 2 and 3 seems excessive. Instead, the demo from the video and the website are turned on by default. A note about these options should probably be added to the ReadMe as well, but I wasn't sure where the logical place to put it would be.
I added an update that makes the CMAKE build options more granular. I set build all examples to OFF as a default since downloading all of SDL 2 and 3 seems excessive. Instead, the demo from the video and the website are turned on by default. These options should probably be included in the ReadMe somewhere, but I wasn't sure where the logical place to put it would be. |
Sorry about the back and forth, but I think it would be best if we left the examples |
That's OK as well. As long as there is a way I can use the CMAKE stuff and configure it somehow to only use the CLAY code. |
@nicbarker Done. |
Looks good to me, thanks for the work here! 🙂 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CMakeLists.txt
Makes including the examples optional. SDL2/SDL3 specifically have long download/build times. If they aren't being used, then this can dramatically speed up build times.