vcpkg/ports/capstone/portfile.cmake
Jia Yue Hua a317017c00
[capstone] update to 5.0.1 (#34076)
* [capstone] update to 5.0.1

* [capstone] update to 5.0.1
2023-09-28 22:38:12 -07:00

47 lines
1.5 KiB
CMake

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO "capstone-engine/capstone"
REF "${VERSION}"
SHA512 350aba77ce2d96b5c25764913591ba80e4497177ae0a8b2c820c6755ee8310848fbfc54e7ccac27fafc2dbc6778118ad92c53d1b5cb601d4fa146dec7d7e11e5
HEAD_REF next
PATCHES
001-silence-windows-crt-secure-warnings.patch
)
string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" STATIC_CRT)
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
"arm" CAPSTONE_ARM_SUPPORT
"arm64" CAPSTONE_ARM64_SUPPORT
"evm" CAPSTONE_EVM_SUPPORT
"m680x" CAPSTONE_M680X_SUPPORT
"m68k" CAPSTONE_M68K_SUPPORT
"mips" CAPSTONE_MIPS_SUPPORT
"ppc" CAPSTONE_PPC_SUPPORT
"sparc" CAPSTONE_SPARC_SUPPORT
"sysz" CAPSTONE_SYSZ_SUPPORT
"tms320c64x" CAPSTONE_TMS320C64X_SUPPORT
"x86" CAPSTONE_X86_SUPPORT
"xcore" CAPSTONE_XCORE_SUPPORT
"diet" CAPSTONE_BUILD_DIET
)
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DCAPSTONE_BUILD_TESTS=OFF
-DCAPSTONE_BUILD_CSTOOL=OFF
-DCAPSTONE_BUILD_STATIC_RUNTIME=${STATIC_CRT}
${FEATURE_OPTIONS}
)
vcpkg_cmake_install()
vcpkg_copy_pdbs()
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/${PORT})
vcpkg_fixup_pkgconfig()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(INSTALL "${SOURCE_PATH}/LICENSE.TXT" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)