mirror of
https://github.com/godotengine/godot-cpp.git
synced 2026-01-03 18:09:13 +03:00
Compare commits
12 Commits
godot-3.5-
...
3.x
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
07153d40e0 | ||
|
|
cc8c15c32f | ||
|
|
a4aecf3295 | ||
|
|
0c3672e494 | ||
|
|
5f401ad88a | ||
|
|
bbcf901eab | ||
|
|
102e3c8d16 | ||
|
|
7c09b5484d | ||
|
|
686db8ea6e | ||
|
|
97c181a246 | ||
|
|
62714899ff | ||
|
|
02333f8dae |
22
.github/actions/godot-cache/action.yml
vendored
Normal file
22
.github/actions/godot-cache/action.yml
vendored
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
name: Setup Godot build cache
|
||||||
|
description: Setup Godot build cache.
|
||||||
|
inputs:
|
||||||
|
cache-name:
|
||||||
|
description: The cache base name (job name by default).
|
||||||
|
default: "${{github.job}}"
|
||||||
|
scons-cache:
|
||||||
|
description: The scons cache path.
|
||||||
|
default: "${{github.workspace}}/.scons-cache/"
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
# Upload cache on completion and check it out now
|
||||||
|
- name: Load .scons_cache directory
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: ${{inputs.scons-cache}}
|
||||||
|
key: ${{inputs.cache-name}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
|
||||||
|
restore-keys: |
|
||||||
|
${{inputs.cache-name}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
|
||||||
|
${{inputs.cache-name}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}
|
||||||
|
${{inputs.cache-name}}-${{env.GODOT_BASE_BRANCH}}
|
||||||
63
.github/workflows/ci.yml
vendored
63
.github/workflows/ci.yml
vendored
@@ -1,6 +1,14 @@
|
|||||||
name: Continuous integration
|
name: Continuous integration
|
||||||
on: [push, pull_request]
|
on: [push, pull_request]
|
||||||
|
|
||||||
|
env:
|
||||||
|
# Only used for the cache key. Increment version to force clean build.
|
||||||
|
GODOT_BASE_BRANCH: 3.x
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: ${{ matrix.name }}
|
name: ${{ matrix.name }}
|
||||||
@@ -10,54 +18,69 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- name: 🐧 Linux (GCC)
|
- name: 🐧 Linux (GCC)
|
||||||
os: ubuntu-18.04
|
os: ubuntu-20.04
|
||||||
platform: linux
|
platform: linux
|
||||||
artifact-name: godot-cpp-linux-glibc2.27-x86_64-release
|
artifact-name: godot-cpp-linux-glibc2.31-x86_64-release
|
||||||
artifact-path: bin/libgodot-cpp.linux.release.64.a
|
artifact-path: bin/libgodot-cpp.linux.release.64.a
|
||||||
godot_zip: Godot_v3.4-stable_linux_server.64.zip
|
godot_zip: Godot_v3.5-stable_linux_server.64.zip
|
||||||
executable: Godot_v3.4-stable_linux_server.64
|
executable: Godot_v3.5-stable_linux_server.64
|
||||||
|
cache-name: linux-x86_64
|
||||||
|
|
||||||
- name: 🏁 Windows (x86_64, MSVC)
|
- name: 🏁 Windows (x86_64, MSVC)
|
||||||
os: windows-2019
|
os: windows-2022
|
||||||
platform: windows
|
platform: windows
|
||||||
artifact-name: godot-cpp-windows-msvc2019-x86_64-release
|
artifact-name: godot-cpp-windows-msvc2019-x86_64-release
|
||||||
artifact-path: bin/libgodot-cpp.windows.release.64.lib
|
artifact-path: bin/libgodot-cpp.windows.release.64.lib
|
||||||
|
cache-name: windows-x86_64-msvc
|
||||||
|
|
||||||
- name: 🏁 Windows (x86_64, MinGW)
|
- name: 🏁 Windows (x86_64, MinGW)
|
||||||
os: windows-2019
|
os: windows-2022
|
||||||
platform: windows
|
platform: windows
|
||||||
artifact-name: godot-cpp-linux-mingw-x86_64-release
|
artifact-name: godot-cpp-linux-mingw-x86_64-release
|
||||||
artifact-path: bin/libgodot-cpp.windows.release.64.a
|
artifact-path: bin/libgodot-cpp.windows.release.64.a
|
||||||
flags: use_mingw=yes
|
flags: use_mingw=yes
|
||||||
|
cache-name: windows-x86_64-mingw
|
||||||
|
|
||||||
- name: 🍎 macOS (universal)
|
- name: 🍎 macOS (universal)
|
||||||
os: macos-11
|
os: macos-13
|
||||||
platform: osx
|
platform: osx
|
||||||
artifact-name: godot-cpp-macos-universal-release
|
artifact-name: godot-cpp-macos-universal-release
|
||||||
artifact-path: bin/libgodot-cpp.osx.release.64.a
|
artifact-path: bin/libgodot-cpp.osx.release.64.a
|
||||||
flags: macos_arch=universal
|
flags: macos_arch=universal
|
||||||
godot_zip: Godot_v3.4-stable_osx.universal.zip
|
godot_zip: Godot_v3.5-stable_osx.universal.zip
|
||||||
executable: Godot.app/Contents/MacOS/Godot
|
executable: Godot.app/Contents/MacOS/Godot
|
||||||
|
cache-name: macos-unversal
|
||||||
|
|
||||||
- name: 🤖 Android (arm64)
|
- name: 🤖 Android (arm64)
|
||||||
os: ubuntu-18.04
|
os: ubuntu-20.04
|
||||||
platform: android
|
platform: android
|
||||||
artifact-name: godot-cpp-android-arm64-release
|
artifact-name: godot-cpp-android-arm64-release
|
||||||
artifact-path: bin/libgodot-cpp.android.release.arm64v8.a
|
artifact-path: bin/libgodot-cpp.android.release.arm64v8.a
|
||||||
flags: android_arch=arm64v8
|
flags: ANDROID_NDK_ROOT=$ANDROID_NDK_LATEST_HOME android_arch=arm64v8
|
||||||
|
cache-name: android-arm64
|
||||||
|
|
||||||
- name: 🍏 iOS (arm64)
|
- name: 🍏 iOS (arm64)
|
||||||
os: macos-11
|
os: macos-13
|
||||||
platform: ios
|
platform: ios
|
||||||
artifact-name: godot-cpp-ios-arm64-release
|
artifact-name: godot-cpp-ios-arm64-release
|
||||||
artifact-path: bin/libgodot-cpp.ios.release.arm64.a
|
artifact-path: bin/libgodot-cpp.ios.release.arm64.a
|
||||||
|
cache-name: ios-arm64
|
||||||
|
|
||||||
|
env:
|
||||||
|
SCONS_CACHE: ${{ github.workspace }}/.scons-cache/
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
|
- name: Setup Godot build cache
|
||||||
|
uses: ./.github/actions/godot-cache
|
||||||
|
with:
|
||||||
|
cache-name: ${{ matrix.cache-name }}
|
||||||
|
continue-on-error: true
|
||||||
|
|
||||||
- name: Set up Python (for SCons)
|
- name: Set up Python (for SCons)
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
@@ -76,10 +99,12 @@ jobs:
|
|||||||
- name: Windows dependency (MinGW)
|
- name: Windows dependency (MinGW)
|
||||||
if: ${{ matrix.platform == 'windows' }}
|
if: ${{ matrix.platform == 'windows' }}
|
||||||
uses: egor-tensin/setup-mingw@v2
|
uses: egor-tensin/setup-mingw@v2
|
||||||
|
with:
|
||||||
|
version: 12.2.0
|
||||||
|
|
||||||
- name: Build godot-cpp (debug)
|
- name: Build godot-cpp (debug)
|
||||||
run: |
|
run: |
|
||||||
scons platform=${{ matrix.platform }} target=debug generate_bindings=yes ${{ matrix.flags }}
|
scons platform=${{ matrix.platform }} target=debug ${{ matrix.flags }}
|
||||||
|
|
||||||
- name: Build test without rebuilding godot-cpp (debug)
|
- name: Build test without rebuilding godot-cpp (debug)
|
||||||
run: |
|
run: |
|
||||||
@@ -94,7 +119,7 @@ jobs:
|
|||||||
- name: Run test GDNative library
|
- name: Run test GDNative library
|
||||||
if: ${{ matrix.platform == 'linux' || matrix.platform == 'osx' }}
|
if: ${{ matrix.platform == 'linux' || matrix.platform == 'osx' }}
|
||||||
run: |
|
run: |
|
||||||
curl -LO https://downloads.tuxfamily.org/godotengine/3.4/${{ matrix.godot_zip }}
|
curl -LO https://downloads.tuxfamily.org/godotengine/3.5/${{ matrix.godot_zip }}
|
||||||
unzip ${{ matrix.godot_zip }}
|
unzip ${{ matrix.godot_zip }}
|
||||||
./${{ matrix.executable }} --path test -s script.gd
|
./${{ matrix.executable }} --path test -s script.gd
|
||||||
|
|
||||||
@@ -106,11 +131,13 @@ jobs:
|
|||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
static-checks:
|
static-checks:
|
||||||
name: Static Checks (clang-format)
|
name: 📊 Static Checks (clang-format)
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
- name: Make apt sources.list use the default Ubuntu repositories
|
- name: Make apt sources.list use the default Ubuntu repositories
|
||||||
run: |
|
run: |
|
||||||
@@ -127,3 +154,7 @@ jobs:
|
|||||||
- name: Style checks via clang-format
|
- name: Style checks via clang-format
|
||||||
run: |
|
run: |
|
||||||
bash ./misc/scripts/clang_format.sh
|
bash ./misc/scripts/clang_format.sh
|
||||||
|
|
||||||
|
- name: Bindings generation checks (ensures get_file_list returns all generated files)
|
||||||
|
run: |
|
||||||
|
python ./misc/scripts/check_get_file_list.py
|
||||||
|
|||||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -1,7 +1,11 @@
|
|||||||
# Misc
|
# Misc
|
||||||
|
gen/*
|
||||||
logs/*
|
logs/*
|
||||||
*.log
|
*.log
|
||||||
|
|
||||||
|
# The default cache directory
|
||||||
|
.scons_cache/
|
||||||
|
|
||||||
# Binaries
|
# Binaries
|
||||||
*.o
|
*.o
|
||||||
*.os
|
*.os
|
||||||
|
|||||||
63
SConstruct
63
SConstruct
@@ -1,19 +1,10 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
import codecs
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import subprocess
|
import subprocess
|
||||||
|
from binding_generator import scons_generate_bindings, scons_emit_files
|
||||||
if sys.version_info < (3,):
|
|
||||||
|
|
||||||
def decode_utf8(x):
|
|
||||||
return x
|
|
||||||
|
|
||||||
else:
|
|
||||||
import codecs
|
|
||||||
|
|
||||||
def decode_utf8(x):
|
|
||||||
return codecs.utf_8_decode(x)[0]
|
|
||||||
|
|
||||||
|
|
||||||
# Workaround for MinGW. See:
|
# Workaround for MinGW. See:
|
||||||
@@ -133,15 +124,7 @@ opts.Add(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
opts.Add(PathVariable("custom_api_file", "Path to a custom JSON API file", None, PathVariable.PathIsFile))
|
opts.Add(PathVariable("custom_api_file", "Path to a custom JSON API file", None, PathVariable.PathIsFile))
|
||||||
opts.Add(
|
opts.Add(BoolVariable("generate_bindings", "Force GDNative API bindings generation.", False))
|
||||||
EnumVariable(
|
|
||||||
"generate_bindings",
|
|
||||||
"Generate GDNative API bindings",
|
|
||||||
"auto",
|
|
||||||
allowed_values=["yes", "no", "auto", "true"],
|
|
||||||
ignorecase=2,
|
|
||||||
)
|
|
||||||
)
|
|
||||||
opts.Add(
|
opts.Add(
|
||||||
EnumVariable(
|
EnumVariable(
|
||||||
"android_arch",
|
"android_arch",
|
||||||
@@ -265,7 +248,7 @@ elif env["platform"] == "ios":
|
|||||||
env.Append(CCFLAGS=["-miphoneos-version-min=10.0"])
|
env.Append(CCFLAGS=["-miphoneos-version-min=10.0"])
|
||||||
|
|
||||||
try:
|
try:
|
||||||
sdk_path = decode_utf8(subprocess.check_output(["xcrun", "--sdk", sdk_name, "--show-sdk-path"]).strip())
|
sdk_path = codecs.utf_8_decode(subprocess.check_output(["xcrun", "--sdk", sdk_name, "--show-sdk-path"]).strip())[0]
|
||||||
except (subprocess.CalledProcessError, OSError):
|
except (subprocess.CalledProcessError, OSError):
|
||||||
raise ValueError("Failed to find SDK path while running xcrun --sdk {} --show-sdk-path.".format(sdk_name))
|
raise ValueError("Failed to find SDK path while running xcrun --sdk {} --show-sdk-path.".format(sdk_name))
|
||||||
|
|
||||||
@@ -472,17 +455,14 @@ elif env["platform"] == "javascript":
|
|||||||
elif env["target"] == "release":
|
elif env["target"] == "release":
|
||||||
env.Append(CCFLAGS=["-O3"])
|
env.Append(CCFLAGS=["-O3"])
|
||||||
|
|
||||||
env.Append(
|
# Cache
|
||||||
CPPPATH=[
|
scons_cache_path = os.environ.get("SCONS_CACHE")
|
||||||
".",
|
if scons_cache_path is not None:
|
||||||
env["headers_dir"],
|
CacheDir(scons_cache_path)
|
||||||
"include",
|
Decider("MD5")
|
||||||
"include/gen",
|
|
||||||
"include/core",
|
|
||||||
]
|
|
||||||
)
|
|
||||||
|
|
||||||
# Generate bindings?
|
# Generate bindings
|
||||||
|
env.Append(BUILDERS={"GenerateBindings": Builder(action=scons_generate_bindings, emitter=scons_emit_files)})
|
||||||
json_api_file = ""
|
json_api_file = ""
|
||||||
|
|
||||||
if "custom_api_file" in env:
|
if "custom_api_file" in env:
|
||||||
@@ -490,22 +470,22 @@ if "custom_api_file" in env:
|
|||||||
else:
|
else:
|
||||||
json_api_file = os.path.join(os.getcwd(), env["headers_dir"], "api.json")
|
json_api_file = os.path.join(os.getcwd(), env["headers_dir"], "api.json")
|
||||||
|
|
||||||
if env["generate_bindings"] == "auto":
|
bindings = env.GenerateBindings(
|
||||||
# Check if generated files exist
|
env.Dir("."), [json_api_file, "binding_generator.py"]
|
||||||
should_generate_bindings = not os.path.isfile(os.path.join(os.getcwd(), "src", "gen", "Object.cpp"))
|
)
|
||||||
else:
|
|
||||||
should_generate_bindings = env["generate_bindings"] in ["yes", "true"]
|
|
||||||
|
|
||||||
if should_generate_bindings:
|
# Forces bindings regeneration.
|
||||||
# Actually create the bindings here
|
if env["generate_bindings"]:
|
||||||
import binding_generator
|
AlwaysBuild(bindings)
|
||||||
|
NoCache(bindings)
|
||||||
|
|
||||||
binding_generator.generate_bindings(json_api_file, env["generate_template_get_node"])
|
# Includes
|
||||||
|
env.Append(CPPPATH=[[env.Dir(d) for d in [".", env["headers_dir"], "include", "include/gen", "include/core"]]])
|
||||||
|
|
||||||
# Sources to compile
|
# Sources to compile
|
||||||
sources = []
|
sources = []
|
||||||
add_sources(sources, "src/core", "cpp")
|
add_sources(sources, "src/core", "cpp")
|
||||||
add_sources(sources, "src/gen", "cpp")
|
sources.extend(f for f in bindings if str(f).endswith(".cpp"))
|
||||||
|
|
||||||
arch_suffix = env["bits"]
|
arch_suffix = env["bits"]
|
||||||
if env["platform"] == "android":
|
if env["platform"] == "android":
|
||||||
@@ -530,7 +510,6 @@ if env["build_library"]:
|
|||||||
library = env.StaticLibrary(target=env.File("bin/%s" % library_name), source=sources)
|
library = env.StaticLibrary(target=env.File("bin/%s" % library_name), source=sources)
|
||||||
Default(library)
|
Default(library)
|
||||||
|
|
||||||
env.Append(CPPPATH=[env.Dir(f) for f in [env["headers_dir"], "include", "include/gen", "include/core"]])
|
|
||||||
env.Append(LIBPATH=[env.Dir("bin")])
|
env.Append(LIBPATH=[env.Dir("bin")])
|
||||||
env.Append(LIBS=library_name)
|
env.Append(LIBS=library_name)
|
||||||
Return("env")
|
Return("env")
|
||||||
|
|||||||
@@ -15,9 +15,9 @@ def correct_method_name(method_list):
|
|||||||
classes = []
|
classes = []
|
||||||
|
|
||||||
|
|
||||||
def print_file_list(api_filepath, output_dir, headers=False, sources=False):
|
def get_file_list(api_filepath, output_dir, headers=False, sources=False):
|
||||||
global classes
|
global classes
|
||||||
end = ";"
|
files = []
|
||||||
with open(api_filepath) as api_file:
|
with open(api_filepath) as api_file:
|
||||||
classes = json.load(api_file)
|
classes = json.load(api_file)
|
||||||
include_gen_folder = Path(output_dir) / "include" / "gen"
|
include_gen_folder = Path(output_dir) / "include" / "gen"
|
||||||
@@ -26,17 +26,35 @@ def print_file_list(api_filepath, output_dir, headers=False, sources=False):
|
|||||||
header_filename = include_gen_folder / (strip_name(_class["name"]) + ".hpp")
|
header_filename = include_gen_folder / (strip_name(_class["name"]) + ".hpp")
|
||||||
source_filename = source_gen_folder / (strip_name(_class["name"]) + ".cpp")
|
source_filename = source_gen_folder / (strip_name(_class["name"]) + ".cpp")
|
||||||
if headers:
|
if headers:
|
||||||
print(str(header_filename.as_posix()), end=end)
|
files.append(str(header_filename.as_posix()))
|
||||||
if sources:
|
if sources:
|
||||||
print(str(source_filename.as_posix()), end=end)
|
files.append(str(source_filename.as_posix()))
|
||||||
icall_header_filename = include_gen_folder / "__icalls.hpp"
|
icall_header_filename = include_gen_folder / "__icalls.hpp"
|
||||||
register_types_filename = source_gen_folder / "__register_types.cpp"
|
register_types_filename = source_gen_folder / "__register_types.cpp"
|
||||||
init_method_bindings_filename = source_gen_folder / "__init_method_bindings.cpp"
|
init_method_bindings_filename = source_gen_folder / "__init_method_bindings.cpp"
|
||||||
if headers:
|
if headers:
|
||||||
print(str(icall_header_filename.as_posix()), end=end)
|
files.append(str(icall_header_filename.as_posix()))
|
||||||
if sources:
|
if sources:
|
||||||
print(str(register_types_filename.as_posix()), end=end)
|
files.append(str(register_types_filename.as_posix()))
|
||||||
print(str(init_method_bindings_filename.as_posix()), end=end)
|
files.append(str(init_method_bindings_filename.as_posix()))
|
||||||
|
return files
|
||||||
|
|
||||||
|
|
||||||
|
def print_file_list(api_filepath, output_dir, headers=False, sources=False):
|
||||||
|
for f in get_file_list(api_filepath, output_dir, headers, sources):
|
||||||
|
print(f, end=";")
|
||||||
|
|
||||||
|
|
||||||
|
def scons_emit_files(target, source, env):
|
||||||
|
files = [env.File(f) for f in get_file_list(str(source[0]), target[0].abspath, True, True)]
|
||||||
|
env.Clean(target, files)
|
||||||
|
env["godot_cpp_gen_dir"] = target[0].abspath
|
||||||
|
return files, source
|
||||||
|
|
||||||
|
|
||||||
|
def scons_generate_bindings(target, source, env):
|
||||||
|
generate_bindings(str(source[0]), env["generate_template_get_node"], env["godot_cpp_gen_dir"])
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
def generate_bindings(api_filepath, use_template_get_node, output_dir="."):
|
def generate_bindings(api_filepath, use_template_get_node, output_dir="."):
|
||||||
@@ -48,25 +66,12 @@ def generate_bindings(api_filepath, use_template_get_node, output_dir="."):
|
|||||||
include_gen_folder = Path(output_dir) / "include" / "gen"
|
include_gen_folder = Path(output_dir) / "include" / "gen"
|
||||||
source_gen_folder = Path(output_dir) / "src" / "gen"
|
source_gen_folder = Path(output_dir) / "src" / "gen"
|
||||||
|
|
||||||
try:
|
include_gen_folder.mkdir(parents=True, exist_ok=True)
|
||||||
include_gen_folder.mkdir(parents=True)
|
source_gen_folder.mkdir(parents=True, exist_ok=True)
|
||||||
except os.error as e:
|
|
||||||
if e.errno == errno.EEXIST:
|
|
||||||
print(str(source_gen_folder) + ": " + os.strerror(e.errno))
|
|
||||||
else:
|
|
||||||
exit(1)
|
|
||||||
|
|
||||||
try:
|
|
||||||
source_gen_folder.mkdir(parents=True)
|
|
||||||
except os.error as e:
|
|
||||||
if e.errno == errno.EEXIST:
|
|
||||||
print(str(source_gen_folder) + ": " + os.strerror(e.errno))
|
|
||||||
else:
|
|
||||||
exit(1)
|
|
||||||
|
|
||||||
for c in classes:
|
for c in classes:
|
||||||
# print(c['name'])
|
# print(c['name'])
|
||||||
used_classes = get_used_classes(c)
|
used_classes = sorted(get_used_classes(c))
|
||||||
if use_template_get_node and c["name"] == "Node":
|
if use_template_get_node and c["name"] == "Node":
|
||||||
correct_method_name(c["methods"])
|
correct_method_name(c["methods"])
|
||||||
|
|
||||||
|
|||||||
31
misc/scripts/check_get_file_list.py
Executable file
31
misc/scripts/check_get_file_list.py
Executable file
@@ -0,0 +1,31 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
import os, sys
|
||||||
|
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
sys.path.insert(1, os.path.join(os.path.dirname(__file__), "..", ".."))
|
||||||
|
|
||||||
|
from binding_generator import get_file_list, generate_bindings
|
||||||
|
|
||||||
|
api_filepath = "godot-headers/api.json"
|
||||||
|
bits = "64"
|
||||||
|
double = "float"
|
||||||
|
output_dir = "self_test"
|
||||||
|
|
||||||
|
generate_bindings(api_filepath, use_template_get_node=False, output_dir=output_dir)
|
||||||
|
flist = get_file_list(api_filepath, output_dir, headers=True, sources=True)
|
||||||
|
|
||||||
|
p = Path(output_dir)
|
||||||
|
allfiles = [str(f.as_posix()) for f in p.glob("**/*.*")]
|
||||||
|
missing = list(filter((lambda f: f not in flist), allfiles))
|
||||||
|
extras = list(filter((lambda f: f not in allfiles), flist))
|
||||||
|
if len(missing) > 0 or len(extras) > 0:
|
||||||
|
print("Error!")
|
||||||
|
for f in missing:
|
||||||
|
print("MISSING: " + str(f))
|
||||||
|
for f in extras:
|
||||||
|
print("EXTRA: " + str(f))
|
||||||
|
sys.exit(1)
|
||||||
|
else:
|
||||||
|
print("OK!")
|
||||||
Reference in New Issue
Block a user