bgfx.lua 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. --
  2. -- Copyright 2010-2015 Branimir Karadzic. All rights reserved.
  3. -- License: http://www.opensource.org/licenses/BSD-2-Clause
  4. --
  5. function bgfxProject(_name, _kind, _defines)
  6. project ("bgfx" .. _name)
  7. uuid (os.uuid("bgfx" .. _name))
  8. kind (_kind)
  9. if _kind == "SharedLib" then
  10. defines {
  11. "BGFX_SHARED_LIB_BUILD=1",
  12. }
  13. configuration { "vs20* or mingw*" }
  14. links {
  15. "gdi32",
  16. "psapi",
  17. }
  18. configuration { "mingw*" }
  19. linkoptions {
  20. "-shared",
  21. }
  22. configuration {}
  23. end
  24. includedirs {
  25. BGFX_DIR .. "3rdparty",
  26. BGFX_DIR .. "../bx/include",
  27. }
  28. defines {
  29. _defines,
  30. }
  31. if _OPTIONS["with-ovr"] then
  32. defines {
  33. "BGFX_CONFIG_USE_OVR=1",
  34. }
  35. includedirs {
  36. "$(OVR_DIR)/LibOVR/Include",
  37. }
  38. end
  39. configuration { "Debug" }
  40. defines {
  41. "BGFX_CONFIG_DEBUG=1",
  42. }
  43. configuration { "android*" }
  44. links {
  45. "EGL",
  46. "GLESv2",
  47. }
  48. configuration { "mingw* or vs2008" }
  49. includedirs {
  50. "$(DXSDK_DIR)/include",
  51. }
  52. configuration { "winphone8*"}
  53. linkoptions {
  54. "/ignore:4264" -- LNK4264: archiving object file compiled with /ZW into a static library; note that when authoring Windows Runtime types it is not recommended to link with a static library that contains Windows Runtime metadata
  55. }
  56. configuration { "xcode4 or osx or ios*" }
  57. files {
  58. BGFX_DIR .. "src/**.mm",
  59. }
  60. configuration { "osx" }
  61. links {
  62. "Cocoa.framework",
  63. }
  64. configuration { "not nacl" }
  65. includedirs {
  66. --nacl has GLES2 headers modified...
  67. BGFX_DIR .. "3rdparty/khronos",
  68. }
  69. configuration { "x64", "vs* or mingw*" }
  70. defines {
  71. "_WIN32_WINNT=0x601",
  72. }
  73. configuration {}
  74. includedirs {
  75. BGFX_DIR .. "include",
  76. }
  77. files {
  78. BGFX_DIR .. "include/**.h",
  79. BGFX_DIR .. "src/**.cpp",
  80. BGFX_DIR .. "src/**.h",
  81. }
  82. excludes {
  83. BGFX_DIR .. "src/**.bin.h",
  84. }
  85. configuration {}
  86. copyLib()
  87. end