bgfx.lua 3.0 KB

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