bgfx.lua 2.1 KB

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