Skip to content

Commit 577c70b

Browse files
committed
Fix IDICMAKE_PLATFORM_CONFIG, Add GitLab Windows CI and simplify
platform config selection in CI
1 parent 7e9a6bc commit 577c70b

3 files changed

Lines changed: 33 additions & 9 deletions

File tree

.github/workflows/cpp.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@ jobs:
1111
strategy:
1212
fail-fast: false
1313
matrix:
14-
os: [ubuntu-22.04, windows-2022]
14+
os: [ubuntu-24.04, windows-2022, windows-2025]
1515
type: [exe, static, shared]
1616
env:
1717
CMAKE_ARGS: -DTEMPLATE_PROJECT_BUILD_DEMOS=1 -DTEMPLATE_PROJECT_BUILD_TESTS=1 -DTEMPLATE_PROJECT_USE_BUILD_TIMESTAMPS=1 -DTEMPLATE_PROJECT_DO_TEMPLATE_COMPONENT_TEST=1 -DTEMPLATE_PROJECT_CI_GIT_BRANCH_NAME="${{ github.ref_name }}"
18-
CONFIGS: '{ "exe": "platform_config.exe.cmake", "static": "platform_config.static.cmake", "shared": "platform_config.shared.cmake" }'
1918

2019
steps:
2120
- name: Checkout the source code
@@ -30,7 +29,7 @@ jobs:
3029
mkdir -p build
3130
cd build
3231
cmake --version
33-
cmake .. $CMAKE_ARGS -DIDICMAKE_PLATFORM_CONFIG=../${{ fromJSON(env.CONFIGS)[matrix.type] }}
32+
cmake .. $CMAKE_ARGS -DIDICMAKE_PLATFORM_CONFIG="../platform-config.${{ matrix.type }}.cmake"
3433
- name: Build
3534
shell: bash
3635
run: |

.gitlab-ci.yml

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,18 @@ build-linux:
1111
matrix:
1212
- COMPILER: [gcc-11, gcc-12, gcc-13, clang-11.0.1, clang-12, clang-13, clang-14, clang-15, clang-16, clang-17]
1313
TYPE: [exe, static, shared]
14-
variables:
15-
CONFIGS: '{ "exe": "platform_config.exe.cmake", "static": "platform_config.static.cmake", "shared": "platform_config.shared.cmake" }'
1614
image: $CI_REGISTRY/idi/dockerfiles/cmake-cpp:$COMPILER
1715
rules:
1816
- if: $CI_PIPELINE_SOURCE != "merge_request_event" && (($COMPILER =~ /(gcc-14|clang-14)$/)) # clang-14 image has a bug with libc++13
1917
allow_failure: true
2018
- if: $CI_PIPELINE_SOURCE != "merge_request_event" # Only on push events (same as 'except: merge_requests')
21-
before_script:
22-
- apt-get update && apt-get install -y -qq jq
19+
before_script: # This is required for pulling dependencies on projects
2320
- git config --global credential.helper store
2421
- echo "https://gitlab-ci-token:${CI_JOB_TOKEN}@${CI_SERVER_HOST}" > ~/.git-credentials
2522
script:
2623
- cmake --version && $CC --version && $CXX --version
2724
- mkdir -p build && cd build
28-
- cmake .. $CMAKE_ARGS -DIDICMAKE_PLATFORM_CONFIG=../$(echo $CONFIGS | jq -r .$TYPE)
25+
- cmake .. $CMAKE_ARGS -DIDICMAKE_PLATFORM_CONFIG=../platform-config.$TYPE.cmake
2926
- cmake --build . -j 8
3027
- ctest -C Debug --output-junit ctest.xml
3128
interruptible: true
@@ -36,3 +33,31 @@ build-linux:
3633
- build/ctest.xml
3734
reports:
3835
junit: build/ctest.xml
36+
37+
build-windows:
38+
stage: build
39+
tags: [windows, beefy]
40+
parallel:
41+
matrix:
42+
- TYPE: [exe, static, shared]
43+
image: $CI_REGISTRY/idi/dockerfiles/cmake-cpp
44+
rules:
45+
- if: $CI_PIPELINE_SOURCE != "merge_request_event" # Only on push events (same as 'except: merge_requests')
46+
before_script: # This is required for pulling dependencies on projects
47+
- git config --system credential.helper store
48+
- echo "https://gitlab-ci-token:${CI_JOB_TOKEN}@${CI_SERVER_HOST}`n" > ~/.git-credentials
49+
script:
50+
- cmake --version
51+
- mkdir -p build
52+
- cd build
53+
- cmake .. $CMAKE_ARGS -DIDICMAKE_PLATFORM_CONFIG="../platform-config.$TYPE.cmake"
54+
- cmake --build . -j 8
55+
- ctest -C Debug --output-junit ctest.xml
56+
interruptible: true
57+
artifacts:
58+
when: always
59+
name: "idi-cpp-template-$TYPE-win64-$CI_COMMIT_SHORT_SHA"
60+
paths:
61+
- build/ctest.xml
62+
reports:
63+
junit: build/ctest.xml

cmake/idi/functions/framework/idi_load_platform_config.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ macro(idi_load_platform_config)
1111
idi_cmake_hook_abs(${CMAKE_CURRENT_LIST_DIR}/platform-local-options.cmake)
1212
idi_cmake_hook_abs(${CMAKE_CURRENT_LIST_DIR}/cmake-hooks/pre-configure.cmake)
1313

14-
set(IDICMAKE_PLATFORM_CONFIG "${CMAKE_CURRENT_LIST_DIR}/platform-config.cmake")
14+
set(IDICMAKE_PLATFORM_CONFIG "${CMAKE_CURRENT_LIST_DIR}/platform-config.cmake" CACHE FILEPATH "Platform config definitions file")
1515
include("${IDICMAKE_PLATFORM_CONFIG}")
1616

1717
idi_cmake_hook_abs(${CMAKE_CURRENT_LIST_DIR}/cmake-hooks/post-platform-config.cmake)

0 commit comments

Comments
 (0)