vcpkg/ports/blend2d/portfile.cmake
2020-08-05 14:05:58 -07:00

62 lines
1.8 KiB
CMake

vcpkg_fail_port_install(ON_ARCH "arm" ON_ARCH "wasm32" ON_TARGET "uwp")
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO blend2d/blend2d
REF ee5c52aa5fcaaf9910dd2ef566a741d998bdfb98
SHA512 e33e9418be13d239feb2a88d52538e0a86b920b9bcb0473ac21b27fbd54f7c683e23c1f8a6dbcbcf24fdc85bfc1b5884ebea4a9a5e4ec1fcfbfaa006807e3d59
HEAD_REF master
)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BLEND2D_STATIC)
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
INVERTED_FEATURES
jit BLEND2D_NO_JIT
logging BLEND2D_NO_JIT_LOGGING
tls BLEND2D_NO_TLS
)
if(NOT BLEND2D_BUILD_NO_JIT)
vcpkg_from_github(
OUT_SOURCE_PATH ASMJIT_SOURCE_PATH
REPO asmjit/asmjit
REF 8474400e82c3ea65bd828761539e5d9b25f6bd83
SHA512 435be4ed22abbbbcdea3869b31bc2fc27aae969775773c24155d7490bca9591f51613fa3319cce54200c6d18dbe73a6be2d5449c49afb46934d93760501e98f6
HEAD_REF master
)
file(REMOVE_RECURSE ${SOURCE_PATH}/3rdparty/asmjit)
get_filename_component(ASMJIT_SOURCE_DIR_NAME ${ASMJIT_SOURCE_PATH} NAME)
file(COPY ${ASMJIT_SOURCE_PATH} DESTINATION ${SOURCE_PATH}/3rdparty)
file(RENAME ${SOURCE_PATH}/3rdparty/${ASMJIT_SOURCE_DIR_NAME} ${SOURCE_PATH}/3rdparty/asmjit)
endif()
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DBLEND2D_STATIC=${BLEND2D_STATIC}
${FEATURE_OPTIONS}
)
vcpkg_install_cmake()
vcpkg_copy_pdbs()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
if(BLEND2D_STATIC)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
endif()
# Handle copyright
configure_file(${SOURCE_PATH}/LICENSE.md ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY)
if(BLEND2D_STATIC)
# Install usage
configure_file(${CMAKE_CURRENT_LIST_DIR}/usage ${CURRENT_PACKAGES_DIR}/share/${PORT}/usage @ONLY)
endif()