Git Product home page Git Product logo

gdextension-cpp-xmake-template's Introduction

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

It is mainly for learning purpose.

Install xmake

Install xmake from here.

How to use

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. build the project
xmake build

# 2. run the demo
xmake run

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

# 4. clean the build and publish
xmake clean

# 5. 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 execept windows.

gdextension-cpp-xmake-template's People

Contributors

chaosddp avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.