aboutsummaryrefslogtreecommitdiff
path: root/ports
diff options
context:
space:
mode:
authorJack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>2021-07-29 12:51:34 +0800
committerGitHub <noreply@github.com>2021-07-28 21:51:34 -0700
commit8dddc6c899ce6fdbeab38b525a31e7f23cb2d5bb (patch)
tree3fbc21e46bda3cc49df82aa512e752e0975d46a6 /ports
parent850662ca65e3cdb2f968021482b2f8d4bf924dba (diff)
downloadvcpkg-8dddc6c899ce6fdbeab38b525a31e7f23cb2d5bb.tar.gz
vcpkg-8dddc6c899ce6fdbeab38b525a31e7f23cb2d5bb.zip
[vcpkg baseline][easyhook] Remove mismatch prebuild library after build (#19216)
* [easyhook] Remove mismatch prebuild library after build * version * update baseline * Update ports/easyhook/portfile.cmake Co-authored-by: Phoebe <20694052+PhoebeHui@users.noreply.github.com> * Update ports/easyhook/vcpkg.json * Update versions/e-/easyhook.json * Update versions/e-/easyhook.json Co-authored-by: Phoebe <20694052+PhoebeHui@users.noreply.github.com>
Diffstat (limited to 'ports')
-rw-r--r--ports/easyhook/CONTROL5
-rw-r--r--ports/easyhook/portfile.cmake48
-rw-r--r--ports/easyhook/vcpkg.json8
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)"
+}