2017-10-24 01:06:32 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
2020-05-12 06:00:03 +08:00
|
|
|
REF 4.0.2
|
2017-10-24 01:06:32 +08:00
|
|
|
REPO "aquynh/capstone"
|
2020-05-12 06:00:03 +08:00
|
|
|
SHA512 7f93534517307b737422a8825b66b2a1f3e1cca2049465d60ab12595940154aaf843ba40ed348fce58de58b990c19a0caef289060eb72898cb008a88c470970e
|
2019-03-15 14:14:05 +08:00
|
|
|
HEAD_REF v4
|
2017-10-24 01:06:32 +08:00
|
|
|
)
|
|
|
|
|
2019-03-15 14:14:05 +08:00
|
|
|
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" CS_BUILD_STATIC)
|
|
|
|
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" CS_BUILD_SHARED)
|
|
|
|
|
|
|
|
|
|
|
|
function(check_feature name var)
|
|
|
|
set(${var} OFF PARENT_SCOPE)
|
|
|
|
if (${name} IN_LIST FEATURES)
|
|
|
|
set(${var} ON PARENT_SCOPE)
|
|
|
|
endif ()
|
|
|
|
endfunction ()
|
|
|
|
|
|
|
|
|
|
|
|
check_feature("arm" WITH_ARM_SUPPORT)
|
|
|
|
check_feature("arm64" WITH_ARM64_SUPPORT)
|
|
|
|
check_feature("evm" WITH_EVM_SUPPORT)
|
|
|
|
check_feature("m680x" WITH_M680X_SUPPORT)
|
|
|
|
check_feature("m68k" WITH_M68K_SUPPORT)
|
|
|
|
check_feature("mips" WITH_MIPS_SUPPORT)
|
|
|
|
check_feature("osxkernel" WITH_OSXKERNEL_SUPPORT)
|
|
|
|
check_feature("ppc" WITH_PPC_SUPPORT)
|
|
|
|
check_feature("sparc" WITH_SPARC_SUPPORT)
|
|
|
|
check_feature("sysz" WITH_SYSZ_SUPPORT)
|
|
|
|
check_feature("tms320c64x" WITH_C64X_SUPPORT)
|
|
|
|
check_feature("x86" WITH_X86_SUPPORT)
|
|
|
|
check_feature("x86_reduce" WITH_X86_REDUCE)
|
|
|
|
check_feature("xcore" WITH_XCORE_SUPPORT)
|
|
|
|
|
|
|
|
check_feature("diet" CS_BUILD_DIET)
|
|
|
|
|
|
|
|
if (WITH_X86_REDUCE AND NOT WITH_X86_SUPPORT)
|
|
|
|
set(WITH_X86_SUPPORT ON)
|
|
|
|
endif ()
|
2017-10-26 07:51:18 +08:00
|
|
|
|
2017-10-24 01:06:32 +08:00
|
|
|
vcpkg_configure_cmake(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
2017-10-26 07:51:18 +08:00
|
|
|
PREFER_NINJA
|
2017-10-24 01:06:32 +08:00
|
|
|
OPTIONS
|
2019-03-15 14:14:05 +08:00
|
|
|
-DCAPSTONE_BUILD_STATIC=${CS_BUILD_STATIC}
|
|
|
|
-DCAPSTONE_BUILD_SHARED=${CS_BUILD_SHARED}
|
|
|
|
-DCAPSTONE_BUILD_DIET=${CS_BUILD_DIET}
|
2017-10-24 01:06:32 +08:00
|
|
|
-DCAPSTONE_BUILD_TESTS=OFF
|
2019-03-15 14:14:05 +08:00
|
|
|
-DCAPSTONE_BUILD_CSTOOL=OFF
|
|
|
|
-DCAPSTONE_BUILD_STATIC_RUNTIME=OFF
|
|
|
|
|
|
|
|
-DCAPSTONE_ARM_SUPPORT=${WITH_ARM_SUPPORT}
|
|
|
|
-DCAPSTONE_ARM64_SUPPORT=${WITH_ARM64_SUPPORT}
|
|
|
|
-DCAPSTONE_EVM_SUPPORT=${WITH_EVM_SUPPORT}
|
|
|
|
-DCAPSTONE_M680X_SUPPORT=${WITH_M680X_SUPPORT}
|
|
|
|
-DCAPSTONE_M68K_SUPPORT=${WITH_M68K_SUPPORT}
|
|
|
|
-DCAPSTONE_MIPS_SUPPORT=${WITH_MIPS_SUPPORT}
|
|
|
|
-DCAPSTONE_OSXKERNEL_SUPPORT=${WITH_OSXKERNEL_SUPPORT}
|
|
|
|
-DCAPSTONE_PPC_SUPPORT=${WITH_PPC_SUPPORT}
|
|
|
|
-DCAPSTONE_SPARC_SUPPORT=${WITH_SPARC_SUPPORT}
|
|
|
|
-DCAPSTONE_SYSZ_SUPPORT=${WITH_SYSZ_SUPPORT}
|
|
|
|
-DCAPSTONE_TMS320C64X_SUPPORT=${WITH_C64X_SUPPORT}
|
|
|
|
-DCAPSTONE_X86_SUPPORT=${WITH_X86_SUPPORT}
|
|
|
|
-DCAPSTONE_XCORE_SUPPORT=${WITH_XCORE_SUPPORT}
|
|
|
|
|
|
|
|
-DCAPSTONE_X86_REDUCE=${WITH_X86_REDUCE}
|
|
|
|
-DCAPSTONE_X86_ONLY=OFF
|
2017-10-24 01:06:32 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_install_cmake()
|
2017-10-26 07:51:18 +08:00
|
|
|
vcpkg_copy_pdbs()
|
2017-10-24 01:06:32 +08:00
|
|
|
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
2017-10-26 07:51:18 +08:00
|
|
|
file(GLOB EXES ${CURRENT_PACKAGES_DIR}/bin/*.exe ${CURRENT_PACKAGES_DIR}/debug/bin/*.exe)
|
|
|
|
if(EXES)
|
|
|
|
file(REMOVE ${EXES})
|
|
|
|
endif()
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
|
|
|
|
endif()
|
2017-10-24 01:06:32 +08:00
|
|
|
|
|
|
|
# Handle copyright
|
2019-03-15 14:14:05 +08:00
|
|
|
file(INSTALL ${SOURCE_PATH}/LICENSE.TXT
|
|
|
|
DESTINATION ${CURRENT_PACKAGES_DIR}/share/capstone
|
2017-10-24 01:06:32 +08:00
|
|
|
RENAME copyright)
|