(wip) trying to setup c++ extension
This commit is contained in:
parent
cdcc23c50a
commit
f4fd083a1a
|
|
@ -0,0 +1,4 @@
|
|||
[submodule "evolve-die-repeat/thirdparty/godot-cpp"]
|
||||
path = evolve-die-repeat/thirdparty/godot-cpp
|
||||
url = https://github.com/godotengine/godot-cpp.git
|
||||
branch = 4.5
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
bin
|
||||
*.uid
|
||||
*sconsign.dblite
|
||||
**.os
|
||||
|
||||
godot-cpp/bin/
|
||||
*.o
|
||||
*.so
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
import os
|
||||
from SCons.Script import DefaultEnvironment, ARGUMENTS, Glob, Dir
|
||||
|
||||
env = DefaultEnvironment()
|
||||
platform = ARGUMENTS.get("platform", "linux")
|
||||
target = ARGUMENTS.get("target", "template_debug") # or template_release
|
||||
arch = ARGUMENTS.get("arch", "x86_64")
|
||||
|
||||
HERE = Dir(".").abspath
|
||||
GODOTCPP = os.path.join(HERE, "godot-cpp")
|
||||
|
||||
inc_paths = [
|
||||
os.path.join(GODOTCPP, "include"),
|
||||
os.path.join(GODOTCPP, "gen", "include"),
|
||||
]
|
||||
for extra in ("godot-headers", "gdextension"):
|
||||
p = os.path.join(GODOTCPP, extra)
|
||||
if os.path.isdir(p):
|
||||
inc_paths.append(p)
|
||||
|
||||
env.Append(CPPPATH=inc_paths)
|
||||
env.Append(LIBPATH=[os.path.join(GODOTCPP, "bin")])
|
||||
env.Append(CXXFLAGS=["-std=c++17", "-fPIC"])
|
||||
|
||||
env.Append(LIBS=[f"godot-cpp.{platform}.{target}.{arch}"])
|
||||
|
||||
outdir = os.path.join(HERE, "bin")
|
||||
os.makedirs(outdir, exist_ok=True)
|
||||
soname = f"gol.{platform}.{'debug' if target == 'template_debug' else 'release'}.{arch}"
|
||||
|
||||
env.SharedLibrary(target=os.path.join(outdir, soname), source=Glob("src/*.cpp"))
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
|
||||
[configuration]
|
||||
entry_symbol = "gol_library_init"
|
||||
compatibility_minimum = "4.5" ; required in 4.5+
|
||||
reloadable = true
|
||||
|
||||
[libraries]
|
||||
linux.debug.x86_64 = "res://thirdparty/bin/libgol.linux.debug.x86_64"
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1 @@
|
|||
Subproject commit e83fd0904c13356ed1d4c3d09f8bb9132bdc6b77
|
||||
Loading…
Reference in New Issue