Skip to content

Commit a59ce63

Browse files
authored
Move project to CMake (MCLCE#781)
* Move to cmake * Move sources to source_groups and ditch more old VS files * Add BuildVer.h generation * Break out cmake source lists to platforms * Don't copy swf files * Revert audio changes from merge * Add platform defines * Match MSBuild flags * Move BuildVer.h to common include and fix rebuild issue * Seperate projects properly * Exclude more files and make sure GameHDD exists * Missing line * Remove remaining VS project files * Update readme and actions * Use incremental LTCG * Update workflows * Update build workflows and output folder * Disable vcpkg checks * Force MSVC * Use precompiled headers * Only use PCH for cpp * Exclude compat_shims from PCH * Handle per-platform source includes * Copy only current platform media * Define Iggy libs per platform * Fix EnsureGameHDD check * Only set WIN32_EXECUTABLE on Windows * Correct Iggy libs path * Remove include of terrain_MipmapLevel * Correct path to xsb/xwb * Implement copilot suggestions * Add clang flags (untested) * Fix robocopy error checking * Update documentation * Drop CMakePresets.json version as we dont use v6 features * Always cleanup artifacts in nightly even if some builds fail * Re-work compiler target options * Move newer iggy dll into redist and cleanup * Fix typos * Remove 'Source Files' from all source groups * Remove old ps1 build scripts
1 parent 9a58e69 commit a59ce63

106 files changed

Lines changed: 8069 additions & 72799 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

.github/workflows/debug-test.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: Nightly Server Release
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- 'main'
8+
paths-ignore:
9+
- '.gitignore'
10+
- '*.md'
11+
- '.github/**'
12+
- '!.github/workflows/nightly-server.yml'
13+
14+
permissions:
15+
contents: write
16+
17+
jobs:
18+
build:
19+
runs-on: windows-latest
20+
21+
strategy:
22+
matrix:
23+
platform: [Windows64]
24+
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v6
28+
29+
- name: Set platform lowercase
30+
run: echo "PLATFORM=$('${{ matrix.platform }}'.ToLower())" >> $env:GITHUB_ENV
31+
32+
- name: Setup MSVC
33+
uses: ilammy/msvc-dev-cmd@v1
34+
35+
- name: Setup CMake
36+
uses: lukka/get-cmake@latest
37+
38+
- name: Run CMake
39+
uses: lukka/run-cmake@v10
40+
env:
41+
VCPKG_ROOT: "" # Disable vcpkg for CI builds
42+
with:
43+
configurePreset: ${{ env.PLATFORM }}
44+
buildPreset: ${{ env.PLATFORM }}-release
45+
buildPresetAdditionalArgs: "['--target', 'Minecraft.Server']"
46+
47+
- name: Zip Build
48+
run: 7z a -r LCEServer${{ matrix.platform }}.zip ./build/${{ env.PLATFORM }}/Minecraft.Server/Release/* -x!*.ipdb -x!*.iobj
49+
50+
- name: Stage artifacts
51+
run: |
52+
New-Item -ItemType Directory -Force -Path staging
53+
Copy-Item LCEServer${{ matrix.platform }}.zip staging/
54+
55+
- name: Stage exe and pdb
56+
if: matrix.platform == 'Windows64'
57+
run: |
58+
Copy-Item ./build/${{ env.PLATFORM }}/Minecraft.Server/Release/Minecraft.Server.exe staging/
59+
60+
- name: Upload artifacts
61+
uses: actions/upload-artifact@v6
62+
with:
63+
name: build-${{ matrix.platform }}
64+
path: staging/*
65+
66+
release:
67+
needs: build
68+
runs-on: ubuntu-latest
69+
70+
steps:
71+
- name: Download all artifacts
72+
uses: actions/download-artifact@v7
73+
with:
74+
path: artifacts
75+
merge-multiple: true
76+
77+
- name: Update release
78+
uses: andelf/nightly-release@main
79+
env:
80+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
81+
with:
82+
tag_name: nightly-dedicated-server
83+
name: Nightly Dedicated Server Release
84+
body: |
85+
Dedicated Server runtime for Windows64.
86+
87+
Download `LCEServerWindows64.zip` and extract it to a folder where you'd like to keep the server runtime.
88+
files: |
89+
artifacts/*
90+
91+
cleanup:
92+
needs: [build, release]
93+
if: always()
94+
runs-on: ubuntu-latest
95+
steps:
96+
- name: Cleanup artifacts
97+
uses: geekyeggo/delete-artifact@v5
98+
with:
99+
name: build-*

.github/workflows/nightly.yml

Lines changed: 61 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,100 @@
1-
name: Nightly Releases
1+
name: Nightly Release
22

33
on:
44
workflow_dispatch:
55
push:
66
branches:
77
- 'main'
8-
- 'feature/dedicated-server'
98
paths-ignore:
109
- '.gitignore'
1110
- '*.md'
12-
- '.github/*.md'
11+
- '.github/**'
12+
- '!.github/workflows/nightly.yml'
1313

1414
permissions:
1515
contents: write
1616

1717
jobs:
1818
build:
19-
name: Build Windows64
2019
runs-on: windows-latest
2120

21+
strategy:
22+
matrix:
23+
platform: [Windows64]
24+
2225
steps:
2326
- name: Checkout
2427
uses: actions/checkout@v6
2528

26-
- name: Setup msbuild
27-
uses: microsoft/setup-msbuild@v2
29+
- name: Set platform lowercase
30+
run: echo "PLATFORM=$('${{ matrix.platform }}'.ToLower())" >> $env:GITHUB_ENV
2831

29-
- name: Build
30-
run: MSBuild.exe MinecraftConsoles.sln /p:Configuration=Release /p:Platform="Windows64"
32+
- name: Setup MSVC
33+
uses: ilammy/msvc-dev-cmd@v1
34+
35+
- name: Setup CMake
36+
uses: lukka/get-cmake@latest
37+
38+
- name: Run CMake
39+
uses: lukka/run-cmake@v10
40+
env:
41+
VCPKG_ROOT: "" # Disable vcpkg for CI builds
42+
with:
43+
configurePreset: ${{ env.PLATFORM }}
44+
buildPreset: ${{ env.PLATFORM }}-release
45+
buildPresetAdditionalArgs: "['--target', 'Minecraft.Client']"
3146

3247
- name: Zip Build
33-
run: 7z a -r LCEWindows64.zip ./x64/Release/*
48+
run: 7z a -r LCE${{ matrix.platform }}.zip ./build/${{ env.PLATFORM }}/Minecraft.Client/Release/* -x!*.ipdb -x!*.iobj
49+
50+
- name: Stage artifacts
51+
run: |
52+
New-Item -ItemType Directory -Force -Path staging
53+
Copy-Item LCE${{ matrix.platform }}.zip staging/
54+
55+
- name: Stage exe and pdb
56+
if: matrix.platform == 'Windows64'
57+
run: |
58+
Copy-Item ./build/${{ env.PLATFORM }}/Minecraft.Client/Release/Minecraft.Client.exe staging/
59+
60+
- name: Upload artifacts
61+
uses: actions/upload-artifact@v6
62+
with:
63+
name: build-${{ matrix.platform }}
64+
path: staging/*
65+
66+
release:
67+
needs: build
68+
runs-on: ubuntu-latest
3469

35-
- name: Zip Dedicated Server Build
36-
run: 7z a -r LCEServerWindows64.zip ./x64/Minecraft.Server/Release/*
70+
steps:
71+
- name: Download all artifacts
72+
uses: actions/download-artifact@v7
73+
with:
74+
path: artifacts
75+
merge-multiple: true
3776

38-
- name: Update Client release
77+
- name: Update release
3978
uses: andelf/nightly-release@main
4079
env:
4180
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4281
with:
4382
tag_name: nightly
4483
name: Nightly Client Release
4584
body: |
46-
Requires at least Windows 7 and DirectX 11 compatible GPU to run. Compiled with MSVC v14.44.35207 in Release mode with Whole Program Optimization, as well as `/O2 /Ot /Oi /Ob3 /GF /fp:precise`.
85+
Requires at least Windows 7 and DirectX 11 compatible GPU to run.
4786
4887
# 🚨 First time here? 🚨
4988
If you've never downloaded the game before, you need to download `LCEWindows64.zip` and extract it to the folder where you'd like to keep the game. The other files are included in this `.zip` file!
5089
files: |
51-
LCEWindows64.zip
52-
./x64/Release/Minecraft.Client.exe
53-
./x64/Release/Minecraft.Client.pdb
90+
artifacts/*
5491
55-
- name: Update Dedicated Server release
56-
uses: andelf/nightly-release@main
57-
env:
58-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
92+
cleanup:
93+
needs: [build, release]
94+
if: always()
95+
runs-on: ubuntu-latest
96+
steps:
97+
- name: Cleanup artifacts
98+
uses: geekyeggo/delete-artifact@v5
5999
with:
60-
tag_name: nightly-dedicated-server
61-
name: Nightly Dedicated Server Release
62-
body: |
63-
Dedicated Server runtime for Windows64.
64-
65-
Download `LCEServerWindows64.zip` and extract it to a folder where you'd like to keep the server runtime.
66-
files: |
67-
LCEServerWindows64.zip
68-
./x64/Minecraft.Server/Release/Minecraft.Server.exe
69-
./x64/Minecraft.Server/Release/Minecraft.Server.pdb
100+
name: build-*

.github/workflows/pull-request.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Pull Request Build
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
types: [opened, reopened, synchronize]
7+
paths-ignore:
8+
- '.gitignore'
9+
- '*.md'
10+
- '.github/*.md'
11+
12+
jobs:
13+
build:
14+
runs-on: windows-latest
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v6
19+
20+
- name: Setup MSVC
21+
uses: ilammy/msvc-dev-cmd@v1
22+
23+
- name: Setup CMake
24+
uses: lukka/get-cmake@latest
25+
26+
- name: Run CMake
27+
uses: lukka/run-cmake@v10
28+
env:
29+
VCPKG_ROOT: "" # Disable vcpkg for CI builds
30+
with:
31+
configurePreset: windows64
32+
buildPreset: windows64-debug

.gitignore

Lines changed: 3 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -407,39 +407,10 @@ enc_temp_folder/
407407
Minecraft.Client/Schematics/
408408
Minecraft.Client/Windows64/GameHDD/
409409

410-
# Intermediate build files (per-project)
411-
Minecraft.Client/x64/
412-
Minecraft.Client/Debug/
413-
Minecraft.Client/x64_Debug/
414-
Minecraft.Client/Release/
415-
Minecraft.Client/x64_Release/
416-
417-
Minecraft.World/x64/
418-
Minecraft.World/Debug/
419-
Minecraft.World/x64_Debug/
420-
Minecraft.World/Release/
421-
Minecraft.World/x64_Release/
422-
423-
Minecraft.Server/x64/
424-
Minecraft.Server/Debug/
425-
Minecraft.Server/x64_Debug/
426-
Minecraft.Server/Release/
427-
Minecraft.Server/x64_Release/
428-
429-
build/*
430-
431-
# Existing build output files
432-
!x64/**/Effects.msscmp
433-
!x64/**/iggy_w64.dll
434-
!x64/**/mss64.dll
435-
!x64/**/redist64/
436-
437-
# Local saves
438-
Minecraft.Client/Saves/
410+
# CMake build output
411+
build/
439412

413+
# Server data
440414
tmp*/
441415
_server_asset_probe/
442416
server-data/
443-
# Visual Studio Per-User Config
444-
*.user
445-
/out

0 commit comments

Comments
 (0)