bgfx.lua 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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 { "mingw*" }
  14. linkoptions {
  15. "-shared",
  16. }
  17. links {
  18. "gdi32",
  19. }
  20. configuration {}
  21. end
  22. includedirs {
  23. BGFX_DIR .. "3rdparty",
  24. BGFX_DIR .. "../bx/include",
  25. }
  26. defines {
  27. _defines,
  28. }
  29. if _OPTIONS["with-ovr"] then
  30. defines {
  31. "BGFX_CONFIG_USE_OVR=1",
  32. }
  33. includedirs {
  34. "$(OVR_DIR)/LibOVR/Include",
  35. }
  36. end
  37. configuration { "Debug" }
  38. defines {
  39. "BGFX_CONFIG_DEBUG=1",
  40. }
  41. configuration { "android*" }
  42. links {
  43. "EGL",
  44. "GLESv2",
  45. }
  46. configuration { "mingw* or vs2008" }
  47. includedirs {
  48. "$(DXSDK_DIR)/include",
  49. }
  50. configuration { "winphone8*"}
  51. linkoptions {
  52. "/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
  53. }
  54. configuration { "xcode4 or osx or ios*" }
  55. files {
  56. BGFX_DIR .. "src/**.mm",
  57. }
  58. configuration { "osx" }
  59. links {
  60. "Cocoa.framework",
  61. }
  62. configuration { "not nacl" }
  63. includedirs {
  64. --nacl has GLES2 headers modified...
  65. BGFX_DIR .. "3rdparty/khronos",
  66. }
  67. configuration { "x64", "vs* or mingw*" }
  68. defines {
  69. "_WIN32_WINNT=0x601",
  70. }
  71. configuration {}
  72. includedirs {
  73. BGFX_DIR .. "include",
  74. }
  75. files {
  76. BGFX_DIR .. "include/**.h",
  77. BGFX_DIR .. "src/**.cpp",
  78. BGFX_DIR .. "src/**.h",
  79. }
  80. excludes {
  81. BGFX_DIR .. "src/**.bin.h",
  82. }
  83. configuration {}
  84. copyLib()
  85. end