[unicorn] update version 2.1.1 (#42578)

This commit is contained in:
Saikari 2024-12-17 23:10:21 +03:00 committed by GitHub
parent be216000c5
commit c368dabefa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 106 additions and 25 deletions

View File

@ -1,17 +1,17 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4110ae5..a86b207 100644
index 3fcde11..1acc0b5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -109,7 +109,7 @@ if(MSVC)
add_compile_options($<$<COMPILE_LANGUAGE:C>:/wd4267>)
@@ -128,7 +128,7 @@ if(MSVC)
# handle msvcrt setting being passed in CMAKE_C_FLAGS
- if(DEFINED CMAKE_MSVC_RUNTIME_LIBRARY)
+ if(NOT CMAKE_MSVC_RUNTIME_LIBRARY)
# do not support other methods of setting this (it would be more conformant, tho)
message(FATAL_ERROR "please set msvcrt via CMAKE_C_FLAGS")
endif()
@@ -1431,7 +1431,7 @@ if(UNICORN_BUILD_TESTS)
if(CMAKE_C_FLAGS MATCHES "[/-]M[TD]d?")
# ensure CMAKE_MSVC_RUNTIME_LIBRARY is not already defined
- if(DEFINED CMAKE_MSVC_RUNTIME_LIBRARY)
+ if(NOT CMAKE_MSVC_RUNTIME_LIBRARY)
message(FATAL_ERROR "please set the runtime library via either CMAKE_C_FLAGS or CMAKE_MSVC_RUNTIME_LIBRARY, not both")
endif()
@@ -1486,7 +1486,7 @@ if(UNICORN_BUILD_TESTS)
endif()

View 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")

View File

@ -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(
OUT_SOURCE_PATH SOURCE_PATH
REPO unicorn-engine/unicorn
REF "${VERSION}.post1"
SHA512 8694d6bc92e3424a8ad050316413d53e56e0f55e7cad7517fb3e98e670a0f1768b060ead8f195da13607cec89a964364f05a8b9d0dc074f4ac5e51026f8343ad
REF "${VERSION}"
SHA512 d6184b87a0fb729397ec2ac2cb8bfd9d10c9d4276e49efa681c66c7c54d1a325305a920332a708e68989cc299d0d1a543a1ceeaf552a9b44ec93084f7bf85ef2
HEAD_REF master
PATCHES
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(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DUNICORN_BUILD_TESTS=OFF
)
)
vcpkg_cmake_install()
vcpkg_fixup_pkgconfig()
vcpkg_copy_pdbs()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
# Handle copyright
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")

View File

@ -1,10 +1,10 @@
{
"name": "unicorn",
"version": "2.0.1",
"version": "2.1.1",
"description": "Unicorn is a lightweight multi-platform, multi-architecture CPU emulator framework",
"homepage": "https://github.com/unicorn-engine/unicorn",
"license": "GPL-2.0-only",
"supports": "windows & !uwp & !arm",
"supports": "!(arm & windows)",
"dependencies": [
{
"name": "vcpkg-cmake",

View 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()

View 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)

View 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;
}

View 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
}
]
}

View File

@ -9217,7 +9217,7 @@
"port-version": 0
},
"unicorn": {
"baseline": "2.0.1",
"baseline": "2.1.1",
"port-version": 0
},
"unicorn-lib": {

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "0fcc1642b22d697846278397e4993b115a0514b6",
"version": "2.1.1",
"port-version": 0
},
{
"git-tree": "d1d99593115946401db9ccd090cd53dc8ae303ba",
"version": "2.0.1",