diff options
Diffstat (limited to 'ports/easyhook')
| -rw-r--r-- | ports/easyhook/CONTROL | 5 | ||||
| -rw-r--r-- | ports/easyhook/portfile.cmake | 48 | ||||
| -rw-r--r-- | ports/easyhook/vcpkg.json | 8 |
3 files changed, 44 insertions, 17 deletions
diff --git a/ports/easyhook/CONTROL b/ports/easyhook/CONTROL deleted file mode 100644 index 077a5fb53..000000000 --- a/ports/easyhook/CONTROL +++ /dev/null @@ -1,5 +0,0 @@ -Source: easyhook
-Version: 2.7.6789.0
-Homepage: https://github.com/EasyHook/EasyHook
-Description: This project supports extending (hooking) unmanaged code (APIs) with pure managed ones, from within a fully managed environment on 32- or 64-bit Windows Vista x64, Windows Server 2008 x64, Windows 7, Windows 8.1, and Windows 10.
-Supports: windows
\ No newline at end of file diff --git a/ports/easyhook/portfile.cmake b/ports/easyhook/portfile.cmake index 2b142cd39..983c4a509 100644 --- a/ports/easyhook/portfile.cmake +++ b/ports/easyhook/portfile.cmake @@ -1,12 +1,6 @@ -if (NOT VCPKG_TARGET_IS_WINDOWS)
- message(FATAL_ERROR "easyhook only support windows.")
-endif()
-
-if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
- message(FATAL_ERROR "easyhook can only be built as dynamic library.")
-endif()
+vcpkg_fail_port_install(ON_TARGET "Linux" "OSX" "UWP" ON_ARCH "arm" ON_LIBRARY_LINKAGE "static")
-message(".Net framework 4.0 is required, please install it before install easyhook.")
+message(WARNING ".Net framework 4.0 is required, please install it before install easyhook.")
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
@@ -17,20 +11,50 @@ vcpkg_from_github( PATCHES fix-build.patch
)
+if (VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
+ set(BUILD_ARCH "Win32")
+elseif (VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
+ set(BUILD_ARCH "x64")
+else()
+ message(FATAL_ERROR "Unsupported architecture: ${VCPKG_TARGET_ARCHITECTURE}")
+endif()
+
vcpkg_install_msbuild(
SOURCE_PATH ${SOURCE_PATH}
PROJECT_SUBPATH EasyHook.sln
TARGET EasyHookDll
RELEASE_CONFIGURATION "netfx4-Release"
DEBUG_CONFIGURATION "netfx4-Debug"
+ PLATFORM ${BUILD_ARCH}
)
+# Remove the mismatch rebuild library
+if (VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
+ if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
+ file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/lib/AUX_ULIB_x64.LIB")
+ endif()
+ if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
+ file(REMOVE "${CURRENT_PACKAGES_DIR}/lib/AUX_ULIB_x64.LIB")
+ endif()
+elseif (VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
+ if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
+ file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/lib/AUX_ULIB_x86.LIB")
+ endif()
+ if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
+ file(REMOVE "${CURRENT_PACKAGES_DIR}/lib/AUX_ULIB_x86.LIB")
+ endif()
+endif()
+
# These libraries are useless, so remove.
-file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/EasyHook.dll ${CURRENT_PACKAGES_DIR}/bin/EasyHook.pdb)
-file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/EasyHook.dll ${CURRENT_PACKAGES_DIR}/debug/bin/EasyHook.pdb)
+if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
+ file(REMOVE "${CURRENT_PACKAGES_DIR}/bin/EasyHook.dll" "${CURRENT_PACKAGES_DIR}/bin/EasyHook.pdb")
+endif()
+if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
+ file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/bin/EasyHook.dll" "${CURRENT_PACKAGES_DIR}/debug/bin/EasyHook.pdb")
+endif()
# Install includes
-file(INSTALL ${SOURCE_PATH}/Public/easyhook.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/easyhook)
+file(INSTALL "${SOURCE_PATH}/Public/easyhook.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/easyhook")
# Handle copyright
-file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/easyhook RENAME copyright)
+file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
diff --git a/ports/easyhook/vcpkg.json b/ports/easyhook/vcpkg.json new file mode 100644 index 000000000..bac2a88d4 --- /dev/null +++ b/ports/easyhook/vcpkg.json @@ -0,0 +1,8 @@ +{ + "name": "easyhook", + "version": "2.7.6789.0", + "port-version": 1, + "description": "This project supports extending (hooking) unmanaged code (APIs) with pure managed ones, from within a fully managed environment on 32- or 64-bit Windows Vista x64, Windows Server 2008 x64, Windows 7, Windows 8.1, and Windows 10.", + "homepage": "https://github.com/EasyHook/EasyHook", + "supports": "windows & !(static | arm | uwp)" +} |
