mirror of
https://github.com/Relintai/gdnative_cpp.git
synced 2024-11-20 10:57:23 +01: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)
|
||||
#
|
||||
# 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
|
||||
#
|
||||
# Android cmake arguments
|
||||
@ -75,8 +75,8 @@ if(NOT DEFINED BITS)
|
||||
endif()
|
||||
|
||||
# Input from user for godot headers and the api file
|
||||
set(GODOT_HEADERS_DIR "godot-headers" CACHE STRING "")
|
||||
set(GODOT_CUSTOM_API_FILE "godot-headers/api.json" CACHE STRING "")
|
||||
set(GODOT_HEADERS_DIR "pandemonium_headers" CACHE STRING "")
|
||||
set(GODOT_CUSTOM_API_FILE "pandemonium_headers/api.json" CACHE STRING "")
|
||||
|
||||
set(GODOT_COMPILE_FLAGS )
|
||||
set(GODOT_LINKER_FLAGS )
|
||||
|
2
Makefile
2
Makefile
@ -1,5 +1,5 @@
|
||||
GENERATE_BINDINGS = no
|
||||
HEADERS = godot-headers
|
||||
HEADERS = pandemonium_headers
|
||||
TARGET = debug
|
||||
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
|
||||
> 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.
|
||||
|
||||
## 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
|
||||
GitHub. In this case, you need to download both
|
||||
[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
|
||||
mkdir SimpleLibrary
|
||||
@ -79,7 +79,7 @@ Right now, our directory structure should look like this:
|
||||
```text
|
||||
SimpleLibrary/
|
||||
├─godot-cpp/
|
||||
| └─godot-headers/
|
||||
| └─pandemonium_headers/
|
||||
├─bin/
|
||||
└─src/
|
||||
```
|
||||
@ -91,7 +91,7 @@ Godot core. This metadata is required to generate the C++ binding classes for
|
||||
use in GDNative modules.
|
||||
|
||||
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
|
||||
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
|
||||
@ -235,7 +235,7 @@ Once you've compiled the GDNative C++ bindings (see above), you can compile the
|
||||
|
||||
```bash
|
||||
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>
|
||||
```
|
||||
|
||||
@ -247,7 +247,7 @@ This creates the file `libtest.so` in your `SimpleLibrary/bin` directory.
|
||||
|
||||
```bash
|
||||
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>
|
||||
```
|
||||
|
||||
@ -270,7 +270,7 @@ submit a pull request :slightly_smiling_face:
|
||||
|
||||
```bash
|
||||
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>
|
||||
```
|
||||
|
||||
@ -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
|
||||
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
|
||||
[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.
|
||||
|
||||
#### HTML5
|
||||
@ -295,7 +295,7 @@ To build GDNative libraries, you will need a recent version of [Emscripten](http
|
||||
|
||||
```bash
|
||||
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).
|
||||
@ -305,7 +305,7 @@ This creates the file `libtest.so` in your `SimpleLibrary/bin` directory.
|
||||
### Creating `.gdnlib` and `.gdns` files
|
||||
|
||||
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
|
||||
various platforms. This makes the library usable from Godot in a
|
||||
platform-independent manner.
|
||||
|
@ -129,7 +129,7 @@ opts.Add(
|
||||
PathVariable(
|
||||
"headers_dir",
|
||||
"Path to the directory containing Godot headers",
|
||||
"godot-headers",
|
||||
"pandemonium_headers",
|
||||
PathVariable.PathIsDir,
|
||||
)
|
||||
)
|
||||
|
@ -31,7 +31,7 @@
|
||||
#ifndef ARRAY_H
|
||||
#define ARRAY_H
|
||||
|
||||
#include <gdnative/array.h>
|
||||
#include <gdn/array.h>
|
||||
|
||||
#include "String.hpp"
|
||||
|
||||
|
@ -31,7 +31,7 @@
|
||||
#ifndef BASIS_H
|
||||
#define BASIS_H
|
||||
|
||||
#include <gdnative/basis.h>
|
||||
#include <gdn/basis.h>
|
||||
|
||||
#include "Defs.hpp"
|
||||
|
||||
|
@ -31,7 +31,7 @@
|
||||
#ifndef COLOR_H
|
||||
#define COLOR_H
|
||||
|
||||
#include <gdnative/color.h>
|
||||
#include <gdn/color.h>
|
||||
|
||||
#include <cmath>
|
||||
|
||||
|
@ -35,7 +35,7 @@
|
||||
|
||||
#include "Array.hpp"
|
||||
|
||||
#include <gdnative/dictionary.h>
|
||||
#include <gdn/dictionary.h>
|
||||
|
||||
namespace godot {
|
||||
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
#include "String.hpp"
|
||||
|
||||
#include <gdnative/node_path.h>
|
||||
#include <gdn/node_path.h>
|
||||
|
||||
namespace godot {
|
||||
|
||||
|
@ -39,7 +39,7 @@
|
||||
#include "Vector2.hpp"
|
||||
#include "Vector3.hpp"
|
||||
|
||||
#include <gdnative/pool_arrays.h>
|
||||
#include <gdn/pool_arrays.h>
|
||||
|
||||
namespace godot {
|
||||
|
||||
|
@ -31,7 +31,7 @@
|
||||
#ifndef RID_H
|
||||
#define RID_H
|
||||
|
||||
#include <gdnative/rid.h>
|
||||
#include <gdn/rid.h>
|
||||
|
||||
namespace godot {
|
||||
|
||||
|
@ -31,7 +31,7 @@
|
||||
#ifndef STRING_H
|
||||
#define STRING_H
|
||||
|
||||
#include <gdnative/string.h>
|
||||
#include <gdn/string.h>
|
||||
|
||||
namespace godot {
|
||||
|
||||
|
@ -31,7 +31,7 @@
|
||||
#ifndef VARIANT_H
|
||||
#define VARIANT_H
|
||||
|
||||
#include <gdnative/variant.h>
|
||||
#include <gdn/variant.h>
|
||||
|
||||
#include "Defs.hpp"
|
||||
|
||||
|
@ -31,7 +31,7 @@
|
||||
#ifndef VECTOR2_H
|
||||
#define VECTOR2_H
|
||||
|
||||
#include <gdnative/vector2.h>
|
||||
#include <gdn/vector2.h>
|
||||
|
||||
#include "Defs.hpp"
|
||||
|
||||
|
@ -31,7 +31,7 @@
|
||||
#ifndef VECTOR3_H
|
||||
#define VECTOR3_H
|
||||
|
||||
#include <gdnative/vector3.h>
|
||||
#include <gdn/vector3.h>
|
||||
|
||||
#include "Defs.hpp"
|
||||
|
||||
|
@ -31,7 +31,7 @@
|
||||
#ifndef WRAPPED_HPP
|
||||
#define WRAPPED_HPP
|
||||
|
||||
#include <gdnative/gdnative.h>
|
||||
#include <gdn/gdnative.h>
|
||||
|
||||
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
|
||||
|
||||
api_filepath = "godot-headers/api.json"
|
||||
api_filepath = "pandemonium_headers/api.json"
|
||||
bits = "64"
|
||||
double = "float"
|
||||
output_dir = "self_test"
|
||||
|
@ -32,7 +32,7 @@
|
||||
#include "Defs.hpp"
|
||||
#include "String.hpp"
|
||||
|
||||
#include <gdnative/color.h>
|
||||
#include <gdn/color.h>
|
||||
#include <cmath>
|
||||
|
||||
namespace godot {
|
||||
|
@ -32,7 +32,7 @@
|
||||
#include "GodotGlobal.hpp"
|
||||
#include "String.hpp"
|
||||
|
||||
#include <gdnative/node_path.h>
|
||||
#include <gdn/node_path.h>
|
||||
|
||||
namespace godot {
|
||||
|
||||
|
@ -36,7 +36,7 @@
|
||||
#include "Vector2.hpp"
|
||||
#include "Vector3.hpp"
|
||||
|
||||
#include <gdnative/pool_arrays.h>
|
||||
#include <gdn/pool_arrays.h>
|
||||
|
||||
namespace godot {
|
||||
|
||||
|
@ -30,7 +30,7 @@
|
||||
|
||||
#include "RID.hpp"
|
||||
|
||||
#include <gdnative/rid.h>
|
||||
#include <gdn/rid.h>
|
||||
|
||||
#include "GodotGlobal.hpp"
|
||||
|
||||
|
@ -36,7 +36,7 @@
|
||||
#include "PoolArrays.hpp"
|
||||
#include "Variant.hpp"
|
||||
|
||||
#include <gdnative/string.h>
|
||||
#include <gdn/string.h>
|
||||
|
||||
#include <string.h>
|
||||
|
||||
|
@ -30,7 +30,7 @@
|
||||
|
||||
#include "Variant.hpp"
|
||||
|
||||
#include <gdnative/variant.h>
|
||||
#include <gdn/variant.h>
|
||||
|
||||
#include "CoreTypes.hpp"
|
||||
#include "Defs.hpp"
|
||||
|
@ -30,7 +30,7 @@
|
||||
|
||||
#include "Vector2.hpp"
|
||||
|
||||
#include <gdnative/vector2.h>
|
||||
#include <gdn/vector2.h>
|
||||
|
||||
#include "String.hpp"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user