Skip to content

Commit 0d19721

Browse files
committed
Build for Windows ARM64 and Add GHA CI support
#843
1 parent c2439a4 commit 0d19721

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

.github/workflows/windows.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
strategy:
2121
fail-fast: false
2222
matrix:
23-
os: [windows-2025, windows-2022]
23+
os: [windows-2025, windows-2022, windows-11-arm]
2424
runs-on: ${{ matrix.os }}
2525
steps:
2626
- name: Install dependencies
@@ -41,4 +41,6 @@ jobs:
4141
# CB_CMAKE_BUILD_TYPE: Release
4242
CB_CMAKE_BUILD_TYPE: RelWithDebInfo
4343
CB_NUMBER_OF_JOBS: 2
44+
# No OpenSSL ASM exists for Window-11=arm.
45+
CB_OPENSSL_NO_ASM: ${{ matrix.os == 'windows-11-arm' && '1' || '' }}
4446
run: ruby ./bin/build-tests.rb

CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ if(WIN32)
3232
message(STATUS "Windows SDK: ${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}")
3333
endif()
3434

35+
# This disables Microsoft’s C++ overloads for _Interlocked* and fixes the ARM64 build.
36+
if (WIN32 AND CMAKE_SIZEOF_VOID_P EQUAL 8 AND CMAKE_SYSTEM_PROCESSOR MATCHES "ARM64")
37+
message(STATUS "Applying WinBase Interlocked macro for Windows ARM64")
38+
add_compile_definitions(MICROSOFT_WINDOWS_WINBASE_H_DEFINE_INTERLOCKED_CPLUSPLUS_OVERLOADS=0)
39+
endif()
40+
3541
include(cmake/TarballRelease.cmake OPTIONAL)
3642

3743
include(cmake/PreventInSourceBuilds.cmake)

bin/build-tests.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ def run(*args)
8888
CB_CMAKE_EXTRAS << "-DENABLE_SANITIZER_MEMORY=ON"
8989
end
9090

91+
# No OpenSSLASM exists for Window ARM64
92+
if ENV["CB_OPENSSL_NO_ASM"] == "1"
93+
CB_CMAKE_EXTRAS << "-DOPENSSL_NO_ASM=1"
94+
end
95+
9196
BUILD_DIR = if CB_SANITIZER.empty?
9297
File.join(PROJECT_ROOT, "cmake-build-tests")
9398
else

core/platform/random.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#include <mutex>
2626
#include <system_error>
2727

28-
#ifdef WIN32
28+
#ifdef _WIN32
2929
// We need to include windows.h _before_ wincrypt.h
3030
#ifndef WIN32_LEAN_AND_MEAN
3131
#define WIN32_LEAN_AND_MEAN

0 commit comments

Comments
 (0)