2022-11-09 06:49:28 +08:00
|
|
|
vcpkg_minimum_required(VERSION 2022-10-12) # for ${VERSION}
|
2022-11-01 04:48:20 +08:00
|
|
|
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 b7fb926426ee4ccd9e38ce1cb1b54b3034eeefbd38dbfba56d1559f9ff286521b4029ef411ecc8190ba426def2e775c4b747fb3eb8491bf7118d167185f65bbc
|
|
|
|
)
|
|
|
|
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 a42639e500e63a8fb9e18074c5d04671f6a2d871db03d2e99b48ec0bb46f6a80a75a8bf6fc3a8eed2b72505311b665dcd55e99b5305baedcc2a0f212ca32b770
|
|
|
|
)
|
|
|
|
set(SLANG_BIN_PATH "bin/windows-x86/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 77806dc15131d9360cf80c7cc274637fe54cf0147482ba6ac1e49094c05d7ad91716fd6fdcc2fe2e02265913b0b8bc72137d1e8092f4341eff61758f88291c38
|
|
|
|
)
|
|
|
|
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 d02e166c694c46df8402f94b3f117d04494465ffa2cf636913ddced6f6a614547032c78408d87b79eb5d9de14b97cf8d17087a41c7d038c546b9a294e7a1f3d7
|
|
|
|
HEAD_REF master
|
|
|
|
)
|
|
|
|
|
|
|
|
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|