[cpuid] Fix library linkage (#26545)

* [cpuid] Fix linkage

* Fix Windows build

* version
This commit is contained in:
Thomas1664 2022-08-29 22:19:20 +02:00 committed by GitHub
parent ed0279d48d
commit f571b30b86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 38 additions and 6 deletions

View File

@ -0,0 +1,23 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 08e78d4..9e84c7f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -26,5 +26,3 @@ endif(UNIX)
# Include subdirectories
add_subdirectory(libcpuid)
-add_subdirectory(cpuid_tool)
-add_subdirectory(tests)
diff --git a/libcpuid/CMakeLists.txt b/libcpuid/CMakeLists.txt
index 7031650..9355436 100644
--- a/libcpuid/CMakeLists.txt
+++ b/libcpuid/CMakeLists.txt
@@ -12,7 +12,7 @@ if("${MSVC_CXX_ARCHITECTURE_ID}" MATCHES "x64")
list(APPEND cpuid_sources masm-x64.asm)
endif()
-if(UNIX)
+if(0)
add_library(cpuid SHARED ${cpuid_sources})
else()
add_library(cpuid ${cpuid_sources})

View File

@ -1,4 +1,6 @@
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
if(VCPKG_TARGET_IS_WINDOWS)
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
endif()
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
@ -6,6 +8,8 @@ vcpkg_from_github(
REF 179fbcb713566c2084a1903729b6eebba68a4424 #0.5.1
SHA512 76eef8147a9ed2f116ddfd07ab95f76126bee0e23d0e6b5be54d157a1456b769fb698a4799a43c5f81ac12368d76fe8904bff735a698342ad8ee41d43e72645b
HEAD_REF master
PATCHES
fix-build.patch
)
vcpkg_cmake_configure(
@ -17,11 +21,10 @@ vcpkg_cmake_configure(
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/cpuid)
vcpkg_fixup_pkgconfig()
vcpkg_copy_pdbs()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin" "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
vcpkg_fixup_pkgconfig()

View File

@ -1,9 +1,10 @@
{
"name": "cpuid",
"version": "0.5.1",
"port-version": 3,
"port-version": 4,
"description": "Provides CPU identification for the x86 (and x86_64)",
"homepage": "https://github.com/anrieff/libcpuid",
"license": "MIT",
"supports": "(x86 | x64) & !uwp",
"dependencies": [
{

View File

@ -1690,7 +1690,7 @@
},
"cpuid": {
"baseline": "0.5.1",
"port-version": 3
"port-version": 4
},
"cpuinfo": {
"baseline": "2022-07-19",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "ffa19cf0fffa902983c32201f6f7b9cd36222c23",
"version": "0.5.1",
"port-version": 4
},
{
"git-tree": "aa97f1bac97c79fa1595ed1a4b141c209fc375e8",
"version": "0.5.1",