FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Prepare to using default cpu arch, add detecting available by Arlu · Pull Request #201 · python/pymanager · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .cpp  (1) .py  (3) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
1 change: 1 addition & 0 deletions _msbuild.py
This file contains hidden or 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
Expand Up @@ -88,6 +88,7 @@ class ResourceFile(CSourceFile):
CFunction('get_current_package'),
CFunction('read_alias_package'),
CFunction('broadcast_settings_change'),
CFunction('get_processor_architecture'),
source='src/_native',
RootNamespace='_native',
)
Expand Down
1 change: 1 addition & 0 deletions _msbuild_test.py
This file contains hidden or 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
Expand Up @@ -54,6 +54,7 @@
CFunction('get_current_package'),
CFunction('read_alias_package'),
CFunction('broadcast_settings_change'),
CFunction('get_processor_architecture'),
source='src/_native',
),
DllPackage('_shellext_test',
Expand Down
21 changes: 21 additions & 0 deletions src/_native/misc.cpp
This file contains hidden or 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
Expand Up @@ -233,4 +233,25 @@ PyObject *broadcast_settings_change(PyObject *, PyObject *, PyObject *) {
return Py_GetConstant(Py_CONSTANT_NONE);
}

typedef enum {
CPU_X86 = 0,
CPU_X86_64 = 9,
CPU_ARM = 5,
CPU_ARM64 = 12,
CPU_UNKNOWN = 0xffff
} CpuArchitecture;

PyObject *get_processor_architecture(PyObject *, PyObject *, PyObject *) {
SYSTEM_INFO system_info;
GetNativeSystemInfo(&system_info);

switch (system_info.wProcessorArchitecture) {
case CPU_X86: return PyUnicode_FromString("-32");
case CPU_X86_64: return PyUnicode_FromString("-64");
case CPU_ARM: return PyUnicode_FromString("-arm");
case CPU_ARM64: return PyUnicode_FromString("-arm64");
default: return PyUnicode_FromString("-64"); // x86-64
}
}

}
3 changes: 3 additions & 0 deletions src/manage/commands.py
This file contains hidden or 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
Expand Up @@ -443,6 +443,9 @@ def __init__(self, args, root=None):
_set_args.add(k)

if not self.default_platform:
from _native import get_processor_architecture
LOGGER.debug("Get CPU architecture, its prefix is %s", get_processor_architecture())

# Currently, we always default to -64.
self.default_platform = "-64"

Expand Down

Back | FazBrowse Home | New Git URL