bgfx.lua 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  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 { "linux-*" }
  23. buildoptions {
  24. "-fPIC",
  25. }
  26. configuration {}
  27. end
  28. includedirs {
  29. path.join(BGFX_DIR, "3rdparty"),
  30. path.join(BGFX_DIR, "../bx/include"),
  31. }
  32. defines {
  33. _defines,
  34. }
  35. if _OPTIONS["with-glfw"] then
  36. defines {
  37. "BGFX_CONFIG_MULTITHREADED=0",
  38. }
  39. end
  40. if _OPTIONS["with-ovr"] then
  41. defines {
  42. "BGFX_CONFIG_USE_OVR=1",
  43. }
  44. includedirs {
  45. "$(OVR_DIR)/LibOVR/Include",
  46. }
  47. end
  48. if (_OPTIONS["vs"] == "vs2012-xp")
  49. or (_OPTIONS["vs"] == "vs2013-xp") then
  50. configuration { "vs201*" }
  51. includedirs {
  52. "$(DXSDK_DIR)/include",
  53. }
  54. end
  55. configuration { "Debug" }
  56. defines {
  57. "BGFX_CONFIG_DEBUG=1",
  58. }
  59. configuration { "android*" }
  60. links {
  61. "EGL",
  62. "GLESv2",
  63. }
  64. configuration { "vs2008" }
  65. includedirs {
  66. "$(DXSDK_DIR)/include",
  67. }
  68. configuration { "winphone8* or winstore8*"}
  69. linkoptions {
  70. "/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
  71. }
  72. configuration { "xcode4 or osx or ios*" }
  73. files {
  74. path.join(BGFX_DIR, "src/**.mm"),
  75. }
  76. configuration { "osx" }
  77. links {
  78. "Cocoa.framework",
  79. }
  80. configuration { "not nacl" }
  81. includedirs {
  82. --nacl has GLES2 headers modified...
  83. path.join(BGFX_DIR, "3rdparty/khronos"),
  84. }
  85. configuration { "x64", "vs* or mingw*" }
  86. defines {
  87. "_WIN32_WINNT=0x601",
  88. }
  89. configuration {}
  90. includedirs {
  91. path.join(BGFX_DIR, "include"),
  92. }
  93. files {
  94. path.join(BGFX_DIR, "include/**.h"),
  95. path.join(BGFX_DIR, "src/**.cpp"),
  96. path.join(BGFX_DIR, "src/**.h"),
  97. }
  98. removefiles {
  99. path.join(BGFX_DIR, "src/**.bin.h"),
  100. }
  101. if _OPTIONS["with-amalgamated"] then
  102. excludes {
  103. path.join(BGFX_DIR, "src/bgfx.cpp"),
  104. path.join(BGFX_DIR, "src/glcontext_egl.cpp"),
  105. path.join(BGFX_DIR, "src/glcontext_glx.cpp"),
  106. path.join(BGFX_DIR, "src/glcontext_ppapi.cpp"),
  107. path.join(BGFX_DIR, "src/glcontext_wgl.cpp"),
  108. path.join(BGFX_DIR, "src/image.cpp"),
  109. path.join(BGFX_DIR, "src/ovr.cpp"),
  110. path.join(BGFX_DIR, "src/renderdoc.cpp"),
  111. path.join(BGFX_DIR, "src/renderer_d3d9.cpp"),
  112. path.join(BGFX_DIR, "src/renderer_d3d11.cpp"),
  113. path.join(BGFX_DIR, "src/renderer_d3d12.cpp"),
  114. path.join(BGFX_DIR, "src/renderer_null.cpp"),
  115. path.join(BGFX_DIR, "src/renderer_gl.cpp"),
  116. path.join(BGFX_DIR, "src/renderer_vk.cpp"),
  117. path.join(BGFX_DIR, "src/vertexdecl.cpp"),
  118. }
  119. else
  120. excludes {
  121. path.join(BGFX_DIR, "src/amalgamated.cpp"),
  122. }
  123. end
  124. configuration {}
  125. copyLib()
  126. end