Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cpuinfo] Fix cpuid-dump is not generated with x86-windows #24726

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions ports/cpuinfo/Fix-set-target-processor.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 74364e8..77dc173 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -51,7 +51,10 @@ MACRO(CPUINFO_TARGET_RUNTIME_LIBRARY target)
ENDMACRO()

# -- [ Determine target processor
-SET(CPUINFO_TARGET_PROCESSOR "${CMAKE_SYSTEM_PROCESSOR}")
+IF(WIN32)
+ELSE()
+ SET(CPUINFO_TARGET_PROCESSOR "${CMAKE_SYSTEM_PROCESSOR}")
+ENDIF()
IF(IOS OR (CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_OSX_ARCHITECTURES MATCHES "^(x86_64|arm64)$"))
SET(CPUINFO_TARGET_PROCESSOR "${CMAKE_OSX_ARCHITECTURES}")
ENDIF()
3 changes: 2 additions & 1 deletion ports/cpuinfo/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ vcpkg_from_github(
REF b40bae27785787b6dd70788986fd96434cf90ae2
SHA512 dbbe4f3e1d5ae74ffc8ba2cba0ab745a23f4993788f4947825ef5125dd1cbed3e13e0c98e020e6fcfa9879f54f06d7cba4de73ec29f77649b6a27b4ab82c8f1c
HEAD_REF master
PATCHES Fix-set-target-processor.patch
)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
Expand All @@ -35,7 +36,7 @@ if(VCPKG_TARGET_IS_WINDOWS)
# see https://github.com/pytorch/cpuinfo/pull/82 for updates
# NOTE: arm-windows is unsupported
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
set(CPUINFO_TARGET_PROCESSOR_param "-DCPUINFO_TARGET_PROCESSOR=x86")
set(CPUINFO_TARGET_PROCESSOR_param "-DCPUINFO_TARGET_PROCESSOR=i386")
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
set(CPUINFO_TARGET_PROCESSOR_param "-DCPUINFO_TARGET_PROCESSOR=AMD64")
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm")
Expand Down
1 change: 1 addition & 0 deletions ports/cpuinfo/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "cpuinfo",
"version-date": "2022-04-02",
"port-version": 1,
"description": "CPU INFOrmation library (x86/x86-64/ARM/ARM64, Linux/Windows/Android/macOS/iOS)",
"homepage": "https://github.com/pytorch/cpuinfo",
"license": "BSD-2-Clause",
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -1670,7 +1670,7 @@
},
"cpuinfo": {
"baseline": "2022-04-02",
"port-version": 0
"port-version": 1
},
"cr": {
"baseline": "2020-04-26",
Expand Down
5 changes: 5 additions & 0 deletions versions/c-/cpuinfo.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "2bac81f72f631195661fc17b4e30f451dfc1da32",
"version-date": "2022-04-02",
"port-version": 1
},
{
"git-tree": "69febccb10ae5b789dd6c5af2b85740617fc34f4",
"version-date": "2022-04-02",
Expand Down