Simon Pribylski 3c939d55aa
Some checks failed
Linux arm64 / Build (push) Has been cancelled
debug xmake
2024-09-27 18:24:38 +00:00
2024-09-27 18:24:38 +00:00
2024-08-13 20:25:38 +02:00
2024-08-10 14:32:46 +02:00
2024-08-10 14:32:46 +02:00
2024-09-27 18:22:57 +00:00
2024-08-10 14:32:46 +02:00
2024-08-10 14:32:46 +02:00
2024-08-11 13:58:35 +02:00
2024-08-11 13:58:25 +02:00

This project is used to compile a GDExtension (godot engine cpp extension), and try to use xmake to manage the project.

Forked from Github

Install xmake

Install xmake from here.

How to use

You must have godot in your path

First modify the xmake.lua to change the project name, and other configurations as needed.


-- project name, this will be the output shared library name
PROJECT_NAME = "gdexample"

-- project version
VERSION = "0.0.1"

-- where is the godot project saved, default is "demo"
GODOT_PROJECT_FOLDER = "demo"

-- where to save the export project, default is "publish"
PUBLISH_FOLDER = "publish"

After change the configurations, you can run the following commands to build, run and export.


# 1. gen gdextension file (only once)
xmake gengdextension

# 2. build the project
xmake

# 3. open the editor at least once (works only in debug mode)
xmake run Editor

# 4. run the demo (works only in debug mode)
xmake run

# 5. export the project, the executable will be under "publish" folder by default
xmake p

# 6. clean the build and publish
xmake clean

# 7. generate a class that inherits from godot class, like Sprite2D
# by default the generated files will save under "src" folder, you can change it by -d folder/under/src
xmake ext-class -n MySprite2D -b Sprite2D -s myexample1 -d sample

For better support in vscode, you can use command "Xmake: UpdateIntellisense" to generate compile_commands.json, then update "compileCommands" field in c_cpp_properties.json to point to the file.

NOTE: not tested on other platforms except windows and linux.

Description
Make Godot projects with xmake !
Readme 72 KiB
Languages
Lua 85.3%
C++ 14.7%