diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/zydis | |
Diffstat (limited to 'vcpkg/ports/zydis')
| -rw-r--r-- | vcpkg/ports/zydis/portfile.cmake | 47 | ||||
| -rw-r--r-- | vcpkg/ports/zydis/vcpkg.json | 24 | ||||
| -rw-r--r-- | vcpkg/ports/zydis/zycore.patch | 14 |
3 files changed, 85 insertions, 0 deletions
diff --git a/vcpkg/ports/zydis/portfile.cmake b/vcpkg/ports/zydis/portfile.cmake new file mode 100644 index 0000000..ae0727e --- /dev/null +++ b/vcpkg/ports/zydis/portfile.cmake @@ -0,0 +1,47 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO zyantific/zydis + REF "v${VERSION}" + SHA512 177e84fedb3449e29ffb6c0b02a92066ba1aa8fb624facad5593902b8e08cb8ae0b20ff38c16987989c8e414d7484d09dab7917c00a8fe54aa9bab4bc90e275d + HEAD_REF master + PATCHES + zycore.patch +) + +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" ZYDIS_BUILD_SHARED_LIB) + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + tools ZYDIS_BUILD_TOOLS +) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + -DZYAN_SYSTEM_ZYCORE=ON + -DZYDIS_BUILD_SHARED_LIB=${ZYDIS_BUILD_SHARED_LIB} + -DZYDIS_BUILD_DOXYGEN=OFF + -DZYDIS_BUILD_EXAMPLES=OFF + -DZYDIS_BUILD_TESTS=OFF + ${FEATURE_OPTIONS} + OPTIONS_DEBUG + -DZYDIS_BUILD_TOOLS=OFF +) + +vcpkg_cmake_install() + +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/zydis) + +if ("tools" IN_LIST FEATURES) + vcpkg_copy_tools(TOOL_NAMES ZydisDisasm ZydisInfo AUTO_CLEAN) +endif() + +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/Zydis/Defines.h" "defined(ZYDIS_STATIC_BUILD)" "1") +endif() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +vcpkg_copy_pdbs() + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") diff --git a/vcpkg/ports/zydis/vcpkg.json b/vcpkg/ports/zydis/vcpkg.json new file mode 100644 index 0000000..fe30ac4 --- /dev/null +++ b/vcpkg/ports/zydis/vcpkg.json @@ -0,0 +1,24 @@ +{ + "name": "zydis", + "version-semver": "4.1.1", + "port-version": 1, + "description": "Fast and lightweight x86/x86-64 disassembler library.", + "homepage": "https://zydis.re", + "license": "MIT", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + }, + "zycore" + ], + "features": { + "tools": { + "description": "Builds zydis executables" + } + } +} diff --git a/vcpkg/ports/zydis/zycore.patch b/vcpkg/ports/zydis/zycore.patch new file mode 100644 index 0000000..503daa2 --- /dev/null +++ b/vcpkg/ports/zydis/zycore.patch @@ -0,0 +1,14 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 62d5de6..ee500c7 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -138,7 +138,8 @@ function (locate_zycore)
+ )
+ endfunction ()
+
+-locate_zycore()
++find_package(zycore CONFIG REQUIRED)
++add_library(Zycore ALIAS Zycore::Zycore)
+
+ # =============================================================================================== #
+ # Library configuration #
|