Skip to content

Commit 5bfa227

Browse files
committed
feat: add Linux Clang+libc++ build configuration
Signed-off-by: hk2166 <9610hemant@gmail.com>
1 parent 48a3873 commit 5bfa227

5 files changed

Lines changed: 233 additions & 90 deletions

File tree

.github/workflows/on-schedule-builds.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ jobs:
1414
with:
1515
run-windows-builds: true
1616
run-macos-builds: true
17-
upload-artifacts: false
17+
run-clang-libcxx-build: true
18+
upload-artifacts: false

.github/workflows/zxc-build-library.yaml

Lines changed: 75 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,14 @@ on:
1212
description: "Select this option when you want to run the MacOS builds."
1313
type: boolean
1414
required: false
15-
default: false
16-
15+
default: false
16+
17+
run-clang-libcxx-build:
18+
description: "Run the Linux Clang+libc++ build"
19+
required: false
20+
type: boolean
21+
default: false
22+
1723
upload-artifacts:
1824
description: "Select this option when you want to upload the artifacts."
1925
type: boolean
@@ -32,11 +38,17 @@ on:
3238
description: "Select this option when you want to run the MacOS builds."
3339
type: boolean
3440
required: false
35-
default: false
36-
41+
default: false
42+
43+
run-clang-libcxx-build:
44+
description: "Run the Linux Clang+libc++ build"
45+
required: false
46+
type: boolean
47+
default: false
48+
3749
upload-artifacts:
3850
description: "Select this option when you want to upload the artifacts."
39-
type: boolean
51+
type: boolean
4052
required: false
4153
default: true
4254

@@ -336,3 +348,61 @@ jobs:
336348
name: hapi-library-${{ runner.os }}-${{ steps.sha.outputs.short }}
337349
path: package/
338350
if-no-files-found: warn
351+
352+
build-linux-clang-libcxx:
353+
name: "Build (Linux, clang+libc++)"
354+
if: ${{ (inputs.run-clang-libcxx-build) && !cancelled() }}
355+
runs-on: hiero-client-sdk-linux-large
356+
357+
env:
358+
HIERO_NETWORK: localhost
359+
360+
steps:
361+
- name: Harden Runner
362+
uses: step-security/harden-runner@a5ad31d6a139d249332a2605b85202e8c0b78450 # v2.19.1
363+
with:
364+
egress-policy: audit
365+
366+
- name: Checkout Code
367+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
368+
with:
369+
submodules: recursive
370+
371+
- name: Install libc++ and libc++abi
372+
run: |
373+
sudo apt-get update
374+
sudo apt-get install -y libc++-dev libc++abi-dev
375+
376+
- name: Install CMake & Ninja
377+
uses: step-security/get-cmake@082f0e11945209d5c8d8476a791e39d4d041005d # v4.3.1
378+
with:
379+
useCloudCache: true
380+
381+
- name: Setup VCPkg
382+
uses: step-security/run-vcpkg@48490398616947b0df92dc1b24aab5339a66f9f0 # v11.5.2
383+
with:
384+
binaryCachePath: ${{ github.workspace }}/b/vcpkg_cache
385+
386+
- name: Convert VCPkg to Full Clone
387+
working-directory: vcpkg
388+
run: git fetch --unshallow --prune
389+
390+
- name: Configure CMake (Debug)
391+
run: cmake --preset linux-x64-clang-libcxx-debug -DBUILD_TESTS=ON
392+
393+
- name: Build (Debug)
394+
run: cmake --build --preset linux-x64-clang-libcxx-debug -j 6
395+
396+
- name: Run Unit Tests (Debug)
397+
run: ctest -j 6 -C Debug --test-dir build/linux-x64-clang-libcxx-debug -R "TestVectors|UnitTests" --output-on-failure
398+
continue-on-error: false
399+
400+
- name: Configure CMake (Release)
401+
run: cmake --preset linux-x64-clang-libcxx-release -DBUILD_TESTS=ON
402+
403+
- name: Build (Release)
404+
run: cmake --build --preset linux-x64-clang-libcxx-release -j 6
405+
406+
- name: Run Unit Tests (Release)
407+
run: ctest -j 6 -C Release --test-dir build/linux-x64-clang-libcxx-release -R "TestVectors|UnitTests" --output-on-failure
408+
continue-on-error: false

CMakePresets.json

Lines changed: 98 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
{
1010
"name": "vcpkg-base",
1111
"hidden": true,
12-
"displayName": "VCPkg Base Build",
12+
"displayName": "VCPkg Base",
1313
"description": "Configured via the vcpkg toolchain",
1414
"binaryDir": "${sourceDir}/build/${presetName}",
1515
"installDir": "${sourceDir}/package",
@@ -39,183 +39,197 @@
3939
{
4040
"name": "linux-x64-release",
4141
"inherits": ["vcpkg-base"],
42+
"displayName": "Linux x64 Release",
43+
"description": "Linux x64 Release build",
4244
"cacheVariables": {
43-
"VCPKG_TARGET_TRIPLET": {
44-
"type": "STRING",
45-
"value": "x64-linux"
46-
},
47-
"CMAKE_BUILD_TYPE": {
48-
"type": "STRING",
49-
"value": "Release"
50-
}
45+
"VCPKG_TARGET_TRIPLET": "x64-linux",
46+
"CMAKE_BUILD_TYPE": "Release"
5147
}
5248
},
5349
{
5450
"name": "linux-x64-debug",
5551
"inherits": ["vcpkg-base"],
52+
"displayName": "Linux x64 Debug",
53+
"description": "Linux x64 Debug build",
5654
"cacheVariables": {
57-
"VCPKG_TARGET_TRIPLET": {
58-
"type": "STRING",
59-
"value": "x64-linux"
60-
},
61-
"CMAKE_BUILD_TYPE": {
62-
"type": "STRING",
63-
"value": "Debug"
64-
}
55+
"VCPKG_TARGET_TRIPLET": "x64-linux",
56+
"CMAKE_BUILD_TYPE": "Debug"
6557
}
6658
},
59+
{
60+
"name": "linux-x64-clang-libcxx-debug",
61+
"displayName": "Linux x64 Clang libc++ Debug",
62+
"description": "Linux x64 build with Clang and libc++ (Debug)",
63+
"inherits": "vcpkg-base",
64+
"cacheVariables": {
65+
"CMAKE_BUILD_TYPE": "Debug",
66+
"CMAKE_C_COMPILER": "clang",
67+
"CMAKE_CXX_COMPILER": "clang++",
68+
"CMAKE_CXX_FLAGS_INIT": "-stdlib=libc++",
69+
"CMAKE_EXE_LINKER_FLAGS_INIT": "-stdlib=libc++ -lc++abi",
70+
"CMAKE_SHARED_LINKER_FLAGS_INIT": "-stdlib=libc++ -lc++abi",
71+
"VCPKG_TARGET_TRIPLET": "x64-linux-clang-libcxx",
72+
"VCPKG_OVERLAY_TRIPLETS": "${sourceDir}/vcpkg-triplets"
73+
},
74+
"binaryDir": "${sourceDir}/build/linux-x64-clang-libcxx-debug"
75+
},
76+
{
77+
"name": "linux-x64-clang-libcxx-release",
78+
"displayName": "Linux x64 Clang libc++ Release",
79+
"description": "Linux x64 build with Clang and libc++ (Release)",
80+
"inherits": "vcpkg-base",
81+
"cacheVariables": {
82+
"CMAKE_BUILD_TYPE": "Release",
83+
"CMAKE_C_COMPILER": "clang",
84+
"CMAKE_CXX_COMPILER": "clang++",
85+
"CMAKE_CXX_FLAGS_INIT": "-stdlib=libc++",
86+
"CMAKE_EXE_LINKER_FLAGS_INIT": "-stdlib=libc++ -lc++abi",
87+
"CMAKE_SHARED_LINKER_FLAGS_INIT": "-stdlib=libc++ -lc++abi",
88+
"VCPKG_TARGET_TRIPLET": "x64-linux-clang-libcxx",
89+
"VCPKG_OVERLAY_TRIPLETS": "${sourceDir}/vcpkg-triplets"
90+
},
91+
"binaryDir": "${sourceDir}/build/linux-x64-clang-libcxx-release"
92+
},
6793
{
6894
"name": "macos-x64-release",
6995
"inherits": ["vcpkg-base"],
96+
"displayName": "macOS x64 Release",
97+
"description": "macOS x64 Release build",
7098
"cacheVariables": {
71-
"VCPKG_TARGET_TRIPLET": {
72-
"type": "STRING",
73-
"value": "x64-osx"
74-
},
75-
"CMAKE_BUILD_TYPE": {
76-
"type": "STRING",
77-
"value": "Release"
78-
}
99+
"VCPKG_TARGET_TRIPLET": "x64-osx",
100+
"CMAKE_BUILD_TYPE": "Release"
79101
}
80102
},
81103
{
82104
"name": "macos-x64-debug",
83105
"inherits": ["vcpkg-base"],
106+
"displayName": "macOS x64 Debug",
107+
"description": "macOS x64 Debug build",
84108
"cacheVariables": {
85-
"VCPKG_TARGET_TRIPLET": {
86-
"type": "STRING",
87-
"value": "x64-osx"
88-
},
89-
"CMAKE_BUILD_TYPE": {
90-
"type": "STRING",
91-
"value": "Debug"
92-
}
109+
"VCPKG_TARGET_TRIPLET": "x64-osx",
110+
"CMAKE_BUILD_TYPE": "Debug"
93111
}
94112
},
95113
{
96114
"name": "macos-arm64-release",
97115
"inherits": ["vcpkg-base"],
116+
"displayName": "macOS ARM64 Release",
117+
"description": "macOS ARM64 Release build",
98118
"cacheVariables": {
99-
"VCPKG_TARGET_TRIPLET": {
100-
"type": "STRING",
101-
"value": "arm64-osx"
102-
},
103-
"CMAKE_BUILD_TYPE": {
104-
"type": "STRING",
105-
"value": "Release"
106-
}
119+
"VCPKG_TARGET_TRIPLET": "arm64-osx",
120+
"CMAKE_BUILD_TYPE": "Release"
107121
}
108122
},
109123
{
110124
"name": "macos-arm64-debug",
111125
"inherits": ["vcpkg-base"],
126+
"displayName": "macOS ARM64 Debug",
127+
"description": "macOS ARM64 Debug build",
112128
"cacheVariables": {
113-
"VCPKG_TARGET_TRIPLET": {
114-
"type": "STRING",
115-
"value": "arm64-osx"
116-
},
117-
"CMAKE_BUILD_TYPE": {
118-
"type": "STRING",
119-
"value": "Debug"
120-
}
129+
"VCPKG_TARGET_TRIPLET": "arm64-osx",
130+
"CMAKE_BUILD_TYPE": "Debug"
121131
}
122132
},
123133
{
124134
"name": "windows-x64-release",
125135
"inherits": ["vcpkg-msbuild-base"],
136+
"displayName": "Windows x64 Release",
137+
"description": "Windows x64 Release build",
126138
"cacheVariables": {
127-
"VCPKG_TARGET_TRIPLET": {
128-
"type": "STRING",
129-
"value": "x64-windows"
130-
},
131-
"CMAKE_BUILD_TYPE": {
132-
"type": "STRING",
133-
"value": "Release"
134-
}
139+
"VCPKG_TARGET_TRIPLET": "x64-windows",
140+
"CMAKE_BUILD_TYPE": "Release"
135141
}
136142
},
137143
{
138144
"name": "windows-x64-debug",
139145
"inherits": ["vcpkg-msbuild-base"],
146+
"displayName": "Windows x64 Debug",
147+
"description": "Windows x64 Debug build",
140148
"cacheVariables": {
141-
"VCPKG_TARGET_TRIPLET": {
142-
"type": "STRING",
143-
"value": "x64-windows"
144-
},
145-
"CMAKE_BUILD_TYPE": {
146-
"type": "STRING",
147-
"value": "Debug"
148-
}
149+
"VCPKG_TARGET_TRIPLET": "x64-windows",
150+
"CMAKE_BUILD_TYPE": "Debug"
149151
}
150152
}
151153
],
152154
"buildPresets": [
153155
{
154156
"name": "linux-x64-release",
155157
"configurePreset": "linux-x64-release",
156-
"displayName": "Build ninja-multi-vcpkg",
157-
"description": "Build ninja-multi-vcpkg Configurations",
158+
"displayName": "Linux x64 Release",
159+
"description": "Build Linux x64 Release",
158160
"configuration": "Release",
159161
"targets": ["install"]
160162
},
161163
{
162164
"name": "linux-x64-debug",
163165
"configurePreset": "linux-x64-debug",
164-
"displayName": "Build ninja-multi-vcpkg",
165-
"description": "Build ninja-multi-vcpkg Configurations",
166+
"displayName": "Linux x64 Debug",
167+
"description": "Build Linux x64 Debug",
166168
"configuration": "Debug",
167169
"targets": ["install"]
168170
},
171+
{
172+
"name": "linux-x64-clang-libcxx-debug",
173+
"displayName": "Linux x64 Clang libc++ Debug",
174+
"description": "Linux x64 build with Clang and libc++ (Debug)",
175+
"configurePreset": "linux-x64-clang-libcxx-debug",
176+
"configuration": "Debug"
177+
},
178+
{
179+
"name": "linux-x64-clang-libcxx-release",
180+
"displayName": "Linux x64 Clang libc++ Release",
181+
"description": "Linux x64 build with Clang and libc++ (Release)",
182+
"configurePreset": "linux-x64-clang-libcxx-release",
183+
"configuration": "Release"
184+
},
169185
{
170186
"name": "macos-x64-release",
171187
"configurePreset": "macos-x64-release",
172-
"displayName": "Build ninja-multi-vcpkg",
173-
"description": "Build ninja-multi-vcpkg Configurations",
188+
"displayName": "macOS x64 Release",
189+
"description": "Build macOS x64 Release",
174190
"configuration": "Release",
175191
"targets": ["install"]
176192
},
177193
{
178194
"name": "macos-x64-debug",
179195
"configurePreset": "macos-x64-debug",
180-
"displayName": "Build ninja-multi-vcpkg",
181-
"description": "Build ninja-multi-vcpkg Configurations",
196+
"displayName": "macOS x64 Debug",
197+
"description": "Build macOS x64 Debug",
182198
"configuration": "Debug",
183199
"targets": ["install"]
184200
},
185201
{
186202
"name": "macos-arm64-release",
187203
"configurePreset": "macos-arm64-release",
188-
"displayName": "Build ninja-multi-vcpkg",
189-
"description": "Build ninja-multi-vcpkg Configurations",
204+
"displayName": "macOS ARM64 Release",
205+
"description": "Build macOS ARM64 Release",
190206
"configuration": "Release",
191207
"targets": ["install"]
192208
},
193209
{
194210
"name": "macos-arm64-debug",
195211
"configurePreset": "macos-arm64-debug",
196-
"displayName": "Build ninja-multi-vcpkg",
197-
"description": "Build ninja-multi-vcpkg Configurations",
212+
"displayName": "macOS ARM64 Debug",
213+
"description": "Build macOS ARM64 Debug",
198214
"configuration": "Debug",
199215
"targets": ["install"]
200216
},
201217
{
202218
"name": "windows-x64-release",
203219
"configurePreset": "windows-x64-release",
204-
"displayName": "MSVC Release (x64)",
205-
"description": "Build MSVC Configurations",
220+
"displayName": "Windows x64 Release",
221+
"description": "Build Windows x64 Release",
206222
"configuration": "Release",
207223
"targets": ["install"]
208224
},
209225
{
210226
"name": "windows-x64-debug",
211227
"configurePreset": "windows-x64-debug",
212-
"displayName": "MSVC Debug (x64)",
213-
"description": "Build MSVC Configurations",
228+
"displayName": "Windows x64 Debug",
229+
"description": "Build Windows x64 Debug",
214230
"configuration": "Debug",
215231
"targets": ["install"]
216232
}
217233
],
218-
"testPresets": [
219-
220-
]
234+
"testPresets": []
221235
}

0 commit comments

Comments
 (0)