genie.lua 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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 "bimg_decode.lua"
  57. dofile "bimg_encode.lua"
  58. dofile(path.join(BX_DIR, "scripts/bx.lua"))
  59. if _OPTIONS["with-tools"] then
  60. group "tools"
  61. dofile "texturec.lua"
  62. end