diff options
author | Fredia Huya-Kouadio <fhuya@meta.com> | 2023-08-17 07:32:10 -0700 |
---|---|---|
committer | Fredia Huya-Kouadio <fhuya@meta.com> | 2023-08-17 11:07:46 -0700 |
commit | 37e27e3db22c0b33d098a0ac1fb2dfe8861be0fb (patch) | |
tree | 741a6563c1795437c0ad5b80c6121b5476861361 /plugins/hello_gdextension/SConstruct | |
parent | e61f1555b696b62152787d0fee14435325aee62b (diff) | |
download | godot-android-samples-37e27e3db22c0b33d098a0ac1fb2dfe8861be0fb.tar.gz godot-android-samples-37e27e3db22c0b33d098a0ac1fb2dfe8861be0fb.tar.bz2 godot-android-samples-37e27e3db22c0b33d098a0ac1fb2dfe8861be0fb.zip |
Add an Android GDExtension plugin sample
This sample shows how to integrate gdextension capabilities with Android java/kotlin code by leveraging JNI.
Diffstat (limited to 'plugins/hello_gdextension/SConstruct')
-rw-r--r-- | plugins/hello_gdextension/SConstruct | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/plugins/hello_gdextension/SConstruct b/plugins/hello_gdextension/SConstruct new file mode 100644 index 0000000..c704717 --- /dev/null +++ b/plugins/hello_gdextension/SConstruct @@ -0,0 +1,30 @@ +#!/usr/bin/env python +import os +import sys + +env = SConscript("godot-cpp/SConstruct") + +# For reference: +# - CCFLAGS are compilation flags shared between C and C++ +# - CFLAGS are for C-specific compilation flags +# - CXXFLAGS are for C++-specific compilation flags +# - CPPFLAGS are for pre-processor flags +# - CPPDEFINES are for pre-processor defines +# - LINKFLAGS are for linking flags + +# tweak this if you want to use different folders, or more folders, to store your source code in. +env.Append(CPPPATH=["src/main/cpp"]) +sources = Glob("src/main/cpp/*.cpp") + +if env["platform"] == "macos": + library = env.SharedLibrary( + "src/main/assets/addons/hello_gdextension_plugin/.bin/libhello_gdextension.{}.{}.framework/libhello_gdextension.{}.{}".format(env["platform"], env["target"], env["platform"], env["target"]), + source=sources, + ) +else: + library = env.SharedLibrary( + "src/main/assets/addons/hello_gdextension_plugin/.bin/libhello_gdextension{}{}".format(env["suffix"], env["SHLIBSUFFIX"]), + source=sources, + ) + +Default(library) |