Improve error handling

This commit is contained in:
Georg Hagen
2025-12-09 02:36:11 +01:00
parent d5ffcc4c6e
commit a7a4a0aa48
2 changed files with 4 additions and 1 deletions

View File

@@ -2,5 +2,5 @@ execute_process(COMMAND "@BASH_EXECUTABLE@" CompileShaders.sh "@SHADER_OUTPUT_DE
WORKING_DIRECTORY "@SCRIPT_FOLDER@"
RESULT_VARIABLE res_var)
if(NOT "${res_var}" STREQUAL "0")
message(FATAL_ERROR "Failed to recompile shaders")
message(FATAL_ERROR "Failed to recompile shaders. Result: ${res_val}")
endif()

View File

@@ -15,6 +15,9 @@ if ("${BASH_EXECUTABLE}" STREQUAL "")
find_program(BASH_PROGRAM bash NO_CACHE REQUIRED)
set(BASH_EXECUTABLE ${BASH_PROGRAM} CACHE FILEPATH "Path to bash executable" FORCE)
endif()
if ("${BASH_EXECUTABLE}" STREQUAL "") # fallback to just bash and hope it works, this way at least we should get some proper error
set(BASH_EXECUTABLE "bash" CACHE FILEPATH "Path to bash executable" FORCE)
endif()
# go from openVulkano/OpenVulkanoCpp to openVulkano
cmake_path(GET CMAKE_CURRENT_SOURCE_DIR PARENT_PATH ROOT_FOLDER)
set(SCRIPT_FOLDER "${ROOT_FOLDER}/Scripts")