genie.lua 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. --
  2. -- Copyright 2010-2017 Branimir Karadzic. All rights reserved.
  3. -- License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
  4. --
  5. newoption {
  6. trigger = "with-amalgamated",
  7. description = "Enable amalgamated build.",
  8. }
  9. newoption {
  10. trigger = "with-shared-lib",
  11. description = "Enable building shared library.",
  12. }
  13. newoption {
  14. trigger = "with-tools",
  15. description = "Enable building tools.",
  16. }
  17. solution "bimg"
  18. configurations {
  19. "Debug",
  20. "Release",
  21. }
  22. if _ACTION == "xcode4" then
  23. platforms {
  24. "Universal",
  25. }
  26. else
  27. platforms {
  28. "x32",
  29. "x64",
  30. "Native", -- for targets where bitness is not specified
  31. }
  32. end
  33. language "C++"
  34. startproject "example-00-helloworld"
  35. MODULE_DIR = path.getabsolute("..")
  36. BIMG_DIR = path.getabsolute("..")
  37. BX_DIR = os.getenv("BX_DIR")
  38. local BIMG_BUILD_DIR = path.join(BIMG_DIR, ".build")
  39. local BIMG_THIRD_PARTY_DIR = path.join(BIMG_DIR, "3rdparty")
  40. if not BX_DIR then
  41. BX_DIR = path.getabsolute(path.join(BIMG_DIR, "../bx"))
  42. end
  43. if not os.isdir(BX_DIR) then
  44. print("bx not found at " .. BX_DIR)
  45. print("For more info see: https://bkaradzic.github.io/bgfx/build.html")
  46. os.exit()
  47. end
  48. dofile (path.join(BX_DIR, "scripts/toolchain.lua"))
  49. if not toolchain(BIMG_BUILD_DIR, BIMG_THIRD_PARTY_DIR) then
  50. return -- no action specified
  51. end
  52. function copyLib()
  53. end
  54. group "libs"
  55. dofile "bimg.lua"
  56. dofile(path.join(BX_DIR, "scripts/bx.lua"))
  57. if _OPTIONS["with-tools"] then
  58. group "tools"
  59. dofile "texturec.lua"
  60. end