bgfx.lua 1.7 KB

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