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 <cwallez@chromium.org>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
This commit is contained in:
Corentin Wallez 2020-10-20 14:26:10 +00:00 committed by Commit Bot service account
parent c4593127cb
commit e557087870
2 changed files with 4 additions and 3 deletions

View File

@ -40,7 +40,6 @@ set(DAWN_GENERATOR_DIR "${Dawn_SOURCE_DIR}/generator")
set(DAWN_SRC_DIR "${Dawn_SOURCE_DIR}/src") set(DAWN_SRC_DIR "${Dawn_SOURCE_DIR}/src")
set(DAWN_INCLUDE_DIR "${DAWN_SRC_DIR}/include") set(DAWN_INCLUDE_DIR "${DAWN_SRC_DIR}/include")
set(DAWN_TEMPLATE_DIR "${DAWN_GENERATOR_DIR}/templates") 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") 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) 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_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_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") set(DAWN_GLSLANG_DIR "${DAWN_THIRD_PARTY_DIR}/glslang" CACHE STRING "Directory in which to find GLSLang")

View File

@ -62,7 +62,7 @@ function(DawnGenerator)
RESULT_VARIABLE RET RESULT_VARIABLE RET
) )
if (NOT RET EQUAL 0) 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() endif()
# Ask CMake to re-run if any of the dependencies changed as it might modify the build graph. # 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 RESULT_VARIABLE RET
) )
if (NOT RET EQUAL 0) 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() endif()
# Add the custom command that calls the generator. # Add the custom command that calls the generator.