mirror of
https://github.com/nicbarker/clay.git
synced 2025-12-23 17:41:06 +00:00
Updated the CMakeLists.txt
This commit is contained in:
parent
6de8bfa4ae
commit
b0b336f987
|
|
@ -13,6 +13,13 @@ option(CLAY_INCLUDE_WIN32_GDI_EXAMPLES "Build Win32 GDI examples" OFF)
|
|||
option(CLAY_INCLUDE_SOKOL_EXAMPLES "Build Sokol examples" OFF)
|
||||
option(CLAY_INCLUDE_PLAYDATE_EXAMPLES "Build Playdate examples" OFF)
|
||||
|
||||
# Enable Vulkan demo by default when the Windows generator can see a Vulkan SDK installation.
|
||||
set(CLAY_INCLUDE_VULKAN_DEMO_DEFAULT OFF)
|
||||
if(WIN32 AND DEFINED ENV{VULKAN_SDK})
|
||||
set(CLAY_INCLUDE_VULKAN_DEMO_DEFAULT ON)
|
||||
endif()
|
||||
option(CLAY_INCLUDE_VULKAN_DEMO "Build Vulkan demo (requires Vulkan SDK)" ${CLAY_INCLUDE_VULKAN_DEMO_DEFAULT})
|
||||
|
||||
message(STATUS "CLAY_INCLUDE_DEMOS: ${CLAY_INCLUDE_DEMOS}")
|
||||
|
||||
if(APPLE)
|
||||
|
|
@ -44,6 +51,9 @@ if(CLAY_INCLUDE_ALL_EXAMPLES OR CLAY_INCLUDE_SOKOL_EXAMPLES)
|
|||
add_subdirectory("examples/sokol-video-demo")
|
||||
add_subdirectory("examples/sokol-corner-radius")
|
||||
endif()
|
||||
if(CLAY_INCLUDE_ALL_EXAMPLES OR CLAY_INCLUDE_VULAKN_EXAMPLES)
|
||||
add_subdirectory("examples/vulkan-demo")
|
||||
endif()
|
||||
|
||||
# Playdate example not included in ALL because users need to install the playdate SDK first which requires a license agreement
|
||||
if(CLAY_INCLUDE_PLAYDATE_EXAMPLES)
|
||||
|
|
|
|||
|
|
@ -8,14 +8,21 @@ include(FetchContent)
|
|||
set(FETCHCONTENT_QUIET FALSE)
|
||||
|
||||
# GLFW is used only for window creation and Vulkan surface management in this demo.
|
||||
FetchContent_Declare(
|
||||
# When other examples are enabled (e.g., raylib), GLFW may already be present via
|
||||
# their dependencies. Guarding the population prevents duplicate target errors
|
||||
# (CMP0002) while still reusing the existing GLFW target when available.
|
||||
if(NOT TARGET glfw)
|
||||
FetchContent_Declare(
|
||||
glfw
|
||||
GIT_REPOSITORY "https://github.com/glfw/glfw.git"
|
||||
GIT_TAG "3.4"
|
||||
GIT_PROGRESS TRUE
|
||||
GIT_SHALLOW TRUE
|
||||
)
|
||||
FetchContent_MakeAvailable(glfw)
|
||||
)
|
||||
FetchContent_MakeAvailable(glfw)
|
||||
else()
|
||||
message(STATUS "Reusing existing GLFW target for Vulkan demo")
|
||||
endif()
|
||||
|
||||
find_package(Vulkan REQUIRED)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue