Merge pull request #117313 from bruvzg/no_dyn
Remove AccessKit dynamic wrappers, add download script and build warning if libs are missing.
This commit is contained in:
commit
075d6f27f1
19 changed files with 185 additions and 20055 deletions
21
.github/workflows/linux_builds.yml
vendored
21
.github/workflows/linux_builds.yml
vendored
|
|
@ -13,7 +13,6 @@ env:
|
|||
SCONS_FLAGS: >-
|
||||
dev_mode=yes
|
||||
module_text_server_fb_enabled=yes
|
||||
"accesskit_sdk_path=${{ github.workspace }}/accesskit-c-0.21.1/"
|
||||
GODOT_CPP_BRANCH: 4.5
|
||||
DOTNET_NOLOGO: true
|
||||
DOTNET_CLI_TELEMETRY_OPTOUT: true
|
||||
|
|
@ -166,15 +165,15 @@ jobs:
|
|||
dotnet-version: 8.0.100
|
||||
|
||||
- name: Download pre-built AccessKit
|
||||
uses: dsaltares/fetch-gh-release-asset@1.1.2
|
||||
with:
|
||||
repo: godotengine/godot-accesskit-c-static
|
||||
version: tags/0.21.1
|
||||
file: accesskit-c-0.21.1.zip
|
||||
target: accesskit-c-0.21.1/accesskit_c.zip
|
||||
|
||||
- name: Extract pre-built AccessKit
|
||||
run: unzip -o accesskit-c-0.21.1/accesskit_c.zip
|
||||
shell: sh
|
||||
id: accesskit-sdk
|
||||
run: |
|
||||
if python ./misc/scripts/install_accesskit.py; then
|
||||
echo "ACCESSKIT_ENABLED=yes" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "::warning::AccessKit SDK installation failed, building without AccessKit support."
|
||||
echo "ACCESSKIT_ENABLED=no" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
- name: Install mold linker
|
||||
if: matrix.proj-test
|
||||
|
|
@ -183,7 +182,7 @@ jobs:
|
|||
- name: Compilation
|
||||
uses: ./.github/actions/godot-build
|
||||
with:
|
||||
scons-flags: ${{ env.SCONS_FLAGS }} ${{ matrix.scons-flags }}
|
||||
scons-flags: ${{ env.SCONS_FLAGS }} ${{ matrix.scons-flags }} accesskit=${{ steps.accesskit-sdk.outputs.ACCESSKIT_ENABLED }}
|
||||
platform: linuxbsd
|
||||
target: ${{ matrix.target }}
|
||||
|
||||
|
|
|
|||
23
.github/workflows/macos_builds.yml
vendored
23
.github/workflows/macos_builds.yml
vendored
|
|
@ -8,7 +8,6 @@ env:
|
|||
SCONS_FLAGS: >-
|
||||
dev_mode=yes
|
||||
module_text_server_fb_enabled=yes
|
||||
"accesskit_sdk_path=${{ github.workspace }}/accesskit-c-0.21.1/"
|
||||
|
||||
jobs:
|
||||
build-macos:
|
||||
|
|
@ -51,15 +50,15 @@ jobs:
|
|||
uses: ./.github/actions/godot-deps
|
||||
|
||||
- name: Download pre-built AccessKit
|
||||
uses: dsaltares/fetch-gh-release-asset@1.1.2
|
||||
with:
|
||||
repo: godotengine/godot-accesskit-c-static
|
||||
version: tags/0.21.1
|
||||
file: accesskit-c-0.21.1.zip
|
||||
target: accesskit-c-0.21.1/accesskit_c.zip
|
||||
|
||||
- name: Extract pre-built AccessKit
|
||||
run: unzip -o accesskit-c-0.21.1/accesskit_c.zip
|
||||
shell: sh
|
||||
id: accesskit-sdk
|
||||
run: |
|
||||
if python3 ./misc/scripts/install_accesskit.py; then
|
||||
echo "ACCESSKIT_ENABLED=yes" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "::warning::AccessKit SDK installation failed, building without AccessKit support."
|
||||
echo "ACCESSKIT_ENABLED=no" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
- name: Setup Vulkan SDK
|
||||
id: vulkan-sdk
|
||||
|
|
@ -75,14 +74,14 @@ jobs:
|
|||
- name: Compilation (x86_64)
|
||||
uses: ./.github/actions/godot-build
|
||||
with:
|
||||
scons-flags: ${{ env.SCONS_FLAGS }} ${{ matrix.scons-flags }} arch=x86_64 vulkan=${{ steps.vulkan-sdk.outputs.VULKAN_ENABLED }}
|
||||
scons-flags: ${{ env.SCONS_FLAGS }} ${{ matrix.scons-flags }} arch=x86_64 vulkan=${{ steps.vulkan-sdk.outputs.VULKAN_ENABLED }} accesskit=${{ steps.accesskit-sdk.outputs.ACCESSKIT_ENABLED }}
|
||||
platform: macos
|
||||
target: ${{ matrix.target }}
|
||||
|
||||
- name: Compilation (arm64)
|
||||
uses: ./.github/actions/godot-build
|
||||
with:
|
||||
scons-flags: ${{ env.SCONS_FLAGS }} ${{ matrix.scons-flags }} arch=arm64 vulkan=${{ steps.vulkan-sdk.outputs.VULKAN_ENABLED }}
|
||||
scons-flags: ${{ env.SCONS_FLAGS }} ${{ matrix.scons-flags }} arch=arm64 vulkan=${{ steps.vulkan-sdk.outputs.VULKAN_ENABLED }} accesskit=${{ steps.accesskit-sdk.outputs.ACCESSKIT_ENABLED }}
|
||||
platform: macos
|
||||
target: ${{ matrix.target }}
|
||||
|
||||
|
|
|
|||
21
.github/workflows/windows_builds.yml
vendored
21
.github/workflows/windows_builds.yml
vendored
|
|
@ -10,7 +10,6 @@ env:
|
|||
module_text_server_fb_enabled=yes
|
||||
debug_symbols=no
|
||||
"angle_libs=${{ github.workspace }}/"
|
||||
"accesskit_sdk_path=${{ github.workspace }}/accesskit-c-0.21.1/"
|
||||
SCONS_CACHE_MSVC_CONFIG: true
|
||||
PYTHONIOENCODING: utf8
|
||||
|
||||
|
|
@ -96,20 +95,20 @@ jobs:
|
|||
run: Expand-Archive -Force angle/angle.zip ${{ github.workspace }}/
|
||||
|
||||
- name: Download pre-built AccessKit
|
||||
uses: dsaltares/fetch-gh-release-asset@1.1.2
|
||||
with:
|
||||
repo: godotengine/godot-accesskit-c-static
|
||||
version: tags/0.21.1
|
||||
file: accesskit-c-0.21.1.zip
|
||||
target: accesskit-c-0.21.1/accesskit_c.zip
|
||||
|
||||
- name: Extract pre-built AccessKit
|
||||
run: unzip -o accesskit-c-0.21.1/accesskit_c.zip
|
||||
shell: sh
|
||||
id: accesskit-sdk
|
||||
run: |
|
||||
if python ./misc/scripts/install_accesskit.py; then
|
||||
echo "ACCESSKIT_ENABLED=yes" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "::warning::AccessKit SDK installation failed, building without AccessKit support."
|
||||
echo "ACCESSKIT_ENABLED=no" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
- name: Compilation
|
||||
uses: ./.github/actions/godot-build
|
||||
with:
|
||||
scons-flags: ${{ env.SCONS_FLAGS }} ${{ matrix.scons-flags }} d3d12=${{ steps.d3d12-sdk.outputs.D3D12_ENABLED }}
|
||||
scons-flags: ${{ env.SCONS_FLAGS }} ${{ matrix.scons-flags }} d3d12=${{ steps.d3d12-sdk.outputs.D3D12_ENABLED }} accesskit=${{ steps.accesskit-sdk.outputs.ACCESSKIT_ENABLED }}
|
||||
platform: windows
|
||||
target: ${{ matrix.target }}
|
||||
|
||||
|
|
|
|||
|
|
@ -199,8 +199,7 @@ opts.Add(BoolVariable("opengl3", "Enable the OpenGL/GLES3 rendering driver", Tru
|
|||
opts.Add(BoolVariable("d3d12", "Enable the Direct3D 12 rendering driver on supported platforms", False))
|
||||
opts.Add(BoolVariable("metal", "Enable the Metal rendering driver on supported platforms (Apple arm64 only)", False))
|
||||
opts.Add(BoolVariable("use_volk", "Use the volk library to load the Vulkan loader dynamically", True))
|
||||
opts.Add(BoolVariable("accesskit", "Use AccessKit C SDK", True))
|
||||
opts.Add(("accesskit_sdk_path", "Path to the AccessKit C SDK", ""))
|
||||
opts.Add(BoolVariable("accesskit", "Enable the AccessKit driver for screen reader support", True))
|
||||
opts.Add(BoolVariable("sdl", "Enable the SDL3 input driver", True))
|
||||
opts.Add(
|
||||
EnumVariable(
|
||||
|
|
|
|||
|
|
@ -5,12 +5,3 @@ Import("env")
|
|||
|
||||
# Driver source files
|
||||
env.add_source_files(env.drivers_sources, "accessibility_server_accesskit.cpp")
|
||||
|
||||
if env["accesskit_sdk_path"] == "":
|
||||
if env["platform"] == "windows":
|
||||
env.add_source_files(env.drivers_sources, "dynwrappers/accesskit-dll_wrap.c")
|
||||
if env["platform"] == "macos":
|
||||
env.add_source_files(env.drivers_sources, "dynwrappers/accesskit-dylib_wrap.c")
|
||||
if env["platform"] == "linuxbsd":
|
||||
env.add_source_files(env.drivers_sources, "dynwrappers/accesskit-so_wrap.c")
|
||||
env.Prepend(CPPPATH=["#thirdparty/accesskit/include"])
|
||||
|
|
|
|||
|
|
@ -32,12 +32,6 @@
|
|||
|
||||
#include "accessibility_server_accesskit.h"
|
||||
|
||||
#ifdef ACCESSKIT_DYNAMIC
|
||||
#include "core/config/engine.h"
|
||||
#include "core/io/file_access.h"
|
||||
#include "core/os/os.h"
|
||||
#endif
|
||||
|
||||
#include "servers/text/text_server.h"
|
||||
|
||||
_FORCE_INLINE_ accesskit_role AccessibilityServerAccessKit::_accessibility_role(AccessibilityServerEnums::AccessibilityRole p_role) const {
|
||||
|
|
@ -1707,64 +1701,6 @@ void AccessibilityServerAccessKit::update_set_foreground_color(const RID &p_id,
|
|||
}
|
||||
|
||||
AccessibilityServer *AccessibilityServerAccessKit::create_func(Error &r_error) {
|
||||
#ifdef ACCESSKIT_DYNAMIC
|
||||
#ifdef DEBUG_ENABLED
|
||||
int dylibloader_verbose = 1;
|
||||
#else
|
||||
int dylibloader_verbose = 0;
|
||||
#endif
|
||||
void *library_handle = nullptr;
|
||||
String path;
|
||||
String arch = Engine::get_singleton()->get_architecture_name();
|
||||
#ifdef LINUXBSD_ENABLED
|
||||
path = OS::get_singleton()->get_executable_path().get_base_dir().path_join("libaccesskit." + arch + ".so");
|
||||
if (!FileAccess::exists(path)) {
|
||||
path = OS::get_singleton()->get_executable_path().get_base_dir().path_join("../lib").path_join("libaccesskit." + arch + ".so");
|
||||
}
|
||||
if (!FileAccess::exists(path)) {
|
||||
path = OS::get_singleton()->get_executable_path().get_base_dir().path_join("libaccesskit.so");
|
||||
}
|
||||
if (!FileAccess::exists(path)) {
|
||||
path = OS::get_singleton()->get_executable_path().get_base_dir().path_join("../lib").path_join("libaccesskit.so");
|
||||
}
|
||||
if (!FileAccess::exists(path)) {
|
||||
r_error = ERR_CANT_CREATE;
|
||||
return nullptr;
|
||||
}
|
||||
#endif
|
||||
#ifdef MACOS_ENABLED
|
||||
path = OS::get_singleton()->get_executable_path().get_base_dir().path_join("libaccesskit." + arch + ".dylib");
|
||||
if (!FileAccess::exists(path)) {
|
||||
path = OS::get_singleton()->get_executable_path().get_base_dir().path_join("../Frameworks").path_join("libaccesskit." + arch + ".dylib");
|
||||
}
|
||||
if (!FileAccess::exists(path)) {
|
||||
path = OS::get_singleton()->get_executable_path().get_base_dir().path_join("libaccesskit.dylib");
|
||||
}
|
||||
if (!FileAccess::exists(path)) {
|
||||
path = OS::get_singleton()->get_executable_path().get_base_dir().path_join("../Frameworks").path_join("libaccesskit.dylib");
|
||||
}
|
||||
if (!FileAccess::exists(path)) {
|
||||
r_error = ERR_CANT_CREATE;
|
||||
return nullptr;
|
||||
}
|
||||
#endif
|
||||
#ifdef WINDOWS_ENABLED
|
||||
path = OS::get_singleton()->get_executable_path().get_base_dir().path_join("accesskit." + arch + ".dll");
|
||||
if (!FileAccess::exists(path)) {
|
||||
path = OS::get_singleton()->get_executable_path().get_base_dir().path_join("accesskit.dll");
|
||||
}
|
||||
if (!FileAccess::exists(path)) {
|
||||
r_error = ERR_CANT_CREATE;
|
||||
return nullptr;
|
||||
}
|
||||
#endif
|
||||
|
||||
Error err = OS::get_singleton()->open_dynamic_library(path, library_handle);
|
||||
if (err != OK || initialize_libaccesskit(dylibloader_verbose, library_handle) != 0) {
|
||||
r_error = ERR_CANT_CREATE;
|
||||
return nullptr;
|
||||
}
|
||||
#endif
|
||||
print_verbose("Accessibility: AccessKit driver loaded.");
|
||||
r_error = OK;
|
||||
return memnew(AccessibilityServerAccessKit);
|
||||
|
|
|
|||
|
|
@ -35,19 +35,7 @@
|
|||
#include "core/templates/rid_owner.h"
|
||||
#include "servers/display/accessibility_server.h"
|
||||
|
||||
#ifdef ACCESSKIT_DYNAMIC
|
||||
#ifdef LINUXBSD_ENABLED
|
||||
#include "drivers/accesskit/dynwrappers/accesskit-so_wrap.h"
|
||||
#endif
|
||||
#ifdef MACOS_ENABLED
|
||||
#include "drivers/accesskit/dynwrappers/accesskit-dylib_wrap.h"
|
||||
#endif
|
||||
#ifdef WINDOWS_ENABLED
|
||||
#include "drivers/accesskit/dynwrappers/accesskit-dll_wrap.h"
|
||||
#endif
|
||||
#else
|
||||
#include <accesskit.h>
|
||||
#endif
|
||||
|
||||
class AccessibilityServerAccessKit : public AccessibilityServer {
|
||||
GDSOFTCLASS(AccessibilityServerAccessKit, AccessibilityServer);
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -120,7 +120,7 @@ if (
|
|||
):
|
||||
print_error(
|
||||
"The Direct3D 12 rendering driver dependencies are outdated or missing.\n"
|
||||
"You can re-install them by running `python misc\\scripts\\install_d3d12_sdk_windows.py`.\n"
|
||||
f"You can re-install them by running `python {os.path.join('misc', 'scripts', 'install_d3d12_sdk_windows.py')}`.\n"
|
||||
)
|
||||
sys.exit(255)
|
||||
|
||||
|
|
|
|||
49
misc/scripts/install_accesskit.py
Executable file
49
misc/scripts/install_accesskit.py
Executable file
|
|
@ -0,0 +1,49 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
if __name__ != "__main__":
|
||||
raise SystemExit(f'Utility script "{__file__}" should not be used as a module!')
|
||||
|
||||
import os
|
||||
import shutil
|
||||
import sys
|
||||
import urllib.request
|
||||
|
||||
sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "../../"))
|
||||
|
||||
|
||||
# Base Godot dependencies path
|
||||
# If cross-compiling (no LOCALAPPDATA), we install in `bin`
|
||||
deps_folder = os.getenv("LOCALAPPDATA")
|
||||
if deps_folder:
|
||||
deps_folder = os.path.join(deps_folder, "Godot", "build_deps")
|
||||
else:
|
||||
deps_folder = os.path.join("bin", "build_deps")
|
||||
|
||||
# AccessKit
|
||||
ac_version = "0.21.1"
|
||||
|
||||
# Create dependencies folder
|
||||
if not os.path.exists(deps_folder):
|
||||
os.makedirs(deps_folder)
|
||||
|
||||
ac_filename = "accesskit-c-" + ac_version + ".zip"
|
||||
ac_archive = os.path.join(deps_folder, "accesskit.zip")
|
||||
ac_folder = os.path.join(deps_folder, "accesskit")
|
||||
|
||||
if os.path.isfile(ac_archive):
|
||||
os.remove(ac_archive)
|
||||
|
||||
print(f"Downloading AccessKit {ac_filename} ...")
|
||||
urllib.request.urlretrieve(
|
||||
f"https://github.com/godotengine/godot-accesskit-c-static/releases/download/{ac_version}/{ac_filename}",
|
||||
ac_archive,
|
||||
)
|
||||
if os.path.exists(ac_folder):
|
||||
print(f"Removing existing local AccessKit installation in {ac_folder} ...")
|
||||
shutil.rmtree(ac_folder)
|
||||
print(f"Extracting AccessKit {ac_filename} to {ac_folder} ...")
|
||||
shutil.unpack_archive(ac_archive, deps_folder)
|
||||
os.remove(ac_archive)
|
||||
os.rename(os.path.join(deps_folder, "accesskit-c-" + ac_version), ac_folder)
|
||||
|
||||
print("AccessKit installed successfully.\n")
|
||||
|
|
@ -191,7 +191,7 @@ def configure(env: "SConsEnvironment"):
|
|||
has_swappy = detect_swappy()
|
||||
if not has_swappy:
|
||||
print_warning(
|
||||
"Swappy Frame Pacing not detected! It is strongly recommended you run `python misc/scripts/install_swappy_android.py` to download and install Swappy before compiling.\n"
|
||||
f"Swappy Frame Pacing not detected! It is strongly recommended you run `python {os.path.join('misc', 'scripts', 'install_swappy_android.py')}` to download and install Swappy before compiling.\n"
|
||||
+ "Without Swappy, Godot apps on Android will inevitably suffer stutter and struggle to keep a consistent framerate. Although Swappy cannot guarantee your app will be stutter-free, not having Swappy will guarantee there will be stutter even on the best phones and the most simple of scenes."
|
||||
)
|
||||
if env["swappy"]:
|
||||
|
|
|
|||
|
|
@ -29,6 +29,22 @@ def can_build():
|
|||
def get_opts():
|
||||
from SCons.Variables import BoolVariable, EnumVariable
|
||||
|
||||
# Dependencies folder.
|
||||
deps_folder = os.getenv("LOCALAPPDATA")
|
||||
if deps_folder:
|
||||
deps_folder = os.path.join(deps_folder, "Godot", "build_deps")
|
||||
else:
|
||||
# Cross-compiling, the deps install script puts things in `bin`.
|
||||
# Getting an absolute path to it is a bit hacky in Python.
|
||||
try:
|
||||
import inspect
|
||||
|
||||
caller_frame = inspect.stack()[1]
|
||||
caller_script_dir = os.path.dirname(os.path.abspath(caller_frame[1]))
|
||||
deps_folder = os.path.join(caller_script_dir, "bin", "build_deps")
|
||||
except Exception: # Give up.
|
||||
deps_folder = ""
|
||||
|
||||
return [
|
||||
EnumVariable("linker", "Linker program", "default", ["default", "bfd", "gold", "lld", "mold"], ignorecase=2),
|
||||
BoolVariable("use_llvm", "Use the LLVM compiler", False),
|
||||
|
|
@ -51,6 +67,12 @@ def get_opts():
|
|||
BoolVariable("libdecor", "Enable libdecor support", True),
|
||||
BoolVariable("touch", "Enable touch events", True),
|
||||
BoolVariable("execinfo", "Use libexecinfo on systems where glibc is not available", False),
|
||||
# Screen reader support.
|
||||
(
|
||||
"accesskit_sdk_path",
|
||||
"Path to the AccessKit C SDK",
|
||||
os.path.join(deps_folder, "accesskit"),
|
||||
),
|
||||
]
|
||||
|
||||
|
||||
|
|
@ -495,7 +517,7 @@ def configure(env: "SConsEnvironment"):
|
|||
env.Append(LIBS=["rt"]) # Needed by glibc, used by _allocate_shm_file
|
||||
|
||||
if env["accesskit"]:
|
||||
if env["accesskit_sdk_path"] != "":
|
||||
if os.path.exists(env["accesskit_sdk_path"]):
|
||||
env.Prepend(CPPPATH=[env["accesskit_sdk_path"] + "/include"])
|
||||
if env["arch"] == "arm64":
|
||||
env.Append(LIBPATH=[env["accesskit_sdk_path"] + "/lib/linux/arm64/static/"])
|
||||
|
|
@ -508,9 +530,16 @@ def configure(env: "SConsEnvironment"):
|
|||
elif env["arch"] == "x86_32":
|
||||
env.Append(LIBPATH=[env["accesskit_sdk_path"] + "/lib/linux/x86/static/"])
|
||||
env.Append(LIBS=["accesskit"])
|
||||
env.Append(CPPDEFINES=["ACCESSKIT_ENABLED"])
|
||||
else:
|
||||
env.Append(CPPDEFINES=["ACCESSKIT_DYNAMIC"])
|
||||
env.Append(CPPDEFINES=["ACCESSKIT_ENABLED"])
|
||||
print_warning(
|
||||
"The screen reader support driver requires dependencies to be installed.\n"
|
||||
f"You can install them by running `python {os.path.join('misc', 'scripts', 'install_accesskit.py')}`.\n"
|
||||
"See the documentation for more information:\n"
|
||||
"\thttps://docs.godotengine.org/en/latest/engine_details/development/compiling/compiling_for_linuxbsd.html\n"
|
||||
"Alternatively, disable this driver by compiling with `accesskit=no` explicitly."
|
||||
)
|
||||
env["accesskit"] = False
|
||||
|
||||
if env["vulkan"]:
|
||||
env.Append(CPPDEFINES=["VULKAN_ENABLED", "RD_ENABLED"])
|
||||
|
|
|
|||
|
|
@ -27,6 +27,22 @@ def can_build():
|
|||
def get_opts():
|
||||
from SCons.Variables import BoolVariable, EnumVariable
|
||||
|
||||
# Dependencies folder.
|
||||
deps_folder = os.getenv("LOCALAPPDATA")
|
||||
if deps_folder:
|
||||
deps_folder = os.path.join(deps_folder, "Godot", "build_deps")
|
||||
else:
|
||||
# Cross-compiling, the deps install script puts things in `bin`.
|
||||
# Getting an absolute path to it is a bit hacky in Python.
|
||||
try:
|
||||
import inspect
|
||||
|
||||
caller_frame = inspect.stack()[1]
|
||||
caller_script_dir = os.path.dirname(os.path.abspath(caller_frame[1]))
|
||||
deps_folder = os.path.join(caller_script_dir, "bin", "build_deps")
|
||||
except Exception: # Give up.
|
||||
deps_folder = ""
|
||||
|
||||
return [
|
||||
("osxcross_sdk", "OSXCross SDK version", "darwin16"),
|
||||
("SWIFT_FRONTEND", "Path to the swift-frontend binary", ""),
|
||||
|
|
@ -37,6 +53,12 @@ def get_opts():
|
|||
BoolVariable("use_asan", "Use LLVM/GCC compiler address sanitizer (ASAN)", False),
|
||||
BoolVariable("use_tsan", "Use LLVM/GCC compiler thread sanitizer (TSAN)", False),
|
||||
BoolVariable("use_coverage", "Use instrumentation codes in the binary (e.g. for code coverage)", False),
|
||||
# Screen reader support.
|
||||
(
|
||||
"accesskit_sdk_path",
|
||||
"Path to the AccessKit C SDK",
|
||||
os.path.join(deps_folder, "accesskit"),
|
||||
),
|
||||
("angle_libs", "Path to the ANGLE static libraries", ""),
|
||||
(
|
||||
"bundle_sign_identity",
|
||||
|
|
@ -187,16 +209,24 @@ def configure(env: "SConsEnvironment"):
|
|||
## Dependencies
|
||||
|
||||
if env["accesskit"]:
|
||||
if env["accesskit_sdk_path"] != "":
|
||||
if os.path.exists(env["accesskit_sdk_path"]):
|
||||
env.Prepend(CPPPATH=[env["accesskit_sdk_path"] + "/include"])
|
||||
env.Prepend(CPPPATH=[env["accesskit_sdk_path"] + "/include"])
|
||||
if env["arch"] == "arm64" or env["arch"] == "universal":
|
||||
env.Append(LINKFLAGS=["-L" + env["accesskit_sdk_path"] + "/lib/macos/arm64/static/"])
|
||||
if env["arch"] == "x86_64" or env["arch"] == "universal":
|
||||
env.Append(LINKFLAGS=["-L" + env["accesskit_sdk_path"] + "/lib/macos/x86_64/static/"])
|
||||
env.Append(LINKFLAGS=["-laccesskit"])
|
||||
env.Append(CPPDEFINES=["ACCESSKIT_ENABLED"])
|
||||
else:
|
||||
env.Append(CPPDEFINES=["ACCESSKIT_DYNAMIC"])
|
||||
env.Append(CPPDEFINES=["ACCESSKIT_ENABLED"])
|
||||
print_warning(
|
||||
"The screen reader support driver requires dependencies to be installed.\n"
|
||||
f"You can install them by running `python3 {os.path.join('misc', 'scripts', 'install_accesskit.py')}`.\n"
|
||||
"See the documentation for more information:\n"
|
||||
"\thttps://docs.godotengine.org/en/latest/engine_details/development/compiling/compiling_for_macos.html\n"
|
||||
"Alternatively, disable this driver by compiling with `accesskit=no` explicitly."
|
||||
)
|
||||
env["accesskit"] = False
|
||||
|
||||
if env["builtin_libtheora"] and env["arch"] == "x86_64":
|
||||
env["x86_libtheora_opt_gcc"] = True
|
||||
|
|
|
|||
|
|
@ -166,10 +166,10 @@ def get_opts():
|
|||
|
||||
mingw = os.getenv("MINGW_PREFIX", "")
|
||||
|
||||
# Direct3D 12 SDK dependencies folder.
|
||||
d3d12_deps_folder = os.getenv("LOCALAPPDATA")
|
||||
if d3d12_deps_folder:
|
||||
d3d12_deps_folder = os.path.join(d3d12_deps_folder, "Godot", "build_deps")
|
||||
# Dependencies folder.
|
||||
deps_folder = os.getenv("LOCALAPPDATA")
|
||||
if deps_folder:
|
||||
deps_folder = os.path.join(deps_folder, "Godot", "build_deps")
|
||||
else:
|
||||
# Cross-compiling, the deps install script puts things in `bin`.
|
||||
# Getting an absolute path to it is a bit hacky in Python.
|
||||
|
|
@ -178,9 +178,9 @@ def get_opts():
|
|||
|
||||
caller_frame = inspect.stack()[1]
|
||||
caller_script_dir = os.path.dirname(os.path.abspath(caller_frame[1]))
|
||||
d3d12_deps_folder = os.path.join(caller_script_dir, "bin", "build_deps")
|
||||
deps_folder = os.path.join(caller_script_dir, "bin", "build_deps")
|
||||
except Exception: # Give up.
|
||||
d3d12_deps_folder = ""
|
||||
deps_folder = ""
|
||||
|
||||
return [
|
||||
("mingw_prefix", "MinGW prefix", mingw),
|
||||
|
|
@ -194,17 +194,23 @@ def get_opts():
|
|||
BoolVariable("debug_crt", "Compile with MSVC's debug CRT (/MDd)", False),
|
||||
BoolVariable("incremental_link", "Use MSVC incremental linking. May increase or decrease build times.", False),
|
||||
BoolVariable("silence_msvc", "Silence MSVC's cl/link stdout bloat, redirecting any errors to stderr.", True),
|
||||
# Screen reader support.
|
||||
(
|
||||
"accesskit_sdk_path",
|
||||
"Path to the AccessKit C SDK",
|
||||
os.path.join(deps_folder, "accesskit"),
|
||||
),
|
||||
("angle_libs", "Path to the ANGLE static libraries", ""),
|
||||
# Direct3D 12 support.
|
||||
(
|
||||
"mesa_libs",
|
||||
"Path to the MESA/NIR static libraries (required for D3D12)",
|
||||
os.path.join(d3d12_deps_folder, "mesa"),
|
||||
os.path.join(deps_folder, "mesa"),
|
||||
),
|
||||
(
|
||||
"agility_sdk_path",
|
||||
"Path to the Agility SDK distribution (optional for D3D12)",
|
||||
os.path.join(d3d12_deps_folder, "agility_sdk"),
|
||||
os.path.join(deps_folder, "agility_sdk"),
|
||||
),
|
||||
BoolVariable(
|
||||
"agility_sdk_multiarch",
|
||||
|
|
@ -215,7 +221,7 @@ def get_opts():
|
|||
(
|
||||
"pix_path",
|
||||
"Path to the PIX runtime distribution (optional for D3D12)",
|
||||
os.path.join(d3d12_deps_folder, "pix"),
|
||||
os.path.join(deps_folder, "pix"),
|
||||
),
|
||||
]
|
||||
|
||||
|
|
@ -414,7 +420,7 @@ def configure_msvc(env: "SConsEnvironment"):
|
|||
LIBS += ["psapi", "dbghelp"]
|
||||
|
||||
if env["accesskit"]:
|
||||
if env["accesskit_sdk_path"] != "":
|
||||
if os.path.exists(env["accesskit_sdk_path"]):
|
||||
env.Prepend(CPPPATH=[env["accesskit_sdk_path"] + "/include"])
|
||||
if env["arch"] == "arm64":
|
||||
env.Append(LIBPATH=[env["accesskit_sdk_path"] + "/lib/windows/arm64/msvc/static"])
|
||||
|
|
@ -432,9 +438,16 @@ def configure_msvc(env: "SConsEnvironment"):
|
|||
"userenv",
|
||||
"ntdll",
|
||||
]
|
||||
env.Append(CPPDEFINES=["ACCESSKIT_ENABLED"])
|
||||
else:
|
||||
env.Append(CPPDEFINES=["ACCESSKIT_DYNAMIC"])
|
||||
env.Append(CPPDEFINES=["ACCESSKIT_ENABLED"])
|
||||
print_error(
|
||||
"The screen reader support driver requires dependencies to be installed.\n"
|
||||
f"You can install them by running `python {os.path.join('misc', 'scripts', 'install_accesskit.py')}`.\n"
|
||||
"See the documentation for more information:\n"
|
||||
"\thttps://docs.godotengine.org/en/latest/engine_details/development/compiling/compiling_for_windows.html\n"
|
||||
"Alternatively, disable this driver by compiling with `accesskit=no` explicitly."
|
||||
)
|
||||
env["accesskit"] = False
|
||||
|
||||
if env["vulkan"]:
|
||||
env.AppendUnique(CPPDEFINES=["VULKAN_ENABLED", "RD_ENABLED"])
|
||||
|
|
@ -788,7 +801,7 @@ def configure_mingw(env: "SConsEnvironment"):
|
|||
)
|
||||
|
||||
if env["accesskit"]:
|
||||
if env["accesskit_sdk_path"] != "":
|
||||
if os.path.exists(env["accesskit_sdk_path"]):
|
||||
env.Prepend(CPPPATH=[env["accesskit_sdk_path"] + "/include"])
|
||||
if env["use_llvm"]:
|
||||
if env["arch"] == "arm64":
|
||||
|
|
@ -815,10 +828,17 @@ def configure_mingw(env: "SConsEnvironment"):
|
|||
"ntdll",
|
||||
]
|
||||
)
|
||||
env.Append(LIBPATH=["#platform/windows"])
|
||||
env.Append(CPPDEFINES=["ACCESSKIT_ENABLED"])
|
||||
else:
|
||||
env.Append(CPPDEFINES=["ACCESSKIT_DYNAMIC"])
|
||||
env.Append(LIBPATH=["#platform/windows"])
|
||||
env.Append(CPPDEFINES=["ACCESSKIT_ENABLED"])
|
||||
print_warning(
|
||||
"The screen reader support driver requires dependencies to be installed.\n"
|
||||
f"You can install them by running `python {os.path.join('misc', 'scripts', 'install_accesskit.py')}`.\n"
|
||||
"See the documentation for more information:\n"
|
||||
"\thttps://docs.godotengine.org/en/latest/engine_details/development/compiling/compiling_for_windows.html\n"
|
||||
"Alternatively, disable this driver by compiling with `accesskit=no` explicitly."
|
||||
)
|
||||
env["accesskit"] = False
|
||||
|
||||
if env.debug_features:
|
||||
env.Append(LIBS=["psapi", "dbghelp"])
|
||||
|
|
@ -927,7 +947,7 @@ def check_d3d12_installed(env, suffix):
|
|||
if not os.path.exists(env["mesa_libs"]) and not os.path.exists(env["mesa_libs"] + "-" + suffix):
|
||||
print_error(
|
||||
"The Direct3D 12 rendering driver requires dependencies to be installed.\n"
|
||||
"You can install them by running `python misc\\scripts\\install_d3d12_sdk_windows.py`.\n"
|
||||
f"You can install them by running `python {os.path.join('misc', 'scripts', 'install_d3d12_sdk_windows.py')}`.\n"
|
||||
"See the documentation for more information:\n"
|
||||
"\thttps://docs.godotengine.org/en/latest/engine_details/development/compiling/compiling_for_windows.html\n"
|
||||
"Alternatively, disable this driver by compiling with `d3d12=no` explicitly."
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue