From 0ecd67a3fa3a5d668197fd30ac3111625c9b12a0 Mon Sep 17 00:00:00 2001 From: Ben Clayton Date: Thu, 23 Sep 2021 20:13:53 +0000 Subject: [PATCH] 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 Reviewed-by: Corentin Wallez Commit-Queue: Ben Clayton --- third_party/CMakeLists.txt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt index a5e0a24ce3..c5e36cabd2 100644 --- a/third_party/CMakeLists.txt +++ b/third_party/CMakeLists.txt @@ -38,16 +38,16 @@ if (NOT TARGET SPIRV-Tools) add_subdirectory(${DAWN_SPIRV_TOOLS_DIR}) 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 (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) message(STATUS "Dawn: using GLM at ${DAWN_GLM_DIR}") add_subdirectory(${DAWN_GLM_DIR})