forked from microsoft/vcpkg
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[unicorn] update version 2.1.1 (microsoft#42578)
- Loading branch information
Showing
10 changed files
with
106 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 changes: 12 additions & 0 deletions
12
scripts/test_ports/vcpkg-ci-unicorn/project/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#include <unicorn/unicorn.h> | ||
|
||
int main() | ||
{ | ||
uc_engine* uc; | ||
uc_open(UC_ARCH_X86, UC_MODE_32, &uc); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters