genie.lua 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. --
  2. -- Copyright 2010-2022 Branimir Karadzic. All rights reserved.
  3. -- License: https://github.com/bkaradzic/bimg/blob/master/LICENSE
  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. MODULE_DIR = path.getabsolute("..")
  35. BIMG_DIR = path.getabsolute("..")
  36. BX_DIR = os.getenv("BX_DIR")
  37. local BIMG_BUILD_DIR = path.join(BIMG_DIR, ".build")
  38. local BIMG_THIRD_PARTY_DIR = path.join(BIMG_DIR, "3rdparty")
  39. if not BX_DIR then
  40. BX_DIR = path.getabsolute(path.join(BIMG_DIR, "../bx"))
  41. end
  42. if not os.isdir(BX_DIR) then
  43. print("bx not found at " .. BX_DIR)
  44. print("For more info see: https://bkaradzic.github.io/bgfx/build.html")
  45. os.exit()
  46. end
  47. dofile (path.join(BX_DIR, "scripts/toolchain.lua"))
  48. if not toolchain(BIMG_BUILD_DIR, BIMG_THIRD_PARTY_DIR) then
  49. return -- no action specified
  50. end
  51. function copyLib()
  52. end
  53. group "libs"
  54. dofile(path.join(BX_DIR, "scripts/bx.lua"))
  55. dofile "bimg.lua"
  56. dofile "bimg_decode.lua"
  57. dofile "bimg_encode.lua"
  58. if _OPTIONS["with-tools"] then
  59. group "tools"
  60. dofile "texturec.lua"
  61. end