summaryrefslogtreecommitdiffstats
path: root/CMakeModules
diff options
context:
space:
mode:
authorFeng Chen <chen.feng@glority.cn>2023-08-17 03:17:56 +0200
committerFeng Chen <vonchenplus@gmail.com>2023-08-22 04:22:28 +0200
commit87022a4833fd693274275e1153d80d2e56fe0b11 (patch)
tree331327060ac062ec1584a0c86c7adbd5ccf436f1 /CMakeModules
parentMerge pull request #11287 from liamwhite/replaced-bytes (diff)
downloadyuzu-87022a4833fd693274275e1153d80d2e56fe0b11.tar
yuzu-87022a4833fd693274275e1153d80d2e56fe0b11.tar.gz
yuzu-87022a4833fd693274275e1153d80d2e56fe0b11.tar.bz2
yuzu-87022a4833fd693274275e1153d80d2e56fe0b11.tar.lz
yuzu-87022a4833fd693274275e1153d80d2e56fe0b11.tar.xz
yuzu-87022a4833fd693274275e1153d80d2e56fe0b11.tar.zst
yuzu-87022a4833fd693274275e1153d80d2e56fe0b11.zip
Diffstat (limited to 'CMakeModules')
-rw-r--r--CMakeModules/DownloadExternals.cmake18
1 files changed, 18 insertions, 0 deletions
diff --git a/CMakeModules/DownloadExternals.cmake b/CMakeModules/DownloadExternals.cmake
index 972f5ca74..a52148bd8 100644
--- a/CMakeModules/DownloadExternals.cmake
+++ b/CMakeModules/DownloadExternals.cmake
@@ -36,3 +36,21 @@ endif()
message(STATUS "Using bundled binaries at ${prefix}")
set(${prefix_var} "${prefix}" PARENT_SCOPE)
endfunction()
+
+function(download_moltenvk_external platform version)
+ set(MOLTENVK_DIR "${CMAKE_BINARY_DIR}/externals/MoltenVK")
+ set(MOLTENVK_TAR "${CMAKE_BINARY_DIR}/externals/MoltenVK.tar")
+ if (NOT EXISTS ${MOLTENVK_DIR})
+ if (NOT EXISTS ${MOLTENVK_TAR})
+ file(DOWNLOAD https://github.com/KhronosGroup/MoltenVK/releases/download/${version}/MoltenVK-${platform}.tar
+ ${MOLTENVK_TAR} SHOW_PROGRESS)
+ endif()
+
+ execute_process(COMMAND ${CMAKE_COMMAND} -E tar xf "${MOLTENVK_TAR}"
+ WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/externals")
+ endif()
+
+ # Add the MoltenVK library path to the prefix so find_library can locate it.
+ list(APPEND CMAKE_PREFIX_PATH "${MOLTENVK_DIR}/MoltenVK/dylib/${platform}")
+ set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} PARENT_SCOPE)
+endfunction()