Skip to content
This repository was archived by the owner on Aug 14, 2026. It is now read-only.

Commit 8cf9cac

Browse files
authored
Merge pull request #12 from sogik/alt-builds
All builds optimized with LTO for improved launch times and add clang support
2 parents a742e65 + b5ccf4f commit 8cf9cac

5 files changed

Lines changed: 178 additions & 6 deletions

File tree

‎.github/workflows/build.yml‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,12 @@ jobs:
103103
# TODO(@getchoo): This is the default in setup-dependencies/windows. Why isn't it working?!?!
104104
vcvars-arch: amd64
105105

106+
- os: windows-2022
107+
artifact-name: Windows-Clang
108+
base-cmake-preset: windows_clang
109+
vcvars-arch: amd64
110+
compiler: clang
111+
106112
- os: windows-2022
107113
artifact-name: Windows-MSVC-arm64
108114
base-cmake-preset: windows_msvc_arm64_cross
@@ -143,6 +149,18 @@ jobs:
143149
vcvars-arch: ${{ matrix.vcvars-arch }}
144150
qt-architecture: ${{ matrix.qt-architecture }}
145151

152+
- name: Install Clang (Windows)
153+
if: matrix.compiler == 'clang'
154+
shell: pwsh
155+
run: |
156+
$llvmInstalled = choco list --local-only llvm
157+
if ($llvmInstalled -match "llvm") {
158+
Write-Host "LLVM already installed, skipping installation"
159+
} else {
160+
choco install llvm -y
161+
}
162+
echo "C:\Program Files\LLVM\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
163+
146164
- name: Export CurseForge API Key
147165
run: echo "CURSEFORGE_API_KEY=${{ secrets.CURSEFORGE_API_KEY }}" >> $GITHUB_ENV
148166

@@ -153,13 +171,21 @@ jobs:
153171
# BUILD
154172
##
155173

174+
- name: List CMake presets (debug)
175+
run: |
176+
echo "Available CMake presets:"
177+
cmake --list-presets=all || true
178+
echo "---"
179+
echo "Expected preset: ${{ matrix.base-cmake-preset }}_${{ (inputs.build-type || 'Debug') == 'Debug' && 'debug' || 'ci' }}"
180+
156181
- name: Get CMake preset
157182
id: cmake-preset
158183
env:
159184
BASE_CMAKE_PRESET: ${{ matrix.base-cmake-preset }}
160185
PRESET_TYPE: ${{ (inputs.build-type || 'Debug') == 'Debug' && 'debug' || 'ci' }}
161186
run: |
162187
echo preset="$BASE_CMAKE_PRESET"_"$PRESET_TYPE" >> "$GITHUB_OUTPUT"
188+
echo "Using preset: $BASE_CMAKE_PRESET"_"$PRESET_TYPE"
163189
164190
- name: Run CMake workflow
165191
env:

‎cmake/windowsMSVCPreset.json‎

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,41 @@
6969
"windows_msvc_arm64_cross_base"
7070
],
7171
"displayName": "Windows MSVC (ARM64 cross, CI)"
72+
},
73+
{
74+
"name": "windows_clang_base",
75+
"hidden": true,
76+
"inherits": [
77+
"windows_msvc_base"
78+
],
79+
"cacheVariables": {
80+
"CMAKE_C_COMPILER": "clang-cl",
81+
"CMAKE_CXX_COMPILER": "clang-cl"
82+
}
83+
},
84+
{
85+
"name": "windows_clang_debug",
86+
"inherits": [
87+
"base_debug",
88+
"windows_clang_base"
89+
],
90+
"displayName": "Windows Clang (Debug)"
91+
},
92+
{
93+
"name": "windows_clang_release",
94+
"inherits": [
95+
"base_release",
96+
"windows_clang_base"
97+
],
98+
"displayName": "Windows Clang (Release)"
99+
},
100+
{
101+
"name": "windows_clang_ci",
102+
"inherits": [
103+
"base_ci",
104+
"windows_clang_base"
105+
],
106+
"displayName": "Windows Clang (CI)"
72107
}
73108
],
74109
"buildPresets": [
@@ -134,6 +169,33 @@
134169
"displayName": "Windows MSVC (ARM64 cross, CI)",
135170
"configurePreset": "windows_msvc_arm64_cross_ci",
136171
"configuration": "Release"
172+
},
173+
{
174+
"name": "windows_clang_debug",
175+
"inherits": [
176+
"windows_msvc_base"
177+
],
178+
"displayName": "Windows Clang (Debug)",
179+
"configurePreset": "windows_clang_debug",
180+
"configuration": "Debug"
181+
},
182+
{
183+
"name": "windows_clang_release",
184+
"inherits": [
185+
"windows_msvc_base"
186+
],
187+
"displayName": "Windows Clang (Release)",
188+
"configurePreset": "windows_clang_release",
189+
"configuration": "Release"
190+
},
191+
{
192+
"name": "windows_clang_ci",
193+
"inherits": [
194+
"windows_msvc_base"
195+
],
196+
"displayName": "Windows Clang (CI)",
197+
"configurePreset": "windows_clang_ci",
198+
"configuration": "Release"
137199
}
138200
],
139201
"testPresets": [
@@ -175,6 +237,36 @@
175237
"displayName": "Windows MSVC (CI)",
176238
"configurePreset": "windows_msvc_ci",
177239
"configuration": "Release"
240+
},
241+
{
242+
"name": "windows_clang_debug",
243+
"inherits": [
244+
"base_debug",
245+
"windows_msvc_base"
246+
],
247+
"displayName": "Windows Clang (Debug)",
248+
"configurePreset": "windows_clang_debug",
249+
"configuration": "Debug"
250+
},
251+
{
252+
"name": "windows_clang_release",
253+
"inherits": [
254+
"base_release",
255+
"windows_msvc_base"
256+
],
257+
"displayName": "Windows Clang (Release)",
258+
"configurePreset": "windows_clang_release",
259+
"configuration": "Release"
260+
},
261+
{
262+
"name": "windows_clang_ci",
263+
"inherits": [
264+
"base_release",
265+
"windows_msvc_base"
266+
],
267+
"displayName": "Windows Clang (CI)",
268+
"configurePreset": "windows_clang_ci",
269+
"configuration": "Release"
178270
}
179271
],
180272
"workflowPresets": [
@@ -273,6 +365,60 @@
273365
"name": "windows_msvc_arm64_cross_ci"
274366
}
275367
]
368+
},
369+
{
370+
"name": "windows_clang_debug",
371+
"displayName": "Windows Clang (Debug)",
372+
"steps": [
373+
{
374+
"type": "configure",
375+
"name": "windows_clang_debug"
376+
},
377+
{
378+
"type": "build",
379+
"name": "windows_clang_debug"
380+
},
381+
{
382+
"type": "test",
383+
"name": "windows_clang_debug"
384+
}
385+
]
386+
},
387+
{
388+
"name": "windows_clang_release",
389+
"displayName": "Windows Clang (Release)",
390+
"steps": [
391+
{
392+
"type": "configure",
393+
"name": "windows_clang_release"
394+
},
395+
{
396+
"type": "build",
397+
"name": "windows_clang_release"
398+
},
399+
{
400+
"type": "test",
401+
"name": "windows_clang_release"
402+
}
403+
]
404+
},
405+
{
406+
"name": "windows_clang_ci",
407+
"displayName": "Windows Clang (CI)",
408+
"steps": [
409+
{
410+
"type": "configure",
411+
"name": "windows_clang_ci"
412+
},
413+
{
414+
"type": "build",
415+
"name": "windows_clang_ci"
416+
},
417+
{
418+
"type": "test",
419+
"name": "windows_clang_ci"
420+
}
421+
]
276422
}
277423
]
278424
}

‎launcher/java/download/ManifestDownloadTask.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ void ManifestDownloadTask::downloadJava(const QJsonDocument& doc)
9494
} else if (type == "file") {
9595
// TODO download compressed version if it exists ?
9696
auto raw = Json::ensureObject(Json::ensureObject(meta, "downloads"), "raw");
97-
auto isExec = Json::ensureBoolean(meta, "executable", false);
97+
auto isExec = Json::ensureBoolean(meta, QStringLiteral("executable"), false);
9898
auto url = Json::ensureString(raw, "url");
9999
if (!url.isEmpty() && QUrl(url).isValid()) {
100100
auto f = File{ file, url, QByteArray::fromHex(Json::ensureString(raw, "sha1").toLatin1()), isExec };

‎launcher/minecraft/mod/tasks/LocalResourcePackParseTask.cpp‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,14 +186,14 @@ QString buildStyle(const QJsonObject& obj)
186186
}
187187
if (obj.contains("bold")) {
188188
QString weight = "normal";
189-
if (Json::ensureBoolean(obj, "bold", false)) {
189+
if (Json::ensureBoolean(obj, QStringLiteral("bold"), false)) {
190190
weight = "bold";
191191
}
192192
styles << QString("font-weight: %1;").arg(weight);
193193
}
194194
if (obj.contains("italic")) {
195195
QString style = "normal";
196-
if (Json::ensureBoolean(obj, "italic", false)) {
196+
if (Json::ensureBoolean(obj, QStringLiteral("italic"), false)) {
197197
style = "italic";
198198
}
199199
styles << QString("font-style: %1;").arg(style);
@@ -212,8 +212,8 @@ QString processComponent(const QJsonArray& value, bool strikethrough, bool under
212212

213213
QString processComponent(const QJsonObject& obj, bool strikethrough, bool underline)
214214
{
215-
underline = Json::ensureBoolean(obj, "underlined", underline);
216-
strikethrough = Json::ensureBoolean(obj, "strikethrough", strikethrough);
215+
underline = Json::ensureBoolean(obj, QStringLiteral("underlined"), underline);
216+
strikethrough = Json::ensureBoolean(obj, QStringLiteral("strikethrough"), strikethrough);
217217

218218
QString result = Json::ensureString(obj, "text");
219219
if (underline) {

‎launcher/modplatform/flame/FlamePackExportTask.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ void FlamePackExportTask::makeApiRequest()
233233
}
234234

235235
setStatus(tr("Parsing API response from CurseForge for '%1'...").arg(mod->name));
236-
if (Json::ensureBoolean(fileObj, "isAvailable", false, "isAvailable"))
236+
if (Json::ensureBoolean(fileObj, QStringLiteral("isAvailable"), false))
237237
resolvedFiles.insert(mod->path, { Json::requireInteger(fileObj, "modId"), Json::requireInteger(fileObj, "id"),
238238
mod->enabled, mod->isMod });
239239
}

0 commit comments

Comments
 (0)