Skip to content

Commit

Permalink
Ensure skshaderc is executable
Browse files Browse the repository at this point in the history
  • Loading branch information
maluoi committed Mar 31, 2024
1 parent 7e0a82d commit 0b0ace6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions skshaderc/CMakeLists.distribute.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,17 @@ endif()
# Pick a shader compiler executable that works on our host platform
if (CMAKE_HOST_APPLE)
set(SKSHADERC_EXE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/tools/mac/skshaderc CACHE INTERNAL "")
file(CHMOD ${SKSHADERC_EXE_PATH} PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ)
elseif(CMAKE_HOST_WIN32 AND (CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "AMD64" OR CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "x86_64"))
set(SKSHADERC_EXE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/tools/win32_x64/skshaderc.exe CACHE INTERNAL "")
elseif(CMAKE_HOST_WIN32 AND CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "ARM64")
set(SKSHADERC_EXE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/tools/win32_arm64/skshaderc.exe CACHE INTERNAL "")
elseif(CMAKE_HOST_UNIX AND CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "x86_64")
set(SKSHADERC_EXE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/tools/linux_x64/skshaderc CACHE INTERNAL "")
file(CHMOD ${SKSHADERC_EXE_PATH} PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ)
elseif(CMAKE_HOST_UNIX AND (CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "aarch64" OR CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "arm64"))
set(SKSHADERC_EXE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/tools/linux_arm64/skshaderc CACHE INTERNAL "")
file(CHMOD ${SKSHADERC_EXE_PATH} PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ)
else()
message(FATAL_ERROR "No shader compiler available for this platform! (${CMAKE_HOST_SYSTEM} + ${CMAKE_HOST_SYSTEM_PROCESSOR}) skshaderc supports Windows, Linux, and MacOS with x64 and ARM64 architectures.")
endif()
Expand Down

0 comments on commit 0b0ace6

Please sign in to comment.