mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-26 09:31:08 +08:00
[unicorn] update version 2.1.1 (#42578)
This commit is contained in:
parent
be216000c5
commit
c368dabefa
@ -1,17 +1,17 @@
|
|||||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||||
index 4110ae5..a86b207 100644
|
index 3fcde11..1acc0b5 100644
|
||||||
--- a/CMakeLists.txt
|
--- a/CMakeLists.txt
|
||||||
+++ b/CMakeLists.txt
|
+++ b/CMakeLists.txt
|
||||||
@@ -109,7 +109,7 @@ if(MSVC)
|
@@ -128,7 +128,7 @@ if(MSVC)
|
||||||
add_compile_options($<$<COMPILE_LANGUAGE:C>:/wd4267>)
|
|
||||||
|
|
||||||
# handle msvcrt setting being passed in CMAKE_C_FLAGS
|
# handle msvcrt setting being passed in CMAKE_C_FLAGS
|
||||||
- if(DEFINED CMAKE_MSVC_RUNTIME_LIBRARY)
|
if(CMAKE_C_FLAGS MATCHES "[/-]M[TD]d?")
|
||||||
+ if(NOT CMAKE_MSVC_RUNTIME_LIBRARY)
|
# ensure CMAKE_MSVC_RUNTIME_LIBRARY is not already defined
|
||||||
# do not support other methods of setting this (it would be more conformant, tho)
|
- if(DEFINED CMAKE_MSVC_RUNTIME_LIBRARY)
|
||||||
message(FATAL_ERROR "please set msvcrt via CMAKE_C_FLAGS")
|
+ if(NOT CMAKE_MSVC_RUNTIME_LIBRARY)
|
||||||
endif()
|
message(FATAL_ERROR "please set the runtime library via either CMAKE_C_FLAGS or CMAKE_MSVC_RUNTIME_LIBRARY, not both")
|
||||||
@@ -1431,7 +1431,7 @@ if(UNICORN_BUILD_TESTS)
|
endif()
|
||||||
|
|
||||||
|
@@ -1486,7 +1486,7 @@ if(UNICORN_BUILD_TESTS)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
26
ports/unicorn/fix-msvc-shared.patch
Normal file
26
ports/unicorn/fix-msvc-shared.patch
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||||
|
index 1acc0b5..a4b70d4 100644
|
||||||
|
--- a/CMakeLists.txt
|
||||||
|
+++ b/CMakeLists.txt
|
||||||
|
@@ -1427,9 +1427,8 @@ endif()
|
||||||
|
if (BUILD_SHARED_LIBS)
|
||||||
|
if (MSVC)
|
||||||
|
# Avoid the import lib built by MVSC clash with our archive.
|
||||||
|
- set_target_properties(unicorn PROPERTIES ARCHIVE_OUTPUT_NAME "unicorn-import")
|
||||||
|
+ set_target_properties(unicorn PROPERTIES ARCHIVE_OUTPUT_NAME "unicorn")
|
||||||
|
endif()
|
||||||
|
- bundle_static_library(unicorn_static unicorn_archive unicorn)
|
||||||
|
else()
|
||||||
|
# Rename the "static" lib to avoid filename clash.
|
||||||
|
set_target_properties(unicorn PROPERTIES OUTPUT_NAME "unicorn-static")
|
||||||
|
@@ -1496,7 +1495,9 @@ if(UNICORN_INSTALL)
|
||||||
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
- install(FILES $<TARGET_FILE:unicorn_archive> DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||||
|
+ if(NOT(BUILD_SHARED_LIBS))
|
||||||
|
+ install(FILES $<TARGET_FILE:unicorn_archive> DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||||
|
+ endif()
|
||||||
|
install(FILES ${UNICORN_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/unicorn)
|
||||||
|
if (ATOMIC_LINKAGE_FIX)
|
||||||
|
set(ATOMIC_LINK_PKG_CONFIG " -latomic")
|
@ -1,32 +1,39 @@
|
|||||||
if(VCPKG_CRT_LINKAGE STREQUAL "dynamic" AND VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
|
||||||
message(FATAL_ERROR "unicorn can currently only be built with /MT or /MTd (static CRT linkage)")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Note: this is safe because unicorn is a C library and takes steps to avoid memory allocate/free across the DLL boundary.
|
|
||||||
set(VCPKG_CRT_LINKAGE "static")
|
|
||||||
|
|
||||||
vcpkg_from_github(
|
vcpkg_from_github(
|
||||||
OUT_SOURCE_PATH SOURCE_PATH
|
OUT_SOURCE_PATH SOURCE_PATH
|
||||||
REPO unicorn-engine/unicorn
|
REPO unicorn-engine/unicorn
|
||||||
REF "${VERSION}.post1"
|
REF "${VERSION}"
|
||||||
SHA512 8694d6bc92e3424a8ad050316413d53e56e0f55e7cad7517fb3e98e670a0f1768b060ead8f195da13607cec89a964364f05a8b9d0dc074f4ac5e51026f8343ad
|
SHA512 d6184b87a0fb729397ec2ac2cb8bfd9d10c9d4276e49efa681c66c7c54d1a325305a920332a708e68989cc299d0d1a543a1ceeaf552a9b44ec93084f7bf85ef2
|
||||||
HEAD_REF master
|
HEAD_REF master
|
||||||
PATCHES
|
PATCHES
|
||||||
fix-build.patch
|
fix-build.patch
|
||||||
|
fix-msvc-shared.patch
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(VCPKG_TARGET_IS_ANDROID)
|
||||||
|
vcpkg_replace_string("${SOURCE_PATH}/CMakeLists.txt"
|
||||||
|
"-lpthread"
|
||||||
|
" "
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(VCPKG_TARGET_IS_WINDOWS)
|
||||||
|
vcpkg_replace_string("${SOURCE_PATH}/CMakeLists.txt"
|
||||||
|
"-lpthread -lm"
|
||||||
|
" "
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
vcpkg_cmake_configure(
|
vcpkg_cmake_configure(
|
||||||
SOURCE_PATH "${SOURCE_PATH}"
|
SOURCE_PATH "${SOURCE_PATH}"
|
||||||
OPTIONS
|
OPTIONS
|
||||||
-DUNICORN_BUILD_TESTS=OFF
|
-DUNICORN_BUILD_TESTS=OFF
|
||||||
)
|
)
|
||||||
|
|
||||||
vcpkg_cmake_install()
|
vcpkg_cmake_install()
|
||||||
|
|
||||||
vcpkg_fixup_pkgconfig()
|
vcpkg_fixup_pkgconfig()
|
||||||
|
vcpkg_copy_pdbs()
|
||||||
|
|
||||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
||||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
||||||
|
|
||||||
# Handle copyright
|
|
||||||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
|
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
{
|
{
|
||||||
"name": "unicorn",
|
"name": "unicorn",
|
||||||
"version": "2.0.1",
|
"version": "2.1.1",
|
||||||
"description": "Unicorn is a lightweight multi-platform, multi-architecture CPU emulator framework",
|
"description": "Unicorn is a lightweight multi-platform, multi-architecture CPU emulator framework",
|
||||||
"homepage": "https://github.com/unicorn-engine/unicorn",
|
"homepage": "https://github.com/unicorn-engine/unicorn",
|
||||||
"license": "GPL-2.0-only",
|
"license": "GPL-2.0-only",
|
||||||
"supports": "windows & !uwp & !arm",
|
"supports": "!(arm & windows)",
|
||||||
"dependencies": [
|
"dependencies": [
|
||||||
{
|
{
|
||||||
"name": "vcpkg-cmake",
|
"name": "vcpkg-cmake",
|
||||||
|
10
scripts/test_ports/vcpkg-ci-unicorn/portfile.cmake
Normal file
10
scripts/test_ports/vcpkg-ci-unicorn/portfile.cmake
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
SET(VCPKG_POLICY_EMPTY_PACKAGE enabled)
|
||||||
|
|
||||||
|
vcpkg_find_acquire_program(PKGCONFIG)
|
||||||
|
|
||||||
|
vcpkg_cmake_configure(
|
||||||
|
SOURCE_PATH "${CURRENT_PORT_DIR}/project"
|
||||||
|
OPTIONS
|
||||||
|
"-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}"
|
||||||
|
)
|
||||||
|
vcpkg_cmake_build()
|
12
scripts/test_ports/vcpkg-ci-unicorn/project/CMakeLists.txt
Normal file
12
scripts/test_ports/vcpkg-ci-unicorn/project/CMakeLists.txt
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.5)
|
||||||
|
|
||||||
|
project(vcpkg-ci-unicorn C)
|
||||||
|
|
||||||
|
set(CMAKE_C_STANDARD 11)
|
||||||
|
|
||||||
|
find_package(PkgConfig REQUIRED)
|
||||||
|
pkg_check_modules(unicorn REQUIRED IMPORTED_TARGET unicorn)
|
||||||
|
|
||||||
|
add_executable(main main.c)
|
||||||
|
|
||||||
|
target_link_libraries(main PRIVATE PkgConfig::unicorn)
|
8
scripts/test_ports/vcpkg-ci-unicorn/project/main.c
Normal file
8
scripts/test_ports/vcpkg-ci-unicorn/project/main.c
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
#include <unicorn/unicorn.h>
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
uc_engine* uc;
|
||||||
|
uc_open(UC_ARCH_X86, UC_MODE_32, &uc);
|
||||||
|
return 0;
|
||||||
|
}
|
13
scripts/test_ports/vcpkg-ci-unicorn/vcpkg.json
Normal file
13
scripts/test_ports/vcpkg-ci-unicorn/vcpkg.json
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"name": "vcpkg-ci-unicorn",
|
||||||
|
"version-string": "ci",
|
||||||
|
"description": "Testing packages which provide unicorn",
|
||||||
|
"license": null,
|
||||||
|
"dependencies": [
|
||||||
|
"unicorn",
|
||||||
|
{
|
||||||
|
"name": "vcpkg-cmake",
|
||||||
|
"host": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -9217,7 +9217,7 @@
|
|||||||
"port-version": 0
|
"port-version": 0
|
||||||
},
|
},
|
||||||
"unicorn": {
|
"unicorn": {
|
||||||
"baseline": "2.0.1",
|
"baseline": "2.1.1",
|
||||||
"port-version": 0
|
"port-version": 0
|
||||||
},
|
},
|
||||||
"unicorn-lib": {
|
"unicorn-lib": {
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
{
|
{
|
||||||
"versions": [
|
"versions": [
|
||||||
|
{
|
||||||
|
"git-tree": "0fcc1642b22d697846278397e4993b115a0514b6",
|
||||||
|
"version": "2.1.1",
|
||||||
|
"port-version": 0
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"git-tree": "d1d99593115946401db9ccd090cd53dc8ae303ba",
|
"git-tree": "d1d99593115946401db9ccd090cd53dc8ae303ba",
|
||||||
"version": "2.0.1",
|
"version": "2.0.1",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user