Files
Patrick Exner (FlameLizard) 18aed7f3ac Rename demo to project for GDExtension docs (#11658)
* Rename demo to project for GDExtension docs

Renames demo to project based on consensus in the GDExtension meeting to
convey that GDExtensions and by extension the godot-cpp-template can be
used to both write addons but also game code

* Update tutorials/scripting/cpp/gdextension_cpp_example.rst

Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>

---------

Co-authored-by: Max Hilbrunner <mhilbrunner@users.noreply.github.com>
Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
2026-01-23 14:07:39 +01:00

33 lines
1.3 KiB
Python

#!/usr/bin/env python
import os
import sys
# You can find documentation for SCons and SConstruct files at:
# https://scons.org/documentation.html
# This lets SCons know that we're using godot-cpp, from the godot-cpp folder.
env = SConscript("godot-cpp/SConstruct")
# Configures the 'src' directory as a source for header files.
env.Append(CPPPATH=["src/"])
# Collects all .cpp files in the 'src' folder as compile targets.
sources = Glob("src/*.cpp")
# The filename for the dynamic library for this GDExtension.
# $SHLIBPREFIX is a platform specific prefix for the dynamic library ('lib' on Unix, '' on Windows).
# $SHLIBSUFFIX is the platform specific suffix for the dynamic library (for example '.dll' on Windows).
# env["suffix"] includes the build's feature tags (e.g. '.windows.template_debug.x86_64')
# (see https://docs.godotengine.org/en/stable/tutorials/export/feature_tags.html).
# The final path should match a path in the '.gdextension' file.
lib_filename = "{}gdexample{}{}".format(env.subst('$SHLIBPREFIX'), env["suffix"], env.subst('$SHLIBSUFFIX'))
# Creates a SCons target for the path with our sources.
library = env.SharedLibrary(
"project/bin/{}".format(lib_filename),
source=sources,
)
# Selects the shared library as the default target.
Default(library)