Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 4 additions & 13 deletions .github/actions/setup-godot/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,7 @@ runs:
run: python ./godot/misc/scripts/install_d3d12_sdk_windows.py
if: inputs.platform == 'windows'

- name: Download pre-built ANGLE static libraries
uses: dsaltares/fetch-gh-release-asset@1.1.2
with:
repo: godotengine/godot-angle-static
version: tags/chromium/6601.2
file: godot-angle-static-x86_64-msvc-release.zip
target: angle/angle.zip
if: inputs.platform == 'windows'

- name: Extract pre-built ANGLE static libraries
shell: pwsh
run: Expand-Archive -Force angle/angle.zip ${{github.workspace}}/
if: inputs.platform == 'windows'
# AccessKit (screen reader) and ANGLE (OpenGL ES) are installed by
# scripts/build.sh / build.ps1 (`deps=yes`, the default) using the
# installers from the Godot checkout, so their versions always match the
# engine revision being built. Nothing to pin here.
12 changes: 12 additions & 0 deletions docs/en/setup/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,18 @@ For build tools (compiler, Python, SCons, etc.) on each platform, follow the off

### Notes

#### Godot third-party build dependencies (AccessKit / ANGLE)

Godot 4.7 links two prebuilt SDKs that are not part of the engine source tree: **AccessKit** (screen reader support) and **ANGLE** (the OpenGL ES rendering driver). If they are missing, `scons` prints a warning and silently disables those drivers, producing binaries that lack features the official Godot builds ship with.

`build.sh` / `build.ps1` download them on the first desktop build (using the installers in the `godot/` checkout, so the versions always match the engine revision) into `godot/bin/build_deps/` — or `%LOCALAPPDATA%\Godot\build_deps` on Windows. Pass `deps=no` to skip the download and build without those drivers:

```sh
./scripts/build.sh deps=no
```

The mobile and web platforms do not use either dependency, so nothing is downloaded for them.

#### Building Universal Binaries on macOS

The `molten-vk` package distributed via Homebrew only provides binaries for the host architecture, so linking fails when building with `arch=universal`. Install the universal-capable [Vulkan SDK for MoltenVK](https://vulkan.lunarg.com/sdk/home) instead.
Expand Down
12 changes: 12 additions & 0 deletions docs/ja/setup/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,18 @@ git clone https://github.com/godotengine/godot-cpp.git -b master

### 注意点

#### Godot のサードパーティビルド依存 (AccessKit / ANGLE)

Godot 4.7 は、エンジンのソースツリーに含まれない 2 つのビルド済み SDK をリンクします。**AccessKit** (スクリーンリーダー対応) と **ANGLE** (OpenGL ES レンダリングドライバ) です。これらが無い場合、`scons` は警告を出したうえで該当ドライバを無効化してビルドを続行するため、公式 Godot ビルドにある機能を欠いたバイナリができあがります。

`build.sh` / `build.ps1` は、デスクトップ向けの初回ビルド時にこれらを `godot/bin/build_deps/` (Windows では `%LOCALAPPDATA%\Godot\build_deps`) へ自動でダウンロードします。インストーラは `godot/` チェックアウト内のものを使うため、依存のバージョンはビルド対象のエンジンリビジョンと常に一致します。ダウンロードを行わず、該当ドライバ無しでビルドしたい場合は `deps=no` を指定してください。

```sh
./scripts/build.sh deps=no
```

モバイル / Web プラットフォームはどちらの依存も使わないため、ダウンロードは行われません。

#### macOS で Universal Binary をビルドする場合

Homebrew で配布されている `molten-vk` はホストアーキ向けのバイナリのみ提供されるため、`arch=universal` 指定で Universal Binary をビルドする際はリンクに失敗します。代わりに [Vulkan SDK for MoltenVK](https://vulkan.lunarg.com/sdk/home) (Universal 対応版) をインストールしてください。
Expand Down
45 changes: 42 additions & 3 deletions scripts/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ $winbuild_default_opts = @{
cpus = $cpus
ccache = "no"
version = "4.7"
strip = "no"
deps = "yes"
}

$opts = @{}
Expand All @@ -53,6 +55,8 @@ function usage() {
echo " cpus=<nums> number of scons -j option (default: $cpus)"
# echo " ccache=<yes|no> Enable ccache (default: $($winbuild_default_opts.ccache))"
echo " version=<version> Godot version. $APP uses this version at can not getting Godot version from git branch or tag. (default: $($winbuild_default_opts.version))"
echo " strip=<yes|no> Accepted for parity with build.sh; MSVC keeps debug info in a separate .pdb, so nothing is stripped (default: $($winbuild_default_opts.strip))"
echo " deps=<yes|no> Install the missing Godot third-party build dependencies (AccessKit / ANGLE) before building (default: $($winbuild_default_opts.deps))"
echo "Godot scons options: "
pushd $rootDirectory/godot
scons --help
Expand Down Expand Up @@ -97,7 +101,7 @@ if (![string]::IsNullOrEmpty($GODOT_BRANCH)) {
echo "Godot Version: ${VERSION}"

# validate scons command options from winbuild options
$scons_command_opts = "platform=$($internal_opts.platform)"
$scons_command_opts = ""
foreach ($key in $opts.Keys) {
if ($winbuild_default_opts.ContainsKey($key)) {
# skip winbuild default options
Expand All @@ -106,11 +110,46 @@ foreach ($key in $opts.Keys) {
$scons_command_opts += " $key=$($opts[$key])"
}
$j = $opts["cpus"]
$scons_command_opts += "$scons_command_opts -j $j"

$scons_command_opts += " -j $j"

echo "scons command options: $scons_command_opts"

# Godot 4.6+ links two prebuilt third-party SDKs that are not part of the engine
# source tree: AccessKit (screen reader support) and ANGLE (OpenGL ES driver).
# Without them scons silently disables those drivers, so the produced editor and
# templates would lack features the official builds ship with. The installers
# come from the Godot checkout itself, which keeps the dependency versions in
# sync with the engine revision being built.
function install_godot_deps() {
# Mirrors the destination logic of godot/misc/scripts/install_*.py.
if ($env:LOCALAPPDATA -and -not $env:MSYSTEM) {
$deps_dir = Join-Path (Join-Path $env:LOCALAPPDATA "Godot") "build_deps"
} else {
$deps_dir = Join-Path (Join-Path (Join-Path $rootDirectory "godot") "bin") "build_deps"
}

# install_angle.py unpacks one directory per arch (angle-<arch>-<abi>).
$angle_dirs = @(Get-ChildItem -Path $deps_dir -Directory -Filter "angle*" -ErrorAction SilentlyContinue)

# The installers resolve their destination relative to the working directory.
pushd $rootDirectory/godot
if (-not (Test-Path (Join-Path $deps_dir "accesskit"))) {
echo "Installing AccessKit into $deps_dir ..."
python misc/scripts/install_accesskit.py
}
if ($angle_dirs.Count -eq 0) {
echo "Installing ANGLE into $deps_dir ..."
python misc/scripts/install_angle.py
}
popd
}

# AccessKit and ANGLE only apply to the desktop platforms; the mobile and web
# platforms have no such dependency, so skip the download there.
if ($opts.deps -eq "yes" -and @("windows", "win") -contains $opts.platform) {
install_godot_deps
}

pushd $rootDirectory/godot
Invoke-Expression "scons $scons_command_opts"
popd
51 changes: 50 additions & 1 deletion scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ declare -A build_default_opts=(
[ccache]="no"
[version]="4.7"
[strip]="no"
[deps]="yes"
)

declare -A opts=(
Expand All @@ -57,6 +58,7 @@ func usage() {
echo " ccache=<yes|no> Enable ccache (default: ${build_default_opts[ccache]})"
echo " version=<version> Godot version. $APP uses this version at can not getting Godot version from git branch or tag. (default: ${build_default_opts[version]})"
echo " strip=<yes|no> Execute strip command to the app binary (default: ${build_default_opts[strip]})"
echo " deps=<yes|no> Install the missing Godot third-party build dependencies (AccessKit / ANGLE) before building (default: ${build_default_opts[deps]})"
echo "Godot scons options: "
pushd $ROOTDIR/godot > /dev/null
scons --help
Expand Down Expand Up @@ -145,10 +147,57 @@ for key value in ${(kv)opts}; do
fi
scons_command_opts="$scons_command_opts $key=$value"
done
scons_command_opts="$scons_command_opts -j $build_default_opts[cpus]"
scons_command_opts="$scons_command_opts -j ${opts[cpus]}"

echo "scons command options: $scons_command_opts"

# Godot 4.6+ links two prebuilt third-party SDKs that are not part of the engine
# source tree: AccessKit (screen reader support) and ANGLE (OpenGL ES driver).
# Without them scons silently disables those drivers, so the produced editor and
# templates would lack features the official builds ship with. The installers
# come from the Godot checkout itself, which keeps the dependency versions in
# sync with the engine revision being built.
func install_godot_deps() {
# Mirrors the destination logic of godot/misc/scripts/install_*.py.
local deps_dir
if [[ -n ${LOCALAPPDATA} && -z ${MSYSTEM} ]]; then
deps_dir="${LOCALAPPDATA}/Godot/build_deps"
else
deps_dir="${ROOTDIR}/godot/bin/build_deps"
fi

# install_angle.py unpacks one directory per arch (angle-<arch>-<abi>).
local angle_dirs=(${deps_dir}/angle*(N))

local python_bin="python3"
if ! type python3 > /dev/null 2>&1; then
python_bin="python"
fi

# The installers resolve their destination relative to the working directory.
pushd ${ROOTDIR}/godot > /dev/null
if [[ ! -d ${deps_dir}/accesskit ]]; then
echo "Installing AccessKit into ${deps_dir} ..."
${python_bin} misc/scripts/install_accesskit.py
fi
if [[ $1 != "linux" && ${#angle_dirs} -eq 0 ]]; then
echo "Installing ANGLE into ${deps_dir} ..."
${python_bin} misc/scripts/install_angle.py
fi
popd > /dev/null
}

# AccessKit and ANGLE only apply to the desktop platforms; the mobile and web
# platforms have no such dependency, so skip the download there. ANGLE is
# additionally macOS/Windows only.
if [[ ${opts[deps]} == "yes" ]]; then
case ${opts[platform]} in
macos) install_godot_deps macos ;;
win | windows) install_godot_deps windows ;;
linux | linuxbsd) install_godot_deps linux ;;
esac
fi

pushd $ROOTDIR/godot

# enable ccache on Godot
Expand Down
Loading