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

Build specific example using -DBUILD_EXAMPLE Cmake flag #3921

Merged
merged 1 commit into from
Apr 17, 2024

Conversation

benjitrosch
Copy link
Contributor

As the title says, this allows users to build only one example rather than all of them using CMake by passing a BUILD_EXAMPLE flag:

cmake -B build -DBUILD_EXAMPLE=models_loading_gltf

Making a change to the core Raylib library will cause all of the examples to rebuild which can take a long time. This would be a helpful timesaver to contributors who use CMake through the terminal, or with an IDE like VSCode or Neovim etc. rather than using the Visual Studio solution.

@raysan5 raysan5 merged commit c1fd985 into raysan5:master Apr 17, 2024
14 checks passed
@raysan5
Copy link
Owner

raysan5 commented Apr 17, 2024

@benjitrosch Nice improvement! Also supported by default Makefile.

@Peter0x44
Copy link
Contributor

I can't help but feel there has to be a better way to implement this in cmake

@benjitrosch
Copy link
Contributor Author

@Peter0x44 what did you have in mind?

@Peter0x44
Copy link
Contributor

This commit is not needed, and probably should be reverted.
This already works likeso:

$ cmake --build . -t core_basic_window
[ 85%] Built target glfw
[ 85%] Building C object raylib/CMakeFiles/raylib.dir/rtextures.c.o
[ 85%] Linking C static library libraylib.a
[100%] Built target raylib
[100%] Linking C executable core_basic_window
[100%] Built target core_basic_window

You can pick a specific target and it will rebuild only that target and its dependencies.
This option is not necessary or useful.

benjitrosch added a commit to benjitrosch/raylib that referenced this pull request Apr 19, 2024
@raysan5
Copy link
Owner

raysan5 commented Apr 19, 2024

@Peter0x44 Oh! Thanks for investigating this improvement!

raysan5 pushed a commit that referenced this pull request Apr 19, 2024
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

Successfully merging this pull request may close these issues.

3 participants