From a4970a294c3a3be66abd44063ac438a6ad9c19b2 Mon Sep 17 00:00:00 2001 From: Cheney-Wang Date: Mon, 16 May 2022 03:24:19 -0700 Subject: [PATCH 1/2] [cpuinfo] Fix cpuid-dump is not generated with x86-windows --- ports/cpuinfo/Fix-set-target-processor.patch | 16 ++++++++++++++++ ports/cpuinfo/portfile.cmake | 3 ++- ports/cpuinfo/vcpkg.json | 1 + versions/baseline.json | 2 +- versions/c-/cpuinfo.json | 5 +++++ 5 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 ports/cpuinfo/Fix-set-target-processor.patch diff --git a/ports/cpuinfo/Fix-set-target-processor.patch b/ports/cpuinfo/Fix-set-target-processor.patch new file mode 100644 index 00000000000000..3c5c6b4deb9a85 --- /dev/null +++ b/ports/cpuinfo/Fix-set-target-processor.patch @@ -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() diff --git a/ports/cpuinfo/portfile.cmake b/ports/cpuinfo/portfile.cmake index aa964e6e17d08b..cc87b5f29dfe27 100644 --- a/ports/cpuinfo/portfile.cmake +++ b/ports/cpuinfo/portfile.cmake @@ -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 @@ -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") diff --git a/ports/cpuinfo/vcpkg.json b/ports/cpuinfo/vcpkg.json index d718f9393058a2..cc1c3159cb23f4 100644 --- a/ports/cpuinfo/vcpkg.json +++ b/ports/cpuinfo/vcpkg.json @@ -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", diff --git a/versions/baseline.json b/versions/baseline.json index e1b624d5d9787a..902e9db8fa2a6f 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -1670,7 +1670,7 @@ }, "cpuinfo": { "baseline": "2022-04-02", - "port-version": 0 + "port-version": 1 }, "cr": { "baseline": "2020-04-26", diff --git a/versions/c-/cpuinfo.json b/versions/c-/cpuinfo.json index fef8a68d0b663f..5bf82462b78838 100644 --- a/versions/c-/cpuinfo.json +++ b/versions/c-/cpuinfo.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "2bac81f72f631195661fc17b4e30f451dfc1da32", + "version-date": "2022-04-02", + "port-version": 1 + }, { "git-tree": "69febccb10ae5b789dd6c5af2b85740617fc34f4", "version-date": "2022-04-02", From 4193b0f8e4a7f42cbfc5c38afc813442a3e7bf21 Mon Sep 17 00:00:00 2001 From: Cheney-Wang Date: Mon, 16 May 2022 19:39:11 -0700 Subject: [PATCH 2/2] Add double quotation marks --- ports/cpuinfo/portfile.cmake | 2 +- versions/c-/cpuinfo.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/cpuinfo/portfile.cmake b/ports/cpuinfo/portfile.cmake index cc87b5f29dfe27..10f21007b28fe7 100644 --- a/ports/cpuinfo/portfile.cmake +++ b/ports/cpuinfo/portfile.cmake @@ -65,7 +65,7 @@ vcpkg_cmake_config_fixup() vcpkg_copy_pdbs() vcpkg_fixup_pkgconfig() # pkg_check_modules(libcpuinfo) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") if("tools" IN_LIST FEATURES) vcpkg_copy_tools( diff --git a/versions/c-/cpuinfo.json b/versions/c-/cpuinfo.json index 5bf82462b78838..5b4c284b6eacc1 100644 --- a/versions/c-/cpuinfo.json +++ b/versions/c-/cpuinfo.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "2bac81f72f631195661fc17b4e30f451dfc1da32", + "git-tree": "7ef42f4d240f0bbdd2ef439ece01fd65ddcacb15", "version-date": "2022-04-02", "port-version": 1 },