aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2017-10-25 16:51:49 -0700
committerGitHub <noreply@github.com>2017-10-25 16:51:49 -0700
commite65ef659ccce2c81da1dbc5da335c908a52c6607 (patch)
tree5faf10e8499e8f14c2da8333088754fdcb5b7efa
parenteea8a63179648a21313328d2d38966cc4bc297e8 (diff)
parentf1dc231bc835f30dca1838d2ffc8646cc6ba0786 (diff)
downloadvcpkg-e65ef659ccce2c81da1dbc5da335c908a52c6607.tar.gz
vcpkg-e65ef659ccce2c81da1dbc5da335c908a52c6607.zip
Merge pull request #2040 from DanOlivier/Capstone
Adding Capstone port
-rw-r--r--ports/capstone/CONTROL3
-rw-r--r--ports/capstone/portfile.cmake51
2 files changed, 54 insertions, 0 deletions
diff --git a/ports/capstone/CONTROL b/ports/capstone/CONTROL
new file mode 100644
index 000000000..b442eccd9
--- /dev/null
+++ b/ports/capstone/CONTROL
@@ -0,0 +1,3 @@
+Source: capstone
+Version: 3.0.5-rc3
+Description:
diff --git a/ports/capstone/portfile.cmake b/ports/capstone/portfile.cmake
new file mode 100644
index 000000000..430638322
--- /dev/null
+++ b/ports/capstone/portfile.cmake
@@ -0,0 +1,51 @@
+include(vcpkg_common_functions)
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REF 3.0.5-rc3
+ REPO "aquynh/capstone"
+ SHA512 1327fc570fc2310f71c4d7329528c05e30b9ad68ea50254b9a8c4b3b113f5165c2e0474ec99bbe1e6e46f2820379f388e4c2082c156027e117d88a8f1908acfe
+ HEAD_REF master
+)
+
+string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" CAPSTONE_BUILD_STATIC)
+string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" CAPSTONE_BUILD_SHARED)
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
+ OPTIONS
+ -DCAPSTONE_BUILD_STATIC=${CAPSTONE_BUILD_STATIC}
+ -DCAPSTONE_BUILD_SHARED=${CAPSTONE_BUILD_SHARED}
+
+ #-DCAPSTONE_ARCHS="x86"
+ -DCAPSTONE_X86_SUPPORT=ON
+ -DCAPSTONE_ARM_SUPPORT=ON
+ -DCAPSTONE_ARM64_SUPPORT=ON
+ -DCAPSTONE_MIPS_SUPPORT=OFF
+ -DCAPSTONE_PPC_SUPPORT=OFF
+ -DCAPSTONE_SPARC_SUPPORT=OFF
+ -DCAPSTONE_SYSZ_SUPPORT=OFF
+ -DCAPSTONE_XCORE_SUPPORT=OFF
+
+ -DCAPSTONE_BUILD_TESTS=OFF
+ OPTIONS_RELEASE
+ -DCAPSTONE_BUILD_DIET=ON
+ -DCAPSTONE_X86_REDUCE=ON
+)
+
+vcpkg_install_cmake()
+vcpkg_copy_pdbs()
+
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
+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()
+
+# Handle copyright
+file(INSTALL ${SOURCE_PATH}/LICENSE.txt
+ DESTINATION ${CURRENT_PACKAGES_DIR}/share/capstone
+ RENAME copyright)