Rename godot-headers to gdextension, move header to top folder

Changes the `<godot/gdextension_interface.h>` include to simply
`<gdextension_interface.h>`.

Refactor and better document the SCons and CMake logic around setting
the paths to the header and API JSON file.
This commit is contained in:
Rémi Verschelde
2022-12-14 00:40:17 +01:00
parent 1e8eb1c1f2
commit bab247dcb6
22 changed files with 68 additions and 50 deletions

View File

@@ -1,7 +1,7 @@
project(godot-cpp-test)
cmake_minimum_required(VERSION 3.6)
set(GODOT_HEADERS_PATH ../godot-headers/ CACHE STRING "Path to Godot headers")
set(GODOT_GDEXTENSION_DIR ../gdextension/ CACHE STRING "Path to GDExtension interface header directory")
set(CPP_BINDINGS_PATH ../ CACHE STRING "Path to C++ bindings")
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
@@ -102,8 +102,8 @@ add_library(${PROJECT_NAME} SHARED ${SOURCES} ${HEADERS})
target_include_directories(${PROJECT_NAME} SYSTEM
PRIVATE
${CPP_BINDINGS_PATH}/include
${CPP_BINDINGS_PATH}/gen/include
${GODOT_HEADERS_PATH}
${CPP_BINDINGS_PATH}/gen/include
${GODOT_GDEXTENSION_DIR}
)
# Create the correct name (godot.os.build_type.system_bits)

View File

@@ -5,7 +5,7 @@
#include "register_types.h"
#include <godot/gdextension_interface.h>
#include <gdextension_interface.h>
#include <godot_cpp/core/class_db.hpp>
#include <godot_cpp/core/defs.hpp>