SConstruct 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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["platform"] == "macos":
  14. library = env.SharedLibrary(
  15. "project/bin/libgdexample.{}.{}.framework/libgdexample.{}.{}".format(
  16. env["platform"], env["target"], env["platform"], env["target"]
  17. ),
  18. source=sources,
  19. )
  20. elif env["platform"] == "ios":
  21. if env["ios_simulator"]:
  22. library = env.StaticLibrary(
  23. "project/bin/libgdexample.{}.{}.simulator.a".format(env["platform"], env["target"]),
  24. source=sources,
  25. )
  26. else:
  27. library = env.StaticLibrary(
  28. "project/bin/libgdexample.{}.{}.a".format(env["platform"], env["target"]),
  29. source=sources,
  30. )
  31. else:
  32. library = env.SharedLibrary(
  33. "project/bin/libgdexample{}{}".format(env["suffix"], env["SHLIBSUFFIX"]),
  34. source=sources,
  35. )
  36. env.NoCache(library)
  37. Default(library)