vcpkg/ports/blend2d/portfile.cmake
2020-05-07 22:30:20 -07:00

63 lines
1.8 KiB
CMake

vcpkg_fail_port_install(ON_ARCH "arm" ON_TARGET "uwp")
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO blend2d/blend2d
REF 841360f653d8f2a749e40d4e31807dfac3d6df29
SHA512 4ea11a2b74aa824a92cdb221ef6d019218379639b0cb005294e95f51f88955e7ec4aba2c837ea756b118ae10280679b9ec6c9345e3b25ba08d7b6f935a85cf2b
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 80645e66a8ae85749937bda3b329388c8a76ea4c
SHA512 8e7b0aed14e8ce05e6e6b2eed77be23a81b9548a146aef187ac6beced3bc2a6cba92835718adb901a1ab983fab32f3e9f18061b157b2276bb1451a71ca1195b8
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()