mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-27 18:31:15 +08:00
107 lines
5.3 KiB
CMake
107 lines
5.3 KiB
CMake
vcpkg_minimum_required(VERSION 2022-10-12) # for ${VERSION}
|
|
vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)
|
|
|
|
if (VCPKG_TARGET_IS_WINDOWS)
|
|
set(SLANG_EXE_SUFFIX ".exe")
|
|
set(SLANG_LIB_PREFIX "")
|
|
set(SLANG_LIB_SUFFIX ".lib")
|
|
set(SLANG_DYNLIB_SUFFIX ".dll")
|
|
if (VCPKG_TARGET_ARCHITECTURE MATCHES "x64")
|
|
vcpkg_download_distfile(
|
|
ARCHIVE
|
|
URLS "https://github.com/shader-slang/slang/releases/download/v${VERSION}/slang-${VERSION}-win64.zip"
|
|
FILENAME "slang-${VERSION}-win64.zip"
|
|
SHA512 a3f9f1a30468588fc5706eacd3a4c2dc41b014a949b34fe8a16dc1a9a2cb3e85edfcabb46473a3599fe9cd95a2ca8cbae5ab39fdf626e6b5b614a94be48e6d4d
|
|
)
|
|
set(SLANG_BIN_PATH "bin/windows-x64/release")
|
|
elseif (VCPKG_TARGET_ARCHITECTURE MATCHES "x86")
|
|
vcpkg_download_distfile(
|
|
ARCHIVE
|
|
URLS "https://github.com/shader-slang/slang/releases/download/v${VERSION}/slang-${VERSION}-win32.zip"
|
|
FILENAME "slang-${VERSION}-win32.zip"
|
|
SHA512 06012d3d7004f0565cda01b11fd7236e6828a8ea79ca93ad05e3e1a3e35571daf2cd6558e096dfd97c46c23ce74b802d71287e02eec5d7951c18e16c6c635da6
|
|
)
|
|
set(SLANG_BIN_PATH "bin/windows-x86/release")
|
|
else()
|
|
message(FATAL_ERROR "Unsupported platform. Please implement me!")
|
|
endif()
|
|
elseif (VCPKG_TARGET_IS_OSX)
|
|
set(SLANG_EXE_SUFFIX "")
|
|
set(SLANG_LIB_PREFIX "lib")
|
|
set(SLANG_LIB_SUFFIX ".a")
|
|
set(SLANG_DYNLIB_SUFFIX ".dylib")
|
|
if (VCPKG_TARGET_ARCHITECTURE MATCHES "x64")
|
|
vcpkg_download_distfile(
|
|
ARCHIVE
|
|
URLS "https://github.com/shader-slang/slang/releases/download/v${VERSION}/slang-${VERSION}-macos-x64.zip"
|
|
FILENAME "slang-${VERSION}-macos-x64.zip"
|
|
SHA512 5914caa4ab9867fbceed6f0bb4f83f3b5400c05872baff40456460655efbdccb34b3590663f8ee80e953f3e584d0e729bc1da34ab8f80be33d1233ca4b043d71
|
|
)
|
|
set(SLANG_BIN_PATH "bin/macos-x64/release")
|
|
elseif (VCPKG_TARGET_ARCHITECTURE MATCHES "arm64")
|
|
vcpkg_download_distfile(
|
|
ARCHIVE
|
|
URLS "https://github.com/shader-slang/slang/releases/download/v${VERSION}/slang-${VERSION}-macos-aarch64.zip"
|
|
FILENAME "slang-${VERSION}-macos-aarch64.zip"
|
|
SHA512 9e792ba0dec87a892df566b48f4553691f20d48c74c7d111b93c6f55c83790a8857bd82c461746190d8507b4aef440aeadb267da9558692a6113cfda52d12c80
|
|
)
|
|
set(SLANG_BIN_PATH "bin/macos-aarch64/release")
|
|
else()
|
|
message(FATAL_ERROR "Unsupported platform. Please implement me!")
|
|
endif()
|
|
elseif(VCPKG_TARGET_IS_LINUX)
|
|
set(SLANG_EXE_SUFFIX "")
|
|
set(SLANG_LIB_PREFIX "lib")
|
|
set(SLANG_LIB_SUFFIX ".a")
|
|
set(SLANG_DYNLIB_SUFFIX ".so")
|
|
if (VCPKG_TARGET_ARCHITECTURE MATCHES "x64")
|
|
vcpkg_download_distfile(
|
|
ARCHIVE
|
|
URLS "https://github.com/shader-slang/slang/releases/download/v${VERSION}/slang-${VERSION}-linux-x86_64.tar.gz"
|
|
FILENAME "slang-${VERSION}-linux-x86_64.tar.gz"
|
|
SHA512 f6e3d49ddfdb79e0dc8183bd915ee4e2975428f1a6020498062cb54b0f078c86bcdc50d274c8ed22ba2f3ae823cb0b95d719a1067321fb0400c329f8c34149dd
|
|
)
|
|
set(SLANG_BIN_PATH "bin/linux-x64/release")
|
|
else()
|
|
message(FATAL_ERROR "Unsupported platform. Please implement me!")
|
|
endif()
|
|
else()
|
|
message(FATAL_ERROR "Unsupported platform. Please implement me!")
|
|
endif()
|
|
|
|
vcpkg_extract_source_archive(
|
|
BINDIST_PATH
|
|
ARCHIVE "${ARCHIVE}"
|
|
NO_REMOVE_ONE_LEVEL
|
|
)
|
|
|
|
file(INSTALL "${BINDIST_PATH}/${SLANG_BIN_PATH}/${SLANG_LIB_PREFIX}slang${SLANG_DYNLIB_SUFFIX}" DESTINATION "${CURRENT_PACKAGES_DIR}/bin")
|
|
file(INSTALL "${BINDIST_PATH}/${SLANG_BIN_PATH}/${SLANG_LIB_PREFIX}slang${SLANG_DYNLIB_SUFFIX}" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin")
|
|
file(INSTALL "${BINDIST_PATH}/${SLANG_BIN_PATH}/${SLANG_LIB_PREFIX}slang-llvm${SLANG_DYNLIB_SUFFIX}" DESTINATION "${CURRENT_PACKAGES_DIR}/bin")
|
|
file(INSTALL "${BINDIST_PATH}/${SLANG_BIN_PATH}/${SLANG_LIB_PREFIX}slang-llvm${SLANG_DYNLIB_SUFFIX}" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin")
|
|
file(INSTALL "${BINDIST_PATH}/${SLANG_BIN_PATH}/${SLANG_LIB_PREFIX}slang-glslang${SLANG_DYNLIB_SUFFIX}" DESTINATION "${CURRENT_PACKAGES_DIR}/bin")
|
|
file(INSTALL "${BINDIST_PATH}/${SLANG_BIN_PATH}/${SLANG_LIB_PREFIX}slang-glslang${SLANG_DYNLIB_SUFFIX}" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin")
|
|
file(INSTALL "${BINDIST_PATH}/${SLANG_BIN_PATH}/slangc${SLANG_EXE_SUFFIX}" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}")
|
|
|
|
if (VCPKG_TARGET_IS_WINDOWS)
|
|
file(INSTALL "${BINDIST_PATH}/${SLANG_BIN_PATH}/${SLANG_LIB_PREFIX}slang${SLANG_LIB_SUFFIX}" DESTINATION "${CURRENT_PACKAGES_DIR}/lib")
|
|
file(INSTALL "${BINDIST_PATH}/${SLANG_BIN_PATH}/${SLANG_LIB_PREFIX}slang${SLANG_LIB_SUFFIX}" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib")
|
|
file(INSTALL "${BINDIST_PATH}/${SLANG_BIN_PATH}/gfx${SLANG_LIB_SUFFIX}" DESTINATION "${CURRENT_PACKAGES_DIR}/lib")
|
|
file(INSTALL "${BINDIST_PATH}/${SLANG_BIN_PATH}/gfx${SLANG_LIB_SUFFIX}" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib")
|
|
file(INSTALL "${BINDIST_PATH}/${SLANG_BIN_PATH}/gfx${SLANG_DYNLIB_SUFFIX}" DESTINATION "${CURRENT_PACKAGES_DIR}/bin")
|
|
file(INSTALL "${BINDIST_PATH}/${SLANG_BIN_PATH}/gfx${SLANG_DYNLIB_SUFFIX}" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin")
|
|
endif()
|
|
|
|
file(GLOB HEADERS "${BINDIST_PATH}/*.h")
|
|
file(INSTALL ${HEADERS} DESTINATION "${CURRENT_PACKAGES_DIR}/include")
|
|
|
|
vcpkg_from_github(
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
REPO shader-slang/slang
|
|
REF v${VERSION}
|
|
SHA512 ddb50eb59bebbb826844c4831f721bb40e28edb64d37d7463afb68cd27b653d7d8e1776000eaf70f4b5a882182ac06fa233dfe51167c2a3d170df89987da2cc2
|
|
HEAD_REF master
|
|
)
|
|
|
|
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|