bgfx.lua 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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. path.join(BGFX_DIR, "3rdparty"),
  26. path.join(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. if (_OPTIONS["vs"] == "vs2012-xp")
  40. or (_OPTIONS["vs"] == "vs2013-xp") then
  41. configuration { "vs201*" }
  42. includedirs {
  43. "$(DXSDK_DIR)/include",
  44. }
  45. end
  46. configuration { "Debug" }
  47. defines {
  48. "BGFX_CONFIG_DEBUG=1",
  49. }
  50. configuration { "android*" }
  51. links {
  52. "EGL",
  53. "GLESv2",
  54. }
  55. configuration { "mingw* or vs2008" }
  56. includedirs {
  57. "$(DXSDK_DIR)/include",
  58. }
  59. configuration { "winphone8*"}
  60. linkoptions {
  61. "/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
  62. }
  63. configuration { "xcode4 or osx or ios*" }
  64. files {
  65. path.join(BGFX_DIR, "src/**.mm"),
  66. }
  67. configuration { "osx" }
  68. links {
  69. "Cocoa.framework",
  70. }
  71. configuration { "not nacl" }
  72. includedirs {
  73. --nacl has GLES2 headers modified...
  74. path.join(BGFX_DIR, "3rdparty/khronos"),
  75. }
  76. configuration { "x64", "vs* or mingw*" }
  77. defines {
  78. "_WIN32_WINNT=0x601",
  79. }
  80. configuration {}
  81. includedirs {
  82. path.join(BGFX_DIR, "include"),
  83. }
  84. files {
  85. path.join(BGFX_DIR, "include/**.h"),
  86. path.join(BGFX_DIR, "src/**.cpp"),
  87. path.join(BGFX_DIR, "src/**.h"),
  88. }
  89. excludes {
  90. path.join(BGFX_DIR, "src/**.bin.h"),
  91. }
  92. configuration {}
  93. copyLib()
  94. end