Skip to content

Commit 2cb9344

Browse files
authored
chore(ci): add arm64ec to push CI (#96)
2 parents 17db016 + 34f5056 commit 2cb9344

5 files changed

Lines changed: 32 additions & 4 deletions

File tree

.github/workflows/build_pull_request.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,14 @@ jobs:
149149
run: python3 make.py -ci -compiler vs2022 -config Release -cpu arm64 -build
150150
- name: Clean
151151
run: python3 make.py -clean_only
152+
- name: Building (debug-arm64)
153+
run: python3 make.py -ci -compiler vs2022 -config Debug -cpu arm64ec -build
154+
- name: Clean
155+
run: python3 make.py -clean_only
156+
- name: Building (release-arm64)
157+
run: python3 make.py -ci -compiler vs2022 -config Release -cpu arm64ec -build
158+
- name: Clean
159+
run: python3 make.py -clean_only
152160
- name: Building (debug-x64) with Clang
153161
run: python3 make.py -ci -compiler vs2022-clang -config Debug -cpu x64 -build
154162
- name: Running unit tests (debug-x64) with Clang

.github/workflows/build_push.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,14 @@ jobs:
149149
run: python3 make.py -ci -compiler vs2022 -config Release -cpu arm64 -build
150150
- name: Clean
151151
run: python3 make.py -clean_only
152+
- name: Building (debug-arm64ec)
153+
run: python3 make.py -ci -compiler vs2022 -config Debug -cpu arm64ec -build
154+
- name: Clean
155+
run: python3 make.py -clean_only
156+
- name: Building (release-arm64ec)
157+
run: python3 make.py -ci -compiler vs2022 -config Release -cpu arm64ec -build
158+
- name: Clean
159+
run: python3 make.py -clean_only
152160
- name: Building (debug-x64) with Clang
153161
run: python3 make.py -ci -compiler vs2022-clang -config Debug -cpu x64 -build
154162
- name: Running unit tests (debug-x64) with Clang

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ include(CMakeCompiler)
88
include(CMakePlatforms)
99

1010
set(CPU_INSTRUCTION_SET false CACHE STRING "CPU instruction set")
11+
set(IS_CROSS_COMPILING false CACHE BOOL "Whether we are cross-compiling or not")
1112

1213
if(CMAKE_CONFIGURATION_TYPES)
1314
set(CMAKE_CONFIGURATION_TYPES Debug Release)

make.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,13 +292,21 @@ def do_generate_solution(build_dir, cmake_script_dir, args):
292292
cpu = args.cpu
293293
config = args.config
294294

295+
is_arm64_cpu = False
296+
if platform.machine() == 'arm64' or platform.machine() == 'aarch64':
297+
is_arm64_cpu = True
298+
295299
if compiler:
296300
set_compiler_env(compiler, args)
297301

298302
extra_switches = ['--no-warn-unused-cli']
299303
extra_switches.append('-DCPU_INSTRUCTION_SET:STRING={}'.format(cpu))
300304
extra_switches.append('-DCMAKE_CXX_STANDARD:STRING={}'.format(args.cpp_version))
301305

306+
if platform.system() == 'Windows' and not is_arm64_cpu:
307+
if cpu == 'arm64' or cpu == 'arm64ec':
308+
extra_switches.append('-DIS_CROSS_COMPILING:BOOL=true')
309+
302310
if platform.system() == 'Windows':
303311
if os.path.sep == '\\':
304312
# Native Windows

tests/main_generic/CMakeLists.txt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,13 @@ create_source_groups("${ALL_MAIN_SOURCE_FILES}" ${PROJECT_SOURCE_DIR})
1919

2020
add_executable(${PROJECT_NAME} ${ALL_TEST_SOURCE_FILES} ${ALL_MAIN_SOURCE_FILES})
2121

22-
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/../../external/catch2/contrib")
23-
include(CTest)
24-
include(Catch)
25-
catch_discover_tests(${PROJECT_NAME})
22+
if(NOT IS_CROSS_COMPILING)
23+
# Don't attempt to detect unit tests if we are cross-compiling
24+
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/../../external/catch2/contrib")
25+
include(CTest)
26+
include(Catch)
27+
catch_discover_tests(${PROJECT_NAME})
28+
endif()
2629

2730
setup_default_compiler_flags(${PROJECT_NAME})
2831

0 commit comments

Comments
 (0)