Skip to content

[cmake] Windows check ARM64/WIN64 symbols#51

Merged
opdenkamp merged 1 commit into
Pulse-Eight:masterfrom
fuzzard:cmake_fixincorrect_vars
Jul 16, 2026
Merged

[cmake] Windows check ARM64/WIN64 symbols#51
opdenkamp merged 1 commit into
Pulse-Eight:masterfrom
fuzzard:cmake_fixincorrect_vars

Conversation

@fuzzard

@fuzzard fuzzard commented Mar 7, 2025

Copy link
Copy Markdown

Similar issues as Pulse-Eight/libcec#675

the _M_ARM64 symbol isnt available always at cmake configure time.
Instead use check_symbol_exists to be able to test for Arch specific symbols for x64 and arm64 arch types correctly always.

Also, add removal of /arch:SSE2 flag for arm64 arch type as well to remove warnings.

use check_symbol_exists to be able to test for Arch specific symbols for
x64 and arm64 arch types.
@opdenkamp
opdenkamp merged commit 2ff8f0e into Pulse-Eight:master Jul 16, 2026
opdenkamp added a commit to Pulse-Eight/libcec that referenced this pull request Jul 16, 2026
…fix (platform #51)

pulls in platform 2ff8f0e (merge of Pulse-Eight/platform#51), which replaces the
never-defined ${WIN64}/${_M_ARM64} cmake variables with
check_symbol_exists(_AMD64_/_ARM64_ ...). this makes p8-platform define
_USE_32BIT_TIME_T on x86 (matching libcec, which already does) and strip the
/arch:SSE2 flag on arm64 that MSVC warns about. verified on real MSVC:
WIN64=1 on x64, ARM64=1 on arm64, both empty on x86.
@opdenkamp

Copy link
Copy Markdown
Contributor

Merged, thanks @fuzzard. Verified the detection on real MSVC (VS2022 17.13, cmake 4.3) across every target arch before merging:

-A WIN64 ARM64 _USE_32BIT_TIME_T strip /arch:SSE2
x64 1 no yes
Win32 yes no
ARM64 1 no yes
ARM yes no

check_symbol_exists(_AMD64_ Windows.h WIN64) / (_ARM64_ Windows.h ARM64) resolve correctly because <Windows.h> defines _AMD64_/_ARM64_ from the compiler's _M_AMD64/_M_ARM64 predefines.

Confirms this fixes two real problems the old ${WIN64}/${_M_ARM64} variables never triggered (both were undefined, so the branches were silently dead):

  • x86 now defines _USE_32BIT_TIME_T, matching libCEC (which already sets it for x86) — resolves the time_t ABI mismatch across the libcec/p8-platform boundary.
  • arm64 now strips the /arch:SSE2 flag MSVC warns about.

x64 behaviour is unchanged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants