SConstruct 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #!/usr/bin/env python
  2. env = SConscript("../SConstruct")
  3. # For the reference:
  4. # - CCFLAGS are compilation flags shared between C and C++
  5. # - CFLAGS are for C-specific compilation flags
  6. # - CXXFLAGS are for C++-specific compilation flags
  7. # - CPPFLAGS are for pre-processor flags
  8. # - CPPDEFINES are for pre-processor defines
  9. # - LINKFLAGS are for linking flags
  10. # tweak this if you want to use different folders, or more folders, to store your source code in.
  11. env.Append(CPPPATH=["src/"])
  12. sources = Glob("src/*.cpp")
  13. if env["target"] in ["editor", "template_debug"]:
  14. doc_data = env.GodotCPPDocData("src/gen/doc_data.gen.cpp", source=Glob("doc_classes/*.xml"))
  15. sources.append(doc_data)
  16. if env["platform"] == "macos":
  17. library = env.SharedLibrary(
  18. "project/bin/libgdexample.{}.{}.framework/libgdexample.{}.{}".format(
  19. env["platform"], env["target"], env["platform"], env["target"]
  20. ),
  21. source=sources,
  22. )
  23. elif env["platform"] == "ios":
  24. if env["ios_simulator"]:
  25. library = env.StaticLibrary(
  26. "project/bin/libgdexample.{}.{}.simulator.a".format(env["platform"], env["target"]),
  27. source=sources,
  28. )
  29. else:
  30. library = env.StaticLibrary(
  31. "project/bin/libgdexample.{}.{}.a".format(env["platform"], env["target"]),
  32. source=sources,
  33. )
  34. else:
  35. library = env.SharedLibrary(
  36. "project/bin/libgdexample{}{}".format(env["suffix"], env["SHLIBSUFFIX"]),
  37. source=sources,
  38. )
  39. env.NoCache(library)
  40. Default(library)