SConstruct 1.3 KB

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