genie.lua 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. --
  2. -- Copyright 2010-2025 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. newoption {
  18. trigger = "with-libheif",
  19. description = "Enable building with libheif HEIF and AVIF file format decoder.",
  20. }
  21. solution "bimg"
  22. configurations {
  23. "Debug",
  24. "Release",
  25. }
  26. if _ACTION == "xcode4" then
  27. platforms {
  28. "Universal",
  29. }
  30. else
  31. platforms {
  32. "x32",
  33. "x64",
  34. "Native", -- for targets where bitness is not specified
  35. }
  36. end
  37. language "C++"
  38. MODULE_DIR = path.getabsolute("..")
  39. BIMG_DIR = path.getabsolute("..")
  40. BX_DIR = os.getenv("BX_DIR")
  41. local BIMG_BUILD_DIR = path.join(BIMG_DIR, ".build")
  42. local BIMG_THIRD_PARTY_DIR = path.join(BIMG_DIR, "3rdparty")
  43. if not BX_DIR then
  44. BX_DIR = path.getabsolute(path.join(BIMG_DIR, "../bx"))
  45. end
  46. if not os.isdir(BX_DIR) then
  47. print("bx not found at " .. BX_DIR)
  48. print("For more info see: https://bkaradzic.github.io/bgfx/build.html")
  49. os.exit()
  50. end
  51. dofile (path.join(BX_DIR, "scripts/toolchain.lua"))
  52. if not toolchain(BIMG_BUILD_DIR, BIMG_THIRD_PARTY_DIR) then
  53. return -- no action specified
  54. end
  55. function copyLib()
  56. end
  57. group "libs"
  58. dofile(path.join(BX_DIR, "scripts/bx.lua"))
  59. dofile "bimg.lua"
  60. dofile "bimg_decode.lua"
  61. dofile "bimg_encode.lua"
  62. if _OPTIONS["with-tools"] then
  63. group "tools"
  64. dofile "texturec.lua"
  65. end