From e557087870b0db11f232ce5825f88d8037e10e7c Mon Sep 17 00:00:00 2001 From: Corentin Wallez Date: Tue, 20 Oct 2020 14:26:10 +0000 Subject: [PATCH] CMakeLists: make DAWN_THIRD_PARTY_DIR an option. Also output more context when failing to run the code generator. Bug: None Change-Id: I6685c062a074ad11a8fd67f19b8698ce9bcf6694 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/30560 Commit-Queue: Corentin Wallez Commit-Queue: dan sinclair Reviewed-by: dan sinclair --- CMakeLists.txt | 3 ++- generator/CMakeLists.txt | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8394d031a3..2766db7b0f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,7 +40,6 @@ set(DAWN_GENERATOR_DIR "${Dawn_SOURCE_DIR}/generator") set(DAWN_SRC_DIR "${Dawn_SOURCE_DIR}/src") set(DAWN_INCLUDE_DIR "${DAWN_SRC_DIR}/include") set(DAWN_TEMPLATE_DIR "${DAWN_GENERATOR_DIR}/templates") -set(DAWN_THIRD_PARTY_DIR "${Dawn_SOURCE_DIR}/third_party") set(DAWN_DUMMY_FILE "${DAWN_SRC_DIR}/Dummy.cpp") @@ -75,6 +74,8 @@ option(DAWN_USE_X11 "Enable support for X11 surface" ${USE_X11}) option(DAWN_BUILD_EXAMPLES "Enables building Dawn's exmaples" ON) +set(DAWN_THIRD_PARTY_DIR "${Dawn_SOURCE_DIR}/third_party" CACHE STRING "Directory in which to find third-party dependencies.") + set(DAWN_GLFW_DIR "${DAWN_THIRD_PARTY_DIR}/glfw" CACHE STRING "Directory in which to find GLFW") set(DAWN_GLM_DIR "${DAWN_THIRD_PARTY_DIR}/glm" CACHE STRING "Directory in which to find GLM") set(DAWN_GLSLANG_DIR "${DAWN_THIRD_PARTY_DIR}/glslang" CACHE STRING "Directory in which to find GLSLang") diff --git a/generator/CMakeLists.txt b/generator/CMakeLists.txt index c21359c8dd..a2d67844ff 100644 --- a/generator/CMakeLists.txt +++ b/generator/CMakeLists.txt @@ -62,7 +62,7 @@ function(DawnGenerator) RESULT_VARIABLE RET ) if (NOT RET EQUAL 0) - message(FATAL_ERROR "Dawn: Failed to get the dependencies for ${G_PRINT_NAME}.") + message(FATAL_ERROR "Dawn: Failed to get the dependencies for ${G_PRINT_NAME}. Base args are '${BASE_ARGS}'.") endif() # Ask CMake to re-run if any of the dependencies changed as it might modify the build graph. @@ -77,7 +77,7 @@ function(DawnGenerator) RESULT_VARIABLE RET ) if (NOT RET EQUAL 0) - message(FATAL_ERROR "Dawn: Failed to get the outputs for ${G_PRINT_NAME}.") + message(FATAL_ERROR "Dawn: Failed to get the outputs for ${G_PRINT_NAME}. Base args are '${BASE_ARGS}'.") endif() # Add the custom command that calls the generator.