SConstruct 1.3 KB

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