aboutsummaryrefslogtreecommitdiff
path: root/ports
diff options
context:
space:
mode:
authorNancyLi1013 <46708020+NancyLi1013@users.noreply.github.com>2021-08-12 08:18:20 +0800
committerGitHub <noreply@github.com>2021-08-11 17:18:20 -0700
commitc315cf92f7e9ca1247c839106abd49cf5fb6a6eb (patch)
tree738f19473d865ed9fdecd3c5c0e46767b53f4b3c /ports
parent53204fc2fb53125039709eaabf9b006f01a5d494 (diff)
downloadvcpkg-c315cf92f7e9ca1247c839106abd49cf5fb6a6eb.tar.gz
vcpkg-c315cf92f7e9ca1247c839106abd49cf5fb6a6eb.zip
[keystone] Fix static build with dynamic CRT on Windows (#19491)
* [keystone] Fix static build with dynamic CRT on Windows * Add port-version * Update version files * Add double quotes for the path * Update versions/k-/keystone.json * Add comments for kstool * Update versions/k-/keystone.json
Diffstat (limited to 'ports')
-rw-r--r--ports/keystone/CONTROL3
-rw-r--r--ports/keystone/portfile.cmake40
-rw-r--r--ports/keystone/vcpkg.json14
3 files changed, 32 insertions, 25 deletions
diff --git a/ports/keystone/CONTROL b/ports/keystone/CONTROL
deleted file mode 100644
index cc2c01c2f..000000000
--- a/ports/keystone/CONTROL
+++ /dev/null
@@ -1,3 +0,0 @@
-Source: keystone
-Version: 0.9.2
-Description: Lightweight multi-platform, multi-architecture assembler framework
diff --git a/ports/keystone/portfile.cmake b/ports/keystone/portfile.cmake
index f75cfeeea..6a6e25690 100644
--- a/ports/keystone/portfile.cmake
+++ b/ports/keystone/portfile.cmake
@@ -1,3 +1,5 @@
+vcpkg_fail_port_install(ON_TARGET "uwp")
+
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO keystone-engine/keystone
@@ -8,43 +10,37 @@ vcpkg_from_github(
vcpkg_find_acquire_program(PYTHON2)
-string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" KEYSTONE_BUILD_STATIC)
-string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" KEYSTONE_BUILD_SHARED)
+string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" KEYSTONE_BUILD_STATIC_RUNTIME)
-vcpkg_configure_cmake(
- SOURCE_PATH ${SOURCE_PATH}
- PREFER_NINJA
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
- -DKEYSTONE_BUILD_STATIC=${KEYSTONE_BUILD_STATIC}
- -DKEYSTONE_BUILD_SHARED=${KEYSTONE_BUILD_SHARED}
+ -DKEYSTONE_BUILD_STATIC_RUNTIME=${KEYSTONE_BUILD_STATIC_RUNTIME}
-DPYTHON_EXECUTABLE=${PYTHON2}
# Add support for only a subset of architectures
#-DLLVM_TARGETS_TO_BUILD="AArch64;X86"
)
-vcpkg_install_cmake()
+vcpkg_cmake_install()
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()
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
- file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
+ #For windows, do not build kstool if building DLL https://github.com/keystone-engine/keystone/blob/master/CMakeLists.txt#L74
+ vcpkg_copy_tools(TOOL_NAMES kstool AUTO_CLEAN)
else()
# Move DLLs
- file(GLOB DLLS ${CURRENT_PACKAGES_DIR}/lib/*.dll)
- file(COPY ${DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/bin)
+ file(GLOB DLLS "${CURRENT_PACKAGES_DIR}/lib/*.dll")
+ file(COPY ${DLLS} DESTINATION "${CURRENT_PACKAGES_DIR}/bin")
file(REMOVE ${DLLS})
- file(GLOB DLLS ${CURRENT_PACKAGES_DIR}/debug/lib/*.dll)
- file(COPY ${DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin)
+ file(GLOB DLLS "${CURRENT_PACKAGES_DIR}/debug/lib/*.dll")
+ file(COPY ${DLLS} DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin")
file(REMOVE ${DLLS})
endif()
+vcpkg_fixup_pkgconfig()
+
# Handle copyright
-file(INSTALL ${SOURCE_PATH}/COPYING
- DESTINATION ${CURRENT_PACKAGES_DIR}/share/keystone
- RENAME copyright
-)
+file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) \ No newline at end of file
diff --git a/ports/keystone/vcpkg.json b/ports/keystone/vcpkg.json
new file mode 100644
index 000000000..62827d58e
--- /dev/null
+++ b/ports/keystone/vcpkg.json
@@ -0,0 +1,14 @@
+{
+ "name": "keystone",
+ "version-semver": "0.9.2",
+ "port-version": 1,
+ "description": "A Lightweight multi-platform, multi-architecture assembler framework.",
+ "homepage": "https://github.com/keystone-engine/keystone",
+ "supports": "!uwp",
+ "dependencies": [
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ }
+ ]
+}