diff options
author | lat9nq <22451773+lat9nq@users.noreply.github.com> | 2021-02-02 01:36:10 +0100 |
---|---|---|
committer | lat9nq <22451773+lat9nq@users.noreply.github.com> | 2021-02-02 05:39:54 +0100 |
commit | fc43eac82aceacce0c08ab11bb70fdd91c91b923 (patch) | |
tree | 1b7ccf59454077a8e03216a81d4de89bc5290ece /src | |
parent | Merge pull request #5864 from MerryMage/is-thumb (diff) | |
download | yuzu-fc43eac82aceacce0c08ab11bb70fdd91c91b923.tar yuzu-fc43eac82aceacce0c08ab11bb70fdd91c91b923.tar.gz yuzu-fc43eac82aceacce0c08ab11bb70fdd91c91b923.tar.bz2 yuzu-fc43eac82aceacce0c08ab11bb70fdd91c91b923.tar.lz yuzu-fc43eac82aceacce0c08ab11bb70fdd91c91b923.tar.xz yuzu-fc43eac82aceacce0c08ab11bb70fdd91c91b923.tar.zst yuzu-fc43eac82aceacce0c08ab11bb70fdd91c91b923.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/video_core/host_shaders/CMakeLists.txt | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/video_core/host_shaders/CMakeLists.txt b/src/video_core/host_shaders/CMakeLists.txt index 73f331d4c..28f2b8614 100644 --- a/src/video_core/host_shaders/CMakeLists.txt +++ b/src/video_core/host_shaders/CMakeLists.txt @@ -20,6 +20,7 @@ set(SHADER_FILES find_program(GLSLANGVALIDATOR "glslangValidator" REQUIRED) set(GLSL_FLAGS "") +set(QUIET_FLAG "--quiet") set(SHADER_INCLUDE ${CMAKE_CURRENT_BINARY_DIR}/include) set(SHADER_DIR ${SHADER_INCLUDE}/video_core/host_shaders) @@ -28,6 +29,23 @@ set(HOST_SHADERS_INCLUDE ${SHADER_INCLUDE} PARENT_SCOPE) set(INPUT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/source_shader.h.in) set(HEADER_GENERATOR ${CMAKE_CURRENT_SOURCE_DIR}/StringShaderHeader.cmake) +# Check if `--quiet` is available on host's glslangValidator version +# glslangValidator prints to STDERR iff an unrecognized flag is passed to it +execute_process( + COMMAND + ${GLSLANGVALIDATOR} ${QUIET_FLAG} + ERROR_VARIABLE + GLSLANG_ERROR + # STDOUT variable defined to silence unnecessary output during CMake configuration + OUTPUT_VARIABLE + GLSLANG_OUTPUT +) + +if (NOT GLSLANG_ERROR STREQUAL "") + message(WARNING "Refusing to use unavailable flag `${QUIET_FLAG}` on `${GLSLANGVALIDATOR}`") + set(QUIET_FLAG "") +endif() + foreach(FILENAME IN ITEMS ${SHADER_FILES}) string(REPLACE "." "_" SHADER_NAME ${FILENAME}) set(SOURCE_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${FILENAME}) @@ -55,7 +73,7 @@ foreach(FILENAME IN ITEMS ${SHADER_FILES}) OUTPUT ${SPIRV_HEADER_FILE} COMMAND - ${GLSLANGVALIDATOR} -V --quiet ${GLSL_FLAGS} --variable-name ${SPIRV_VARIABLE_NAME} -o ${SPIRV_HEADER_FILE} ${SOURCE_FILE} + ${GLSLANGVALIDATOR} -V ${QUIET_FLAG} ${GLSL_FLAGS} --variable-name ${SPIRV_VARIABLE_NAME} -o ${SPIRV_HEADER_FILE} ${SOURCE_FILE} MAIN_DEPENDENCY ${SOURCE_FILE} ) |