-
-
Notifications
You must be signed in to change notification settings - Fork 21.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add meson build system #52311
Closed
Closed
Add meson build system #52311
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
304ac7c
Meson initial commit
marstaik 42b9358
fix meson CI concurrency name.
Faless 7fe2efd
fix register_modules script.
Faless f8e52aa
Add python shebang to scripts. Meson is too stupid to find them other…
Faless 6aa680c
Add use_volk option, allow building with volk.
Faless 62a6a28
Try running linux non-headless.
Faless 45d24fd
Add multiplayer folder.
Faless 6169095
Unified meson build.
Faless 12efe6e
Fix android aarch64 build.
Faless 7d480a4
JS defaults CI
Faless bc07171
Add etcpak module, remove etc2comp build file.
Faless 73623b3
Disable updalod artifact in meson workflow.
Faless e3977b2
Enable text_srv_adv, ogg, vorbis, fix dependencies.
jpakkane 7a38e7c
Add MSVC setup setup on windows.
Faless 08067aa
Have windows CI use pwsh so meson can pick up MSVC.
Faless 99b8578
Fix etcpak on windows.
jpakkane a645c06
NOMINMAX is a windows define.
Faless File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: 'Build Godot' | ||
description: 'Build Godot with the provided options' | ||
inputs: | ||
buildtype: | ||
description: 'The meson buildtype (debug/debugoptimized/optimized/minsize)' | ||
required: true | ||
default: 'debugoptimized' | ||
tools: | ||
description: 'If tools are to be built' | ||
required: true | ||
default: true | ||
platform: | ||
description: 'The Godot platform to build. This is currently unused' | ||
required: false | ||
meson: | ||
description: 'The meson binary to run (in case we need upstream/downstram patches to the build system).' | ||
required: true | ||
default: 'meson' | ||
destination: | ||
required: true | ||
default: 'builddir' | ||
mesonflags: | ||
default: '' | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Meson Configure | ||
shell: bash | ||
run: | | ||
${{ inputs.meson }} ${{ inputs.destination }} ${{ inputs.mesonflags }} -Dbuildtype=${{ inputs.buildtype }} -Dtools=${{ inputs.tools }} | ||
- name: Meson compile | ||
shell: bash | ||
run: | | ||
${{ inputs.meson }} compile -C ${{ inputs.destination }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: 'Setup python meson ninja.' | ||
description: 'Setup python installation, and install pip version of meson and ninja.' | ||
inputs: | ||
python-version: | ||
description: 'The python version to use' | ||
required: true | ||
default: '3.x' | ||
python-arch: | ||
description: 'The python architecture' | ||
required: true | ||
default: 'x64' | ||
runs: | ||
using: "composite" | ||
steps: | ||
# Use python 3.x release (works cross platform) | ||
- name: Set up Python 3.x | ||
uses: actions/setup-python@v2 | ||
with: | ||
# Semantic version range syntax or exact version of a Python version | ||
python-version: ${{ inputs.python-version }} | ||
# Optional - x64 or x86 architecture, defaults to x64 | ||
architecture: ${{ inputs.python-arch }} | ||
- name: Setup meson and ninja | ||
shell: bash | ||
run: | | ||
python -c "import sys; print(sys.version)" | ||
python -m pip install meson ninja | ||
python --version | ||
meson --version | ||
ninja --version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,200 @@ | ||
name: 💠 Meson Builds | ||
on: [push, pull_request] | ||
|
||
# Global Settings | ||
env: | ||
GODOT_BASE_BRANCH: master | ||
MESONFLAGS: '' | ||
EM_VERSION: 2.0.27 | ||
EM_CACHE_FOLDER: 'emsdk-cache' | ||
|
||
concurrency: | ||
group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}-meson | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
meson: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- name: 🤖 Android (release, armv7a) | ||
os: ubuntu-20.04 | ||
platform: android | ||
target: release | ||
tools: false | ||
mesonflags: '--cross-file cross/android.gen.txt' | ||
arch: armv7a | ||
|
||
- name: 🤖 Android (release, armv64v8) | ||
os: ubuntu-20.04 | ||
platform: android | ||
target: release | ||
tools: false | ||
mesonflags: '--cross-file cross/android.gen.txt' | ||
arch: aarch64 | ||
|
||
- name: 🍏 iOS (release) | ||
os: macos-latest | ||
platform: iphone | ||
target: release | ||
tools: false | ||
mesonflags: '--cross-file cross/iphone.txt' | ||
|
||
- name: 🌐 JavaScript (minsize) | ||
os: ubuntu-20.04 | ||
platform: javascript | ||
target: minsize | ||
tools: false | ||
meson: './meson-upstream/' | ||
mesonflags: '--cross-file cross/emscripten -Dbuiltin_pcre2_with_jit=false' | ||
|
||
- name: 🐧 Linux (debug, asan+ubsan, tests) | ||
os: ubuntu-20.04 | ||
platform: linuxbsd | ||
target: debug | ||
tools: true | ||
tests: true | ||
mesonflags: -Dtests=true -Duse_asan=true -Duse_ubsan=true | ||
|
||
- name: 🐧 Linux (release_debug, tests) | ||
os: ubuntu-20.04 | ||
platform: linuxbsd | ||
target: debugoptimized | ||
tools: true | ||
tests: true | ||
mesonflags: -Dtests=true | ||
|
||
- name: 🐧 Linux (release) | ||
os: ubuntu-20.04 | ||
platform: linuxbsd | ||
target: release | ||
tools: false | ||
|
||
- name: 🍎 macOS (release_debug, tests) | ||
os: macos-latest | ||
platform: osx | ||
target: debugoptimized | ||
tools: true | ||
tests: true | ||
mesonflags: -Dtests=true | ||
|
||
- name: 🍎 macOS (release) | ||
os: macos-latest | ||
platform: osx | ||
target: debugoptimized | ||
tools: false | ||
|
||
- name: 🏁 Windows (release_debug, tests) | ||
os: windows-latest | ||
platform: windows | ||
target: debugoptimized | ||
tools: true | ||
tests: true | ||
mesonflags: -Dtests=true | ||
|
||
- name: 🏁 Windows (release) | ||
os: windows-latest | ||
platform: windows | ||
target: release | ||
tools: false | ||
|
||
name: ${{ matrix.name }} | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Java 8 | ||
uses: actions/setup-java@v1 | ||
if: ${{ matrix.platform == 'android' }} | ||
with: | ||
java-version: 8 | ||
|
||
- name: Setup python and meson | ||
uses: ./.github/actions/meson_install | ||
|
||
- name: Generate meson cross compilation file (${{ matrix.arch }}). | ||
if: ${{ matrix.platform == 'android' }} | ||
run: | | ||
python3 misc/scripts/make_android_cross.py "$ANDROID_NDK_ROOT" -m ${{ matrix.arch }} -o cross/android.gen.txt | ||
|
||
# Additional cache for Emscripten generated system libraries | ||
- name: Load Emscripten cache | ||
id: javascript-template-emscripten-cache | ||
if: ${{ matrix.platform == 'javascript' }} | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{env.EM_CACHE_FOLDER}} | ||
key: ${{env.EM_VERSION}}-${{github.job}} | ||
|
||
- name: Set up Emscripten ${{env.EM_VERSION}} | ||
if: ${{ matrix.platform == 'javascript' }} | ||
uses: mymindstorm/setup-emsdk@v10 | ||
with: | ||
version: ${{env.EM_VERSION}} | ||
actions-cache-folder: ${{env.EM_CACHE_FOLDER}} | ||
|
||
- name: Verify Emscripten setup | ||
if: ${{ matrix.platform == 'javascript' }} | ||
run: | | ||
emcc -v | ||
|
||
# TODO remove once meson in pip is updated to master | ||
- name: Download meson upstream branch (pip version does not support godot) | ||
if: ${{ matrix.platform == 'javascript' }} | ||
run: | | ||
git clone https://github.com/mesonbuild/meson.git meson-upstream | ||
cd meson-upstream | ||
cp meson.py meson | ||
|
||
# Azure repositories are not reliable, we need to prevent azure giving us packages. | ||
- name: Make apt sources.list use the default Ubuntu repositories | ||
if: ${{ matrix.platform == 'linuxbsd' }} | ||
run: | | ||
sudo rm -f /etc/apt/sources.list.d/* | ||
sudo cp -f misc/ci/sources.list /etc/apt/sources.list | ||
sudo apt-get update | ||
|
||
# Install all packages (except scons) | ||
- name: Configure dependencies | ||
if: ${{ matrix.platform == 'linuxbsd' }} | ||
run: | | ||
sudo apt-get install build-essential pkg-config libx11-dev libxcursor-dev \ | ||
libxinerama-dev libgl1-mesa-dev libglu-dev libasound2-dev libpulse-dev libdbus-1-dev libudev-dev libxi-dev libxrandr-dev yasm \ | ||
xvfb wget unzip | ||
|
||
- name: Setup MSVC. | ||
if: ${{ matrix.platform == 'windows' }} | ||
uses: ilammy/msvc-dev-cmd@v1 | ||
with: | ||
arch: amd64 | ||
|
||
- name: Compilation (${{ matrix.platform }} ${{ matrix.arch }}) | ||
if: ${{ matrix.platform != 'windows' }} | ||
uses: ./.github/actions/meson_build | ||
with: | ||
mesonflags: ${{ env.MESONFLAGS }} ${{ matrix.mesonflags }} | ||
buildtype: ${{ matrix.target }} | ||
meson: ${{ matrix.meson }}meson | ||
tools: ${{ matrix.tools }} | ||
|
||
# Differnt build for windows due to github/MSVC messing up shell vars. | ||
- name: Meson configure (win) | ||
if: ${{ matrix.platform == 'windows' }} | ||
run: | | ||
meson builddir ${{ env.MESONFLAGS }} ${{ matrix.mesonflags }} -Dbuildtype=${{ matrix.target }} -Dtools=${{ matrix.tools }} | ||
|
||
- name: Meson build (win) | ||
if: ${{ matrix.platform == 'windows' }} | ||
run: | | ||
meson compile -C builddir | ||
|
||
# Execute unit tests for the editor | ||
- name: Unit Tests | ||
if: ${{ matrix.tests && matrix.platform == 'linuxbsd' }} | ||
run: | | ||
./builddir/godot --headless --test | ||
|
||
#- name: Upload Artifact | ||
# uses: ./.github/actions/upload-artifact |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
SOURCES += files(run_command(GLOB, '*.cpp').stdout().split('\n')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
SOURCES += files(run_command(GLOB, '*.cpp').stdout().split('\n')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
SOURCES += files(run_command(GLOB, '*.cpp').stdout().split('\n')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
SOURCES += files(run_command(GLOB, '*.cpp').stdout().split('\n')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
SOURCES += files(run_command(GLOB, '*.cpp').stdout().split('\n')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# generated input mappings | ||
_default_controller_mappings_target = custom_target( | ||
'default_controller_mappings', | ||
output: ['default_controller_mappings.gen.cpp'], | ||
input: ['gamecontrollerdb.txt', 'godotcontrollerdb.txt'], | ||
env: SCRIPTS_ENV, | ||
command: [SCRIPT_COMPAT, 'make_default_controller_mappings', SCRIPT_INPUT_BUILDERS, '-i', '@INPUT@', '-o', '@OUTPUT@'], | ||
build_by_default: true | ||
) | ||
|
||
SOURCES += [_default_controller_mappings_target] | ||
|
||
SOURCES += files(run_command(GLOB, '*.cpp').stdout().split('\n')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# generated certs | ||
|
||
_certs_target = custom_target( | ||
'certs', | ||
output: ['certs_compressed.gen.h'], | ||
input: [meson.project_source_root() + '/thirdparty/certs/ca-certificates.crt'], | ||
env: SCRIPTS_ENV, | ||
command: [SCRIPT_COMPAT, 'make_certs_header', SCRIPT_CORE_BUILDERS, '-i', '@INPUT@', '-o', '@OUTPUT@', '-e', | ||
'builtin_certs=' + (get_option('builtin_certs') ? 'true' : 'false'), | ||
'system_certs_path=' + get_option('system_certs_path')], | ||
build_by_default: true | ||
) | ||
|
||
SOURCES += [_certs_target] | ||
|
||
SOURCES += files(run_command(GLOB, '*.cpp').stdout().split('\n')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
SOURCES += files(run_command(GLOB, '*.cpp').stdout().split('\n')) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these be capitalized? Also, the quotes are inconsistent. Other places in the file use
'
,"
, or no quotes.