mirror of
https://github.com/godotengine/godot-cpp.git
synced 2026-01-02 09:48:36 +03:00
Compare commits
5 Commits
godot-3.3-
...
godot-3.3.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dfee6f0ca4 | ||
|
|
f298d36c86 | ||
|
|
c629200b93 | ||
|
|
476a870d6c | ||
|
|
eb8ae9dd51 |
8
.github/workflows/ci.yml
vendored
8
.github/workflows/ci.yml
vendored
@@ -29,7 +29,7 @@ jobs:
|
||||
scons target=release generate_bindings=yes -j $(nproc)
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v2.2.2
|
||||
uses: actions/upload-artifact@v2.2.3
|
||||
with:
|
||||
name: godot-cpp-linux-glibc2.23-x86_64-release
|
||||
path: bin/libgodot-cpp.linux.release.64.a
|
||||
@@ -66,7 +66,7 @@ jobs:
|
||||
scons target=release generate_bindings=yes -j $env:NUMBER_OF_PROCESSORS
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v2.2.2
|
||||
uses: actions/upload-artifact@v2.2.3
|
||||
with:
|
||||
name: godot-cpp-windows-msvc2019-x86_64-release
|
||||
path: bin/libgodot-cpp.windows.release.64.lib
|
||||
@@ -100,7 +100,7 @@ jobs:
|
||||
scons target=release generate_bindings=yes use_mingw=yes -j $env:NUMBER_OF_PROCESSORS
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v2.2.2
|
||||
uses: actions/upload-artifact@v2.2.3
|
||||
with:
|
||||
name: godot-cpp-linux-mingw-x86_64-release
|
||||
path: bin/libgodot-cpp.windows.release.64.a
|
||||
@@ -131,7 +131,7 @@ jobs:
|
||||
scons target=release generate_bindings=yes -j $(sysctl -n hw.logicalcpu)
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v2.2.2
|
||||
uses: actions/upload-artifact@v2.2.3
|
||||
with:
|
||||
name: godot-cpp-macos-x86_64-release
|
||||
path: bin/libgodot-cpp.osx.release.64.a
|
||||
|
||||
@@ -199,8 +199,8 @@ if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(BITS 64)
|
||||
endif(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
|
||||
string(TOLOWER ${CMAKE_SYSTEM_NAME} SYSTEM_NAME)
|
||||
string(TOLOWER ${CMAKE_BUILD_TYPE} BUILD_TYPE)
|
||||
string(TOLOWER "${CMAKE_SYSTEM_NAME}" SYSTEM_NAME)
|
||||
string(TOLOWER "${CMAKE_BUILD_TYPE}" BUILD_TYPE)
|
||||
|
||||
if(ANDROID)
|
||||
# Added the android abi after system name
|
||||
|
||||
@@ -3,6 +3,7 @@ from __future__ import print_function
|
||||
import json
|
||||
import os
|
||||
import errno
|
||||
from pathlib import Path
|
||||
|
||||
# Convenience function for using template get_node
|
||||
def correct_method_name(method_list):
|
||||
@@ -19,23 +20,23 @@ def print_file_list(api_filepath, output_dir, headers=False, sources=False):
|
||||
end = ';'
|
||||
with open(api_filepath) as api_file:
|
||||
classes = json.load(api_file)
|
||||
include_gen_folder = os.path.join(output_dir, 'include', 'gen')
|
||||
source_gen_folder = os.path.join(output_dir, 'src', 'gen')
|
||||
include_gen_folder = Path(output_dir) / 'include' / 'gen'
|
||||
source_gen_folder = Path(output_dir) / 'src' / 'gen'
|
||||
for _class in classes:
|
||||
header_filename = os.path.join(include_gen_folder, strip_name(_class["name"]) + ".hpp")
|
||||
source_filename = os.path.join(source_gen_folder, strip_name(_class["name"]) + ".cpp")
|
||||
header_filename = include_gen_folder / (strip_name(_class["name"]) + ".hpp")
|
||||
source_filename = source_gen_folder / (strip_name(_class["name"]) + ".cpp")
|
||||
if headers:
|
||||
print(header_filename, end=end)
|
||||
print(str(header_filename.as_posix()), end=end)
|
||||
if sources:
|
||||
print(source_filename, end=end)
|
||||
icall_header_filename = os.path.join(include_gen_folder, '__icalls.hpp')
|
||||
register_types_filename = os.path.join(source_gen_folder, '__register_types.cpp')
|
||||
init_method_bindings_filename = os.path.join(source_gen_folder, '__init_method_bindings.cpp')
|
||||
print(str(source_filename.as_posix()), end=end)
|
||||
icall_header_filename = include_gen_folder / '__icalls.hpp'
|
||||
register_types_filename = source_gen_folder / '__register_types.cpp'
|
||||
init_method_bindings_filename = source_gen_folder / '__init_method_bindings.cpp'
|
||||
if headers:
|
||||
print(icall_header_filename, end=end)
|
||||
print(str(icall_header_filename.as_posix()), end=end)
|
||||
if sources:
|
||||
print(register_types_filename, end=end)
|
||||
print(init_method_bindings_filename, end=end)
|
||||
print(str(register_types_filename.as_posix()), end=end)
|
||||
print(str(init_method_bindings_filename.as_posix()), end=end)
|
||||
|
||||
|
||||
def generate_bindings(api_filepath, use_template_get_node, output_dir="."):
|
||||
@@ -44,20 +45,22 @@ def generate_bindings(api_filepath, use_template_get_node, output_dir="."):
|
||||
classes = json.load(api_file)
|
||||
|
||||
icalls = set()
|
||||
include_gen_folder = os.path.join(output_dir, 'include', 'gen')
|
||||
source_gen_folder = os.path.join(output_dir, 'src', 'gen')
|
||||
include_gen_folder = Path(output_dir) / 'include' / 'gen'
|
||||
source_gen_folder = Path(output_dir) / 'src' / 'gen'
|
||||
|
||||
try:
|
||||
os.makedirs(include_gen_folder)
|
||||
include_gen_folder.mkdir(parents=True)
|
||||
except os.error as e:
|
||||
if e.errno == errno.EEXIST:
|
||||
print(include_gen_folder + ": " + os.strerror(e.errno))
|
||||
print(str(source_gen_folder) + ": " + os.strerror(e.errno))
|
||||
else:
|
||||
exit(1)
|
||||
|
||||
try:
|
||||
os.makedirs(source_gen_folder)
|
||||
source_gen_folder.mkdir(parents=True)
|
||||
except os.error as e:
|
||||
if e.errno == errno.EEXIST:
|
||||
print(source_gen_folder + ": " + os.strerror(e.errno))
|
||||
print(str(source_gen_folder) + ": " + os.strerror(e.errno))
|
||||
else:
|
||||
exit(1)
|
||||
|
||||
@@ -71,24 +74,24 @@ def generate_bindings(api_filepath, use_template_get_node, output_dir="."):
|
||||
|
||||
impl = generate_class_implementation(icalls, used_classes, c, use_template_get_node)
|
||||
|
||||
header_filename = os.path.join(include_gen_folder, strip_name(c["name"]) + ".hpp")
|
||||
with open(header_filename, "w+") as header_file:
|
||||
header_filename = include_gen_folder / (strip_name(c["name"]) + ".hpp")
|
||||
with header_filename.open("w+") as header_file:
|
||||
header_file.write(header)
|
||||
|
||||
source_filename = os.path.join(source_gen_folder, strip_name(c["name"]) + ".cpp")
|
||||
with open(source_filename, "w+") as source_file:
|
||||
source_filename = source_gen_folder / (strip_name(c["name"]) + ".cpp")
|
||||
with source_filename.open("w+") as source_file:
|
||||
source_file.write(impl)
|
||||
|
||||
icall_header_filename = os.path.join(include_gen_folder, '__icalls.hpp')
|
||||
with open(icall_header_filename, "w+") as icall_header_file:
|
||||
icall_header_filename = include_gen_folder / '__icalls.hpp'
|
||||
with icall_header_filename.open("w+") as icall_header_file:
|
||||
icall_header_file.write(generate_icall_header(icalls))
|
||||
|
||||
register_types_filename = os.path.join(source_gen_folder, '__register_types.cpp')
|
||||
with open(register_types_filename, "w+") as register_types_file:
|
||||
register_types_filename = source_gen_folder / '__register_types.cpp'
|
||||
with register_types_filename.open("w+") as register_types_file:
|
||||
register_types_file.write(generate_type_registry(classes))
|
||||
|
||||
init_method_bindings_filename = os.path.join(source_gen_folder, '__init_method_bindings.cpp')
|
||||
with open(init_method_bindings_filename, "w+") as init_method_bindings_file:
|
||||
init_method_bindings_filename = source_gen_folder / '__init_method_bindings.cpp'
|
||||
with init_method_bindings_filename.open("w+") as init_method_bindings_file:
|
||||
init_method_bindings_file.write(generate_init_method_bindings(classes))
|
||||
|
||||
|
||||
|
||||
Submodule godot-headers updated: a8ab6802c3...bd863357de
Reference in New Issue
Block a user