mirror of
https://github.com/Relintai/gdnative_cpp.git
synced 2025-05-03 22:37:57 +02:00
Initial path setups.
This commit is contained in:
parent
ab52f40a24
commit
7efc4247e1
@ -2,7 +2,7 @@
|
|||||||
# CMAKE_BUILD_TYPE: Compilation target (Debug or Release defaults to Debug)
|
# CMAKE_BUILD_TYPE: Compilation target (Debug or Release defaults to Debug)
|
||||||
#
|
#
|
||||||
# godot-cpp cmake arguments
|
# godot-cpp cmake arguments
|
||||||
# GODOT_HEADERS_DIR: This is where the gdnative include folder is (godot_source/modules/gdnative/include)
|
# GODOT_HEADERS_DIR: This is where the gdnative include folder is (godot_source/modules/gdn/include)
|
||||||
# GODOT_CUSTOM_API_FILE: This is if you have another path for the godot_api.json
|
# GODOT_CUSTOM_API_FILE: This is if you have another path for the godot_api.json
|
||||||
#
|
#
|
||||||
# Android cmake arguments
|
# Android cmake arguments
|
||||||
@ -75,8 +75,8 @@ if(NOT DEFINED BITS)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Input from user for godot headers and the api file
|
# Input from user for godot headers and the api file
|
||||||
set(GODOT_HEADERS_DIR "godot-headers" CACHE STRING "")
|
set(GODOT_HEADERS_DIR "pandemonium_headers" CACHE STRING "")
|
||||||
set(GODOT_CUSTOM_API_FILE "godot-headers/api.json" CACHE STRING "")
|
set(GODOT_CUSTOM_API_FILE "pandemonium_headers/api.json" CACHE STRING "")
|
||||||
|
|
||||||
set(GODOT_COMPILE_FLAGS )
|
set(GODOT_COMPILE_FLAGS )
|
||||||
set(GODOT_LINKER_FLAGS )
|
set(GODOT_LINKER_FLAGS )
|
||||||
|
2
Makefile
2
Makefile
@ -1,5 +1,5 @@
|
|||||||
GENERATE_BINDINGS = no
|
GENERATE_BINDINGS = no
|
||||||
HEADERS = godot-headers
|
HEADERS = pandemonium_headers
|
||||||
TARGET = debug
|
TARGET = debug
|
||||||
USE_CLANG = no
|
USE_CLANG = no
|
||||||
|
|
||||||
|
20
README.md
20
README.md
@ -26,7 +26,7 @@ Godot version.**
|
|||||||
|
|
||||||
> As the `master` and `3.x` branches are constantly getting updates, if you are
|
> As the `master` and `3.x` branches are constantly getting updates, if you are
|
||||||
> using `godot-cpp` against a more current version of Godot, see the instructions
|
> using `godot-cpp` against a more current version of Godot, see the instructions
|
||||||
> in [**godot-headers**](https://github.com/godotengine/godot-headers) for
|
> in [**pandemonium_headers**](https://github.com/godotengine/pandemonium_headers) for
|
||||||
> updating the relevant files.
|
> updating the relevant files.
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
@ -51,7 +51,7 @@ We recommend using Git for managing your project. The instructions below assume
|
|||||||
you're using Git. Alternatively, you can download the source code directly from
|
you're using Git. Alternatively, you can download the source code directly from
|
||||||
GitHub. In this case, you need to download both
|
GitHub. In this case, you need to download both
|
||||||
[godot-cpp](https://github.com/godotengine/godot-cpp) and
|
[godot-cpp](https://github.com/godotengine/godot-cpp) and
|
||||||
[godot-headers](https://github.com/godotengine/godot-headers).
|
[pandemonium_headers](https://github.com/godotengine/pandemonium_headers).
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
mkdir SimpleLibrary
|
mkdir SimpleLibrary
|
||||||
@ -79,7 +79,7 @@ Right now, our directory structure should look like this:
|
|||||||
```text
|
```text
|
||||||
SimpleLibrary/
|
SimpleLibrary/
|
||||||
├─godot-cpp/
|
├─godot-cpp/
|
||||||
| └─godot-headers/
|
| └─pandemonium_headers/
|
||||||
├─bin/
|
├─bin/
|
||||||
└─src/
|
└─src/
|
||||||
```
|
```
|
||||||
@ -91,7 +91,7 @@ Godot core. This metadata is required to generate the C++ binding classes for
|
|||||||
use in GDNative modules.
|
use in GDNative modules.
|
||||||
|
|
||||||
This file is supplied with our
|
This file is supplied with our
|
||||||
[godot-headers](https://github.com/godotengine/godot-headers) repository
|
[pandemonium_headers](https://github.com/godotengine/pandemonium_headers) repository
|
||||||
for your convenience. However, if you're running a custom build of Godot and
|
for your convenience. However, if you're running a custom build of Godot and
|
||||||
need access to classes that have recent changes, you must generate a new
|
need access to classes that have recent changes, you must generate a new
|
||||||
`api.json` file. You do this by starting your Godot executable with the
|
`api.json` file. You do this by starting your Godot executable with the
|
||||||
@ -235,7 +235,7 @@ Once you've compiled the GDNative C++ bindings (see above), you can compile the
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd SimpleLibrary
|
cd SimpleLibrary
|
||||||
clang++ -fPIC -o src/init.o -c src/init.cpp -g -O3 -std=c++14 -Igodot-cpp/include -Igodot-cpp/include/core -Igodot-cpp/include/gen -Igodot-cpp/godot-headers
|
clang++ -fPIC -o src/init.o -c src/init.cpp -g -O3 -std=c++14 -Igodot-cpp/include -Igodot-cpp/include/core -Igodot-cpp/include/gen -Igodot-cpp/pandemonium_headers
|
||||||
clang++ -o bin/libtest.so -shared src/init.o -Lgodot-cpp/bin -l<name of the godot-cpp>
|
clang++ -o bin/libtest.so -shared src/init.o -Lgodot-cpp/bin -l<name of the godot-cpp>
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -247,7 +247,7 @@ This creates the file `libtest.so` in your `SimpleLibrary/bin` directory.
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd SimpleLibrary
|
cd SimpleLibrary
|
||||||
cl /Fosrc/init.obj /c src/init.cpp /nologo -EHsc -DNDEBUG /MDd /Igodot-cpp\include /Igodot-cpp\include\core /Igodot-cpp\include\gen /Igodot-cpp\godot-headers
|
cl /Fosrc/init.obj /c src/init.cpp /nologo -EHsc -DNDEBUG /MDd /Igodot-cpp\include /Igodot-cpp\include\core /Igodot-cpp\include\gen /Igodot-cpp\pandemonium_headers
|
||||||
link /nologo /dll /out:bin\libtest.dll /implib:bin\libsimple.lib src\init.obj godot-cpp\bin\<name of the godot-cpp>
|
link /nologo /dll /out:bin\libtest.dll /implib:bin\libsimple.lib src\init.obj godot-cpp\bin\<name of the godot-cpp>
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -270,7 +270,7 @@ submit a pull request :slightly_smiling_face:
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd SimpleLibrary
|
cd SimpleLibrary
|
||||||
aarch64-linux-android29-clang++ -fPIC -o src/init.o -c src/init.cpp -g -O3 -std=c++14 -Igodot-cpp/include -Igodot-cpp/include/core -Igodot-cpp/include/gen -Igodot-cpp/godot-headers
|
aarch64-linux-android29-clang++ -fPIC -o src/init.o -c src/init.cpp -g -O3 -std=c++14 -Igodot-cpp/include -Igodot-cpp/include/core -Igodot-cpp/include/gen -Igodot-cpp/pandemonium_headers
|
||||||
aarch64-linux-android29-clang++ -o bin/libtest.so -shared src/init.o -Lgodot-cpp/bin -l<name of the godot-cpp>
|
aarch64-linux-android29-clang++ -o bin/libtest.so -shared src/init.o -Lgodot-cpp/bin -l<name of the godot-cpp>
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -284,7 +284,7 @@ GDNative isn't supported on iOS yet. This is because iOS only allows linking
|
|||||||
static libraries, not dynamic libraries. In theory, it would be possible to link
|
static libraries, not dynamic libraries. In theory, it would be possible to link
|
||||||
a GDNative library statically, but some of GDNative's convenience would be lost
|
a GDNative library statically, but some of GDNative's convenience would be lost
|
||||||
in the process as one would have to recompile the engine on every change. See
|
in the process as one would have to recompile the engine on every change. See
|
||||||
[issue #30](https://github.com/godotengine/godot-headers/issues/30) in the
|
[issue #30](https://github.com/godotengine/pandemonium_headers/issues/30) in the
|
||||||
Godot headers repository for more information.
|
Godot headers repository for more information.
|
||||||
|
|
||||||
#### HTML5
|
#### HTML5
|
||||||
@ -295,7 +295,7 @@ To build GDNative libraries, you will need a recent version of [Emscripten](http
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd SimpleLibrary
|
cd SimpleLibrary
|
||||||
emcc -o bin/libtest.wasm -g -O3 -s SIDE_MODULE=1 src/init.cpp godot-cpp/bin/<name of the godot-cpp> -Igodot-cpp/include -Igodot-cpp/include/core -Igodot-cpp/include/gen -Igodot-cpp/godot-headers
|
emcc -o bin/libtest.wasm -g -O3 -s SIDE_MODULE=1 src/init.cpp godot-cpp/bin/<name of the godot-cpp> -Igodot-cpp/include -Igodot-cpp/include/core -Igodot-cpp/include/gen -Igodot-cpp/pandemonium_headers
|
||||||
```
|
```
|
||||||
|
|
||||||
You'll need to replace `<name of the godot-cpp>` with the file that was created in [**Compiling the cpp bindings library**](#compiling-the-cpp-bindings-library).
|
You'll need to replace `<name of the godot-cpp>` with the file that was created in [**Compiling the cpp bindings library**](#compiling-the-cpp-bindings-library).
|
||||||
@ -305,7 +305,7 @@ This creates the file `libtest.so` in your `SimpleLibrary/bin` directory.
|
|||||||
### Creating `.gdnlib` and `.gdns` files
|
### Creating `.gdnlib` and `.gdns` files
|
||||||
|
|
||||||
Follow the instructions in
|
Follow the instructions in
|
||||||
[godot-headers/README.md](https://github.com/godotengine/godot-headers/blob/master/README.md#how-do-i-use-native-scripts-from-the-editor)
|
[pandemonium_headers/README.md](https://github.com/godotengine/pandemonium_headers/blob/master/README.md#how-do-i-use-native-scripts-from-the-editor)
|
||||||
to create the `.gdns` file. This file contains paths to GDNative libraries for
|
to create the `.gdns` file. This file contains paths to GDNative libraries for
|
||||||
various platforms. This makes the library usable from Godot in a
|
various platforms. This makes the library usable from Godot in a
|
||||||
platform-independent manner.
|
platform-independent manner.
|
||||||
|
@ -129,7 +129,7 @@ opts.Add(
|
|||||||
PathVariable(
|
PathVariable(
|
||||||
"headers_dir",
|
"headers_dir",
|
||||||
"Path to the directory containing Godot headers",
|
"Path to the directory containing Godot headers",
|
||||||
"godot-headers",
|
"pandemonium_headers",
|
||||||
PathVariable.PathIsDir,
|
PathVariable.PathIsDir,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
#ifndef ARRAY_H
|
#ifndef ARRAY_H
|
||||||
#define ARRAY_H
|
#define ARRAY_H
|
||||||
|
|
||||||
#include <gdnative/array.h>
|
#include <gdn/array.h>
|
||||||
|
|
||||||
#include "String.hpp"
|
#include "String.hpp"
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
#ifndef BASIS_H
|
#ifndef BASIS_H
|
||||||
#define BASIS_H
|
#define BASIS_H
|
||||||
|
|
||||||
#include <gdnative/basis.h>
|
#include <gdn/basis.h>
|
||||||
|
|
||||||
#include "Defs.hpp"
|
#include "Defs.hpp"
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
#ifndef COLOR_H
|
#ifndef COLOR_H
|
||||||
#define COLOR_H
|
#define COLOR_H
|
||||||
|
|
||||||
#include <gdnative/color.h>
|
#include <gdn/color.h>
|
||||||
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
|
|
||||||
#include "Array.hpp"
|
#include "Array.hpp"
|
||||||
|
|
||||||
#include <gdnative/dictionary.h>
|
#include <gdn/dictionary.h>
|
||||||
|
|
||||||
namespace godot {
|
namespace godot {
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
#include "String.hpp"
|
#include "String.hpp"
|
||||||
|
|
||||||
#include <gdnative/node_path.h>
|
#include <gdn/node_path.h>
|
||||||
|
|
||||||
namespace godot {
|
namespace godot {
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
#include "Vector2.hpp"
|
#include "Vector2.hpp"
|
||||||
#include "Vector3.hpp"
|
#include "Vector3.hpp"
|
||||||
|
|
||||||
#include <gdnative/pool_arrays.h>
|
#include <gdn/pool_arrays.h>
|
||||||
|
|
||||||
namespace godot {
|
namespace godot {
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
#ifndef RID_H
|
#ifndef RID_H
|
||||||
#define RID_H
|
#define RID_H
|
||||||
|
|
||||||
#include <gdnative/rid.h>
|
#include <gdn/rid.h>
|
||||||
|
|
||||||
namespace godot {
|
namespace godot {
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
#ifndef STRING_H
|
#ifndef STRING_H
|
||||||
#define STRING_H
|
#define STRING_H
|
||||||
|
|
||||||
#include <gdnative/string.h>
|
#include <gdn/string.h>
|
||||||
|
|
||||||
namespace godot {
|
namespace godot {
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
#ifndef VARIANT_H
|
#ifndef VARIANT_H
|
||||||
#define VARIANT_H
|
#define VARIANT_H
|
||||||
|
|
||||||
#include <gdnative/variant.h>
|
#include <gdn/variant.h>
|
||||||
|
|
||||||
#include "Defs.hpp"
|
#include "Defs.hpp"
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
#ifndef VECTOR2_H
|
#ifndef VECTOR2_H
|
||||||
#define VECTOR2_H
|
#define VECTOR2_H
|
||||||
|
|
||||||
#include <gdnative/vector2.h>
|
#include <gdn/vector2.h>
|
||||||
|
|
||||||
#include "Defs.hpp"
|
#include "Defs.hpp"
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
#ifndef VECTOR3_H
|
#ifndef VECTOR3_H
|
||||||
#define VECTOR3_H
|
#define VECTOR3_H
|
||||||
|
|
||||||
#include <gdnative/vector3.h>
|
#include <gdn/vector3.h>
|
||||||
|
|
||||||
#include "Defs.hpp"
|
#include "Defs.hpp"
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
#ifndef WRAPPED_HPP
|
#ifndef WRAPPED_HPP
|
||||||
#define WRAPPED_HPP
|
#define WRAPPED_HPP
|
||||||
|
|
||||||
#include <gdnative/gdnative.h>
|
#include <gdn/gdnative.h>
|
||||||
|
|
||||||
namespace godot {
|
namespace godot {
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ sys.path.insert(1, os.path.join(os.path.dirname(__file__), "..", ".."))
|
|||||||
|
|
||||||
from binding_generator import get_file_list, generate_bindings
|
from binding_generator import get_file_list, generate_bindings
|
||||||
|
|
||||||
api_filepath = "godot-headers/api.json"
|
api_filepath = "pandemonium_headers/api.json"
|
||||||
bits = "64"
|
bits = "64"
|
||||||
double = "float"
|
double = "float"
|
||||||
output_dir = "self_test"
|
output_dir = "self_test"
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
#include "Defs.hpp"
|
#include "Defs.hpp"
|
||||||
#include "String.hpp"
|
#include "String.hpp"
|
||||||
|
|
||||||
#include <gdnative/color.h>
|
#include <gdn/color.h>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
namespace godot {
|
namespace godot {
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
#include "GodotGlobal.hpp"
|
#include "GodotGlobal.hpp"
|
||||||
#include "String.hpp"
|
#include "String.hpp"
|
||||||
|
|
||||||
#include <gdnative/node_path.h>
|
#include <gdn/node_path.h>
|
||||||
|
|
||||||
namespace godot {
|
namespace godot {
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
#include "Vector2.hpp"
|
#include "Vector2.hpp"
|
||||||
#include "Vector3.hpp"
|
#include "Vector3.hpp"
|
||||||
|
|
||||||
#include <gdnative/pool_arrays.h>
|
#include <gdn/pool_arrays.h>
|
||||||
|
|
||||||
namespace godot {
|
namespace godot {
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
#include "RID.hpp"
|
#include "RID.hpp"
|
||||||
|
|
||||||
#include <gdnative/rid.h>
|
#include <gdn/rid.h>
|
||||||
|
|
||||||
#include "GodotGlobal.hpp"
|
#include "GodotGlobal.hpp"
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
#include "PoolArrays.hpp"
|
#include "PoolArrays.hpp"
|
||||||
#include "Variant.hpp"
|
#include "Variant.hpp"
|
||||||
|
|
||||||
#include <gdnative/string.h>
|
#include <gdn/string.h>
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
#include "Variant.hpp"
|
#include "Variant.hpp"
|
||||||
|
|
||||||
#include <gdnative/variant.h>
|
#include <gdn/variant.h>
|
||||||
|
|
||||||
#include "CoreTypes.hpp"
|
#include "CoreTypes.hpp"
|
||||||
#include "Defs.hpp"
|
#include "Defs.hpp"
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
#include "Vector2.hpp"
|
#include "Vector2.hpp"
|
||||||
|
|
||||||
#include <gdnative/vector2.h>
|
#include <gdn/vector2.h>
|
||||||
|
|
||||||
#include "String.hpp"
|
#include "String.hpp"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user