Skip to content

setup.py: honor CMAKE_GENERATOR_PLATFORM for the Windows -A flag#1910

Open
ax3l wants to merge 1 commit into
openPMD:devfrom
ax3l:fix-setup-py-win-arm64
Open

setup.py: honor CMAKE_GENERATOR_PLATFORM for the Windows -A flag#1910
ax3l wants to merge 1 commit into
openPMD:devfrom
ax3l:fix-setup-py-win-arm64

Conversation

@ax3l

@ax3l ax3l commented Jul 6, 2026

Copy link
Copy Markdown
Member

The Windows build hardcoded the Visual Studio target architecture to x64 for any 64-bit interpreter (if sys.maxsize > 2**32: -A x64). On win-arm64 the interpreter is 64-bit but the architecture is ARM, so this mis-targeted the build and find_package(Python) then failed. Honor an explicit CMAKE_GENERATOR_PLATFORM (e.g. "ARM64") from the environment, falling back to the previous behavior otherwise.

Used in #1909

The Windows build hardcoded the Visual Studio target architecture to x64 for
any 64-bit interpreter (`if sys.maxsize > 2**32: -A x64`). On win-arm64 the
interpreter is 64-bit but the architecture is ARM, so this mis-targeted the
build and find_package(Python) then failed. Honor an explicit
CMAKE_GENERATOR_PLATFORM (e.g. "ARM64") from the environment, falling back to
the previous behavior otherwise.
@ax3l ax3l added this to the 0.17.2 milestone Jul 6, 2026
@ax3l ax3l requested a review from franzpoeschel July 6, 2026 05:11
ax3l added a commit to AMReX-Codes/pyamrex that referenced this pull request Jul 6, 2026
The Windows build hardcoded the Visual Studio target architecture to x64
for any 64-bit interpreter (`if sys.maxsize > 2**32: -A x64`). On
win-arm64 the interpreter is 64-bit but the architecture is ARM, so this
mis-targeted the build and find_package(Python) then failed. Honor an
explicit CMAKE_GENERATOR_PLATFORM (e.g. "ARM64") from the environment,
falling back to the previous behavior otherwise.

Same as openPMD/openPMD-api#1910
EZoni pushed a commit to BLAST-WarpX/warpx that referenced this pull request Jul 6, 2026
The Windows build hardcoded the Visual Studio target architecture to x64
for any 64-bit interpreter (`if sys.maxsize > 2**32: -A x64`). On
win-arm64 the interpreter is 64-bit but the architecture is ARM, so this
mis-targeted the build and find_package(Python) then failed. Honor an
explicit CMAKE_GENERATOR_PLATFORM (e.g. "ARM64") from the environment,
falling back to the previous behavior otherwise.

Same as openPMD/openPMD-api#1910
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants