Commit Graph

47 Commits (6884ca9be0ed9c50bc1b46e5c68d963aecb2a9eb)

Author SHA1 Message Date
Rémi Verschelde 2e42c7020e CMake: Remove hardcoded warnings list and forcing -Werror on library builds
The CMake buildsystem should be completely reviewed to properly match
what is done by SCons, instead of making its own arbitrary decisions on
how godot-cpp should be compiled.

Currently the SCons setup doesn't include warning options, so CMake
shouldn't either. Options similar to upstream Godot's SCons setup could
be added, and then replicated for CMake.

(cherry picked from commit 41517eacb1)
2024-01-22 15:53:49 -06:00
LAK132 d5a2e8e797 Fix file list issues when trying to build with meson via cmake
(cherry picked from commit 39c139c814)
2024-01-22 15:53:49 -06:00
Bytzo 6bb4b1d321 Prevent CMake from always including debug symbols
(cherry picked from commit db884e9b1d)
2024-01-22 15:53:49 -06:00
Rémi Verschelde ef8a499eac SCons: Disable C++ exception handling by default
Counterpart to https://github.com/godotengine/godot/pull/80612.

(cherry picked from commit bf1c03ab5f)
2023-10-23 10:10:59 -05:00
bruvzg d1aeba771a
[MSVC] Force UTF-8 encoding. 2023-07-11 16:11:51 +03:00
Alex 7f94f90b01 Update CMakeLists.txt 2023-05-06 09:55:41 +03:00
Andy Maloney 2379034958 {cmake} Use STATIC and POSITION_INDEPENDENT_CODE
Instead of specifying flags manually, use CMake.
2023-02-07 10:24:25 -05:00
Rémi Verschelde 50e97de636
Merge pull request #1008 from asmaloney/cmake-compiler-warnings
{cmake} Use the same compiler warnings as godot
2023-02-07 14:00:04 +01:00
Andy Maloney d081b4bab6 {cmake} Use the same compiler warnings as godot 2023-02-04 11:18:19 -05:00
Andy Maloney 2a221300de {cmake} Combine target_include_directories
Makes all include directories consistent.

Turns GODOT_CPP_SYSTEM_HEADERS ON by default since that's what was already being done for ${GODOT_GDEXTENSION_DIR}.
2023-02-02 12:58:03 -05:00
Andy Maloney 1351710a18 {cmake} Add GODOT_CPP_SYSTEM_HEADERS option to mark includes as SYSTEM
From the cmake docs:

"This may have effects such as suppressing warnings or skipping the contained headers in dependency calculations (see compiler documentation). Additionally, system include directories are searched after normal include directories regardless of the order specified."

Addresses part of #999
2023-01-18 21:15:34 -05:00
Ricardo Buring 47140cdad0 Rename float=64 build option to precision=double
This makes the build system consistent with Godot again.
Also fix CMake build to define REAL_T_IS_DOUBLE when precision=double.
2023-01-09 23:22:03 +01:00
Rémi Verschelde bab247dcb6
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.
2022-12-14 12:36:59 +01:00
Gilles Roudière c02e644679 Rename GDNative to GDExtension
Non-exhaustive list of case-sensitive renames:

GDExtension -> GDNative
GDNATIVE -> GDEXTENSION
gdextension -> gdnative
ExtensionExtension -> Extension (for where there was GDNativeExtension)
EXTENSION_EXTENSION -> EXTENSION (for where there was GDNATIVE_EXTENSION)
gdnlib -> gdextension
gdn_interface -> gde_interface
gdni -> gde_interface
2022-12-12 11:06:38 +01:00
Andy Maloney bb13b957de {cmake} Updates for target-based approach
- instead of setting globals which can effect other projects including this as a subdirectory, set them on the target if possible
- add "CONFIGURE_DEPENDS" to GLOBs to check for changes
- update required CMake version to 3.12 (still ancient - 2018) to support these
2022-12-04 17:37:38 -05:00
Fabio Alessandrelli 081d425277 [MSVC] Add NOMINMAX flag to scons and cmake.
Ensures user inclusion of windows.h do not define "min" and "max"
macros.
2022-09-12 13:12:55 +02:00
Joshua Cooper 165ad14b0f CMake: fix CMAKE_BUILD_TYPE and BITS check 2022-07-18 13:01:04 +02:00
Rémi Verschelde 9b4519280a CMake: Fixup build after #732 2022-07-18 12:58:50 +02:00
Rémi Verschelde 3c73d1a7a2
CMake: Don't use `-fPIC` on Windows (#732) 2022-07-18 11:55:30 +02:00
bruvzg e06d5cd414
Add double precision build support. 2022-05-04 15:56:35 +03:00
Pxl b7ade95edc
Update CMakeLists.txt
fix compile fail when windows with llvm+ninja
2022-03-26 13:09:25 +08:00
Rémi Verschelde 82bc102581 Sync `misc/` scripts and hooks with upstream Godot 2022-03-15 10:18:33 +01:00
Nicolás Carrasco df87396cf3 Merge branch 'master' of https://github.com/godotengine/godot-cpp into test_cmake_windows 2022-02-20 22:59:56 +01:00
Nicolás Carrasco f227a0179f Fix Test CMake project for Windows and parametrize paths 2022-01-26 20:12:05 +01:00
Ivorius 3475ad69b3
In CMakeLists, use the new FindPython3 instead of FindPython 2021-12-29 15:02:38 +01:00
O01eg c5fd3d00d2
Test CMake project with CI (#518) 2021-12-24 01:29:21 +01:00
Bradley Clemetson c608277bcf
Require at least python 3 2021-12-11 15:32:49 -08:00
Nickolai Korshunov 5336c7e97b synced windows compile definitions with scons configuration
df9164b9bd
2021-11-11 15:19:16 +03:00
Hennadii Chernyshchyk 2f92b4a37d
Rework debug flags for CMake
* Attach debug flags to the target and mark as `PUBLIC`. This will allow all
  projects that use bindings not to add the same defines manually.
* Use generator-expressions to support multiconfig generators (such as
  MSVC).
* Remove excplitic `NDEBUG` and `_DEBUG` flags, CMake handles it
  automatically.
2021-10-03 17:30:37 +03:00
Bastiaan Olij 68ebc9b2a8 Changed over to proper godot-headers 2021-09-27 23:08:12 +10:00
Hennadii Chernyshchyk 50774cf0fb Add alias 2021-09-27 23:08:10 +10:00
Hennadii Chernyshchyk f24dcf4ff9 Specify project languages 2021-09-27 23:08:10 +10:00
Hennadii Chernyshchyk 3b40a38c66 Remove Generating Bindings message
Bindings are generated using `generate_bindings` and the command contains the `COMMENT` parameter, which will display a message about the generation.
2021-09-27 23:08:10 +10:00
Hennadii Chernyshchyk 6daaeb6dba Do not override build path 2021-09-27 23:08:09 +10:00
Hennadii Chernyshchyk a904518075 Fix OUTPUT for add_custom_command 2021-09-27 23:08:09 +10:00
George Marques 8bcf32a619 Fix issues with method calls 2021-09-27 23:08:08 +10:00
George Marques e4ed48976a Replace bindgins to work with extensions 2021-09-27 23:08:08 +10:00
Hristo Stamenov c629200b93
Update `string(TOLOWER ...)` to take string versions of CMake variables (#561)
On some generators (MSVC) there is the issue that this line produces cause by the variable being expanded and not being surrounded by quotes.
2021-05-20 14:47:20 +02:00
Matteo De Carlo 0c8dd096c4 Fix cmake source file generation 2021-03-03 19:40:54 +01:00
oleg 52f786b923
Search correct python interpeter in case missing default "python" 2021-03-01 15:46:11 +03:00
George Marques aa2792528e
Merge pull request #456 from API-Beast/master
Fix compiling using CMake and GCC
2021-03-01 09:37:54 -03:00
Rémi Verschelde b36df8f86c Rename godot_headers to godot-headers to match upstream rename
Also updated the URLs which were still pointing to the old GitHub org.
2021-02-26 10:07:38 +01:00
Manuel Riecke 2989a385d7 GENERATE_TEMPLATE_GET_NODE option for CMake 2020-09-20 12:18:42 +02:00
Manuel Riecke 73f1f90bf7 Fix godot-cpp not compiling because of -Wlong-long 2020-09-19 13:42:00 +02:00
Manuel Riecke 2007e6f81e 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.
2020-09-19 13:42:00 +02:00
Philip Whitfield 51233fa1a9 Update CMakeLists.txt
changes so this cmake file can be used as a subdirectory
```
add_subdirectory(godot-cpp)

project(project-name)
add_library(project-name SHARED src/init.cpp)
target_link_libraries(project-name godot-cpp)
```
2019-04-12 23:29:56 +10:00
Acclution 7a22fd0a78 Updated cmake to the new nativescript 1.1 2018-12-02 22:14:26 +01:00