vcpkg/ports/shader-slang/portfile.cmake

107 lines
5.3 KiB
CMake
Raw Normal View History

Add vcpkg_minimum_required before using VERSION. (#27598) * When @BillyONeal started being the on-call vcpkg maintainer on 2022-10-17, he started applying use of the "embedded VERSION" feature https://github.com/microsoft/vcpkg-tool/pull/717 to PRs on merge. @dg0yt points out that this use should be accompanied by a call to vcpkg_minimum_required, in https://github.com/microsoft/vcpkg/pull/27594/files#r1010641672 This is an audit of everything merged in that time and whether it needs to gain that. https://github.com/microsoft/vcpkg/pull/27561 No VERSION https://github.com/microsoft/vcpkg/pull/27525 No VERSION https://github.com/microsoft/vcpkg/pull/27554 Already has vcpkg_minimum_required https://github.com/microsoft/vcpkg/pull/27536 No VERSION https://github.com/microsoft/vcpkg/pull/27562 No VERSION https://github.com/microsoft/vcpkg/pull/24914 Fixed here https://github.com/microsoft/vcpkg/pull/27547 No VERSION https://github.com/microsoft/vcpkg/pull/27502 No VERSION https://github.com/microsoft/vcpkg/pull/27497 No VERSION https://github.com/microsoft/vcpkg/pull/27317 No VERSION https://github.com/microsoft/vcpkg/pull/27288 No VERSION https://github.com/microsoft/vcpkg/pull/27509 No VERSION https://github.com/microsoft/vcpkg/pull/27504 No VERSION https://github.com/microsoft/vcpkg/pull/27514 No VERSION https://github.com/microsoft/vcpkg/pull/27501 No VERSION https://github.com/microsoft/vcpkg/pull/27495 No VERSION https://github.com/microsoft/vcpkg/pull/27488 No VERSION https://github.com/microsoft/vcpkg/pull/27499 No VERSION https://github.com/microsoft/vcpkg/pull/27378 No VERSION https://github.com/microsoft/vcpkg/pull/27376 Fixed here https://github.com/microsoft/vcpkg/pull/27373 No VERSION https://github.com/microsoft/vcpkg/pull/27045 No VERSION https://github.com/microsoft/vcpkg/pull/27521 No VERSION https://github.com/microsoft/vcpkg/pull/27453 No VERSION https://github.com/microsoft/vcpkg/pull/27481 No VERSION https://github.com/microsoft/vcpkg/pull/27511 No VERSION https://github.com/microsoft/vcpkg/pull/27490 No VERSION https://github.com/microsoft/vcpkg/pull/27510 No VERSION https://github.com/microsoft/vcpkg/pull/27496 No VERSION https://github.com/microsoft/vcpkg/pull/27503 No VERSION https://github.com/microsoft/vcpkg/pull/27485 No VERSION https://github.com/microsoft/vcpkg/pull/27484 No VERSION https://github.com/microsoft/vcpkg/pull/27483 No VERSION https://github.com/microsoft/vcpkg/pull/27459 No VERSION https://github.com/microsoft/vcpkg/pull/27369 No VERSION https://github.com/microsoft/vcpkg/pull/27489 No VERSION https://github.com/microsoft/vcpkg/pull/26594 No VERSION https://github.com/microsoft/vcpkg/pull/27465 No VERSION https://github.com/microsoft/vcpkg/pull/27456 No VERSION https://github.com/microsoft/vcpkg/pull/27425 No VERSION https://github.com/microsoft/vcpkg/pull/27464 Fixed here https://github.com/microsoft/vcpkg/pull/27406 No VERSION https://github.com/microsoft/vcpkg/pull/27398 No VERSION https://github.com/microsoft/vcpkg/pull/27240 No VERSION https://github.com/microsoft/vcpkg/pull/27450 No VERSION https://github.com/microsoft/vcpkg/pull/27463 No VERSION https://github.com/microsoft/vcpkg/pull/27462 No VERSION https://github.com/microsoft/vcpkg/pull/27448 No VERSION https://github.com/microsoft/vcpkg/pull/27440 No VERSION https://github.com/microsoft/vcpkg/pull/27435 No VERSION https://github.com/microsoft/vcpkg/pull/27424 No VERSION https://github.com/microsoft/vcpkg/pull/27414 No VERSION https://github.com/microsoft/vcpkg/pull/27412 No VERSION https://github.com/microsoft/vcpkg/pull/27380 No VERSION https://github.com/microsoft/vcpkg/pull/27343 No VERSION https://github.com/microsoft/vcpkg/pull/27342 No VERSION https://github.com/microsoft/vcpkg/pull/27367 No VERSION https://github.com/microsoft/vcpkg/pull/27226 No VERSION https://github.com/microsoft/vcpkg/pull/27320 No VERSION https://github.com/microsoft/vcpkg/pull/26923 No VERSION https://github.com/microsoft/vcpkg/pull/27284 No VERSION https://github.com/microsoft/vcpkg/pull/27433 No VERSION https://github.com/microsoft/vcpkg/pull/27314 VERSION got *removed* https://github.com/microsoft/vcpkg/pull/27335 No VERSION https://github.com/microsoft/vcpkg/pull/27370 No VERSION https://github.com/microsoft/vcpkg/pull/27324 No VERSION https://github.com/microsoft/vcpkg/pull/27391 No VERSION https://github.com/microsoft/vcpkg/pull/27388 No VERSION https://github.com/microsoft/vcpkg/pull/27396 No VERSION https://github.com/microsoft/vcpkg/pull/27404 No VERSION https://github.com/microsoft/vcpkg/pull/27413 No VERSION https://github.com/microsoft/vcpkg/pull/27417 No VERSION https://github.com/microsoft/vcpkg/pull/27427 No VERSION https://github.com/microsoft/vcpkg/pull/27428 No VERSION https://github.com/microsoft/vcpkg/pull/27368 No VERSION https://github.com/microsoft/vcpkg/pull/27307 No VERSION https://github.com/microsoft/vcpkg/pull/27415 Fixed here. https://github.com/microsoft/vcpkg/pull/27371 Fixed here. https://github.com/microsoft/vcpkg/pull/27323 No VERSION https://github.com/microsoft/vcpkg/pull/27352 No VERSION https://github.com/microsoft/vcpkg/pull/27347 No VERSION https://github.com/microsoft/vcpkg/pull/27366 No VERSION https://github.com/microsoft/vcpkg/pull/27361 No VERSION https://github.com/microsoft/vcpkg/pull/27359 No VERSION https://github.com/microsoft/vcpkg/pull/27358 No VERSION https://github.com/microsoft/vcpkg/pull/27355 No VERSION https://github.com/microsoft/vcpkg/pull/27331 No VERSION https://github.com/microsoft/vcpkg/pull/24615 No VERSION https://github.com/microsoft/vcpkg/pull/27325 No VERSION https://github.com/microsoft/vcpkg/pull/24861 No VERSION https://github.com/microsoft/vcpkg/pull/27354 No VERSION https://github.com/microsoft/vcpkg/pull/27346 No VERSION https://github.com/microsoft/vcpkg/pull/27345 No VERSION https://github.com/microsoft/vcpkg/pull/27218 No VERSION https://github.com/microsoft/vcpkg/pull/27329 No VERSION https://github.com/microsoft/vcpkg/pull/27326 No VERSION https://github.com/microsoft/vcpkg/pull/27321 No VERSION https://github.com/microsoft/vcpkg/pull/27312 No VERSION https://github.com/microsoft/vcpkg/pull/27297 No VERSION https://github.com/microsoft/vcpkg/pull/27336 No VERSION https://github.com/microsoft/vcpkg/pull/27225 No VERSION https://github.com/microsoft/vcpkg/pull/27339 No VERSION https://github.com/microsoft/vcpkg/pull/27302 No VERSION https://github.com/microsoft/vcpkg/pull/27295 No VERSION https://github.com/microsoft/vcpkg/pull/27233 No VERSION https://github.com/microsoft/vcpkg/pull/27313 No VERSION https://github.com/microsoft/vcpkg/pull/27237 No VERSION https://github.com/microsoft/vcpkg/pull/27250 No VERSION https://github.com/microsoft/vcpkg/pull/27263 No VERSION https://github.com/microsoft/vcpkg/pull/27266 No VERSION https://github.com/microsoft/vcpkg/pull/27272 No VERSION https://github.com/microsoft/vcpkg/pull/27287 No VERSION https://github.com/microsoft/vcpkg/pull/27282 No VERSION https://github.com/microsoft/vcpkg/pull/27294 No VERSION https://github.com/microsoft/vcpkg/pull/27228 No VERSION https://github.com/microsoft/vcpkg/pull/27163 No VERSION https://github.com/microsoft/vcpkg/pull/26817 No VERSION https://github.com/microsoft/vcpkg/pull/27286 No VERSION https://github.com/microsoft/vcpkg/pull/27274 No VERSION https://github.com/microsoft/vcpkg/pull/27276 No VERSION https://github.com/microsoft/vcpkg/pull/27232 No VERSION https://github.com/microsoft/vcpkg/pull/27221 No VERSION https://github.com/microsoft/vcpkg/pull/27215 No VERSION https://github.com/microsoft/vcpkg/pull/27166 No VERSION https://github.com/microsoft/vcpkg/pull/27239 No VERSION https://github.com/microsoft/vcpkg/pull/27246 No VERSION https://github.com/microsoft/vcpkg/pull/27268 No VERSION https://github.com/microsoft/vcpkg/pull/27259 No VERSION https://github.com/microsoft/vcpkg/pull/27238 No VERSION https://github.com/microsoft/vcpkg/pull/27224 No VERSION https://github.com/microsoft/vcpkg/pull/27203 No VERSION https://github.com/microsoft/vcpkg/pull/27124 No VERSION * Also add libcanberra
2022-11-09 06:49:28 +08:00
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)