From 2007e6f81ece5421ce000abf9b66a4ef03d3c158 Mon Sep 17 00:00:00 2001 From: Manuel Riecke Date: Sat, 19 Sep 2020 13:23:21 +0200 Subject: [PATCH 1/3] Fix CMake failing to generate the bindings. A new parameter was added to the binding_generator python file, but the CMake file was not adjusted. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d259403d..947dc8d9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -132,7 +132,7 @@ endif() # Generate source from the bindings file message(STATUS "Generating Bindings") -execute_process(COMMAND "python" "-c" "import binding_generator; binding_generator.generate_bindings(\"${GODOT_CUSTOM_API_FILE}\")" +execute_process(COMMAND "python" "-c" "import binding_generator; binding_generator.generate_bindings(\"${GODOT_CUSTOM_API_FILE}\", True)" WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} RESULT_VARIABLE GENERATION_RESULT OUTPUT_VARIABLE GENERATION_OUTPUT) From 73f1f90bf7b18a0719617cb616e5fe4698fdc2ba Mon Sep 17 00:00:00 2001 From: Manuel Riecke Date: Sat, 19 Sep 2020 13:24:11 +0200 Subject: [PATCH 2/3] Fix godot-cpp not compiling because of -Wlong-long --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 947dc8d9..9e3ef88d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -109,7 +109,7 @@ else() set(GODOT_COMPILE_FLAGS "${GODOT_COMPILE_FLAGS} -Wchar-subscripts -Wcomment -Wdisabled-optimization") set(GODOT_COMPILE_FLAGS "${GODOT_COMPILE_FLAGS} -Wformat -Wformat=2 -Wformat-security -Wformat-y2k") set(GODOT_COMPILE_FLAGS "${GODOT_COMPILE_FLAGS} -Wimport -Winit-self -Winline -Winvalid-pch -Werror") - set(GODOT_COMPILE_FLAGS "${GODOT_COMPILE_FLAGS} -Wlong-long -Wmissing-braces -Wmissing-format-attribute") + set(GODOT_COMPILE_FLAGS "${GODOT_COMPILE_FLAGS} -Wmissing-braces -Wmissing-format-attribute") set(GODOT_COMPILE_FLAGS "${GODOT_COMPILE_FLAGS} -Wmissing-include-dirs -Wmissing-noreturn -Wpacked -Wpointer-arith") set(GODOT_COMPILE_FLAGS "${GODOT_COMPILE_FLAGS} -Wredundant-decls -Wreturn-type -Wsequence-point") set(GODOT_COMPILE_FLAGS "${GODOT_COMPILE_FLAGS} -Wswitch -Wswitch-enum -Wtrigraphs") From 2989a385d759d9ef229c50fc2b1ee09d622918df Mon Sep 17 00:00:00 2001 From: Manuel Riecke Date: Sun, 20 Sep 2020 12:18:42 +0200 Subject: [PATCH 3/3] GENERATE_TEMPLATE_GET_NODE option for CMake --- CMakeLists.txt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9e3ef88d..5fb70cb2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,6 +37,8 @@ project(godot-cpp) cmake_minimum_required(VERSION 3.6) +option(GENERATE_TEMPLATE_GET_NODE "Generate a template version of the Node class's get_node." ON) + # Change the output directory to the bin directory set(BUILD_PATH ${CMAKE_SOURCE_DIR}/bin) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${BUILD_PATH}") @@ -131,8 +133,14 @@ else() endif() # Generate source from the bindings file +if(GENERATE_TEMPLATE_GET_NODE) + set(GENERATE_BINDING_PARAMETERS "True") +else() + set(GENERATE_BINDING_PARAMETERS "False") +endif() + message(STATUS "Generating Bindings") -execute_process(COMMAND "python" "-c" "import binding_generator; binding_generator.generate_bindings(\"${GODOT_CUSTOM_API_FILE}\", True)" +execute_process(COMMAND "python" "-c" "import binding_generator; binding_generator.generate_bindings(\"${GODOT_CUSTOM_API_FILE}\", ${GENERATE_BINDING_PARAMETERS})" WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} RESULT_VARIABLE GENERATION_RESULT OUTPUT_VARIABLE GENERATION_OUTPUT)