bkaradzic / bgfx.cmake

CMake build scripts for bgfx. Released under public domain.
Creative Commons Zero v1.0 Universal
200 stars 107 forks source link

examples-common project is added when BGFX_BUILD_EXAMPLES option is turned off. #224

Closed JimmyLord closed 4 months ago

JimmyLord commented 5 months ago

When adding bgfx to a new cmake project using the following:

option(BGFX_BUILD_TOOLS "" OFF)
option(BGFX_BUILD_EXAMPLES "" OFF)
option(BGFX_BUILD_TESTS "" OFF)
option(BGFX_INSTALL "" OFF)
option(BGFX_CUSTOM_TARGETS "" OFF)
add_subdirectory("Libraries/bgfx.cmake")

The examples-common project is still added to my solution.

This can be fixed by wrapping add_example( common ... ... ... ) in a if(BGFX_BUILD_EXAMPLES) block in the examples.cmake file.

bwrsandman commented 4 months ago

It's not only examples that link with examples common. Shaderc is in tools as one example.