CMake: Fix build when DAWN_BUILD_EXAMPLES=0

glfw is used by several `src/utils/*.cpp` files, regardless of whether examples are being built or not.

Change-Id: Iba90fbf96e254979c72acf792af3cb86d889f5db
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64742
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
Ben Clayton 2021-09-23 20:13:53 +00:00 committed by Dawn LUCI CQ
parent 37126dd679
commit 0ecd67a3fa
1 changed files with 9 additions and 9 deletions

View File

@ -38,16 +38,16 @@ if (NOT TARGET SPIRV-Tools)
add_subdirectory(${DAWN_SPIRV_TOOLS_DIR}) add_subdirectory(${DAWN_SPIRV_TOOLS_DIR})
endif() endif()
if (NOT TARGET glfw)
set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE)
set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE)
set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
message(STATUS "Dawn: using GLFW at ${DAWN_GLFW_DIR}")
add_subdirectory(${DAWN_GLFW_DIR})
endif()
if (DAWN_BUILD_EXAMPLES) if (DAWN_BUILD_EXAMPLES)
if (NOT TARGET glfw)
set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE)
set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE)
set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
message(STATUS "Dawn: using GLFW at ${DAWN_GLFW_DIR}")
add_subdirectory(${DAWN_GLFW_DIR})
endif()
if (NOT TARGET glm) if (NOT TARGET glm)
message(STATUS "Dawn: using GLM at ${DAWN_GLM_DIR}") message(STATUS "Dawn: using GLM at ${DAWN_GLM_DIR}")
add_subdirectory(${DAWN_GLM_DIR}) add_subdirectory(${DAWN_GLM_DIR})