premake4.lua 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. --
  2. -- Copyright 2010-2014 Branimir Karadzic. All rights reserved.
  3. -- License: http://www.opensource.org/licenses/BSD-2-Clause
  4. --
  5. newoption {
  6. trigger = "with-tools",
  7. description = "Enable building tools.",
  8. }
  9. solution "bgfx"
  10. configurations {
  11. "Debug",
  12. "Release",
  13. }
  14. platforms {
  15. "x32",
  16. "x64",
  17. -- "Xbox360",
  18. "Native", -- for targets where bitness is not specified
  19. }
  20. language "C++"
  21. BGFX_DIR = (path.getabsolute("..") .. "/")
  22. local BGFX_BUILD_DIR = (BGFX_DIR .. ".build/")
  23. local BGFX_THIRD_PARTY_DIR = (BGFX_DIR .. "3rdparty/")
  24. BX_DIR = (BGFX_DIR .. "../bx/")
  25. defines {
  26. "BX_CONFIG_ENABLE_MSVC_LEVEL4_WARNINGS=1"
  27. }
  28. dofile (BX_DIR .. "premake/toolchain.lua")
  29. toolchain(BGFX_BUILD_DIR, BGFX_THIRD_PARTY_DIR)
  30. function copyLib()
  31. end
  32. function exampleProject(_name, _uuid)
  33. project ("example-" .. _name)
  34. uuid (_uuid)
  35. kind "WindowedApp"
  36. configuration {}
  37. debugdir (BGFX_DIR .. "examples/runtime/")
  38. includedirs {
  39. BX_DIR .. "include",
  40. BGFX_DIR .. "include",
  41. BGFX_DIR .. "3rdparty",
  42. BGFX_DIR .. "examples/common",
  43. }
  44. files {
  45. BGFX_DIR .. "examples/" .. _name .. "/**.cpp",
  46. BGFX_DIR .. "examples/" .. _name .. "/**.h",
  47. }
  48. links {
  49. "bgfx",
  50. "example-common",
  51. }
  52. configuration { "vs*" }
  53. linkoptions {
  54. "/ignore:4199", -- LNK4199: /DELAYLOAD:*.dll ignored; no imports found from *.dll
  55. }
  56. links { -- this is needed only for testing with GLES2/3 on Windows with VS2008
  57. "DelayImp",
  58. }
  59. configuration { "vs2010" }
  60. linkoptions { -- this is needed only for testing with GLES2/3 on Windows with VS201x
  61. "/DELAYLOAD:\"libEGL.dll\"",
  62. "/DELAYLOAD:\"libGLESv2.dll\"",
  63. }
  64. configuration { "android*" }
  65. kind "ConsoleApp"
  66. targetextension ".so"
  67. linkoptions {
  68. "-shared",
  69. }
  70. links {
  71. "EGL",
  72. "GLESv2",
  73. }
  74. configuration { "nacl or nacl-arm" }
  75. kind "ConsoleApp"
  76. targetextension ".nexe"
  77. links {
  78. "ppapi",
  79. "ppapi_gles2",
  80. "pthread",
  81. }
  82. configuration { "pnacl" }
  83. kind "ConsoleApp"
  84. targetextension ".pexe"
  85. links {
  86. "ppapi",
  87. "ppapi_gles2",
  88. "pthread",
  89. }
  90. configuration { "asmjs" }
  91. kind "ConsoleApp"
  92. targetextension ".bc"
  93. configuration { "linux-*" }
  94. links {
  95. "X11",
  96. "GL",
  97. "pthread",
  98. }
  99. configuration { "osx" }
  100. files {
  101. BGFX_DIR .. "examples/common/**.mm",
  102. }
  103. links {
  104. "Cocoa.framework",
  105. "OpenGL.framework",
  106. -- "SDL2",
  107. }
  108. configuration { "ios*" }
  109. kind "ConsoleApp"
  110. files {
  111. BGFX_DIR .. "examples/common/**.mm",
  112. }
  113. linkoptions {
  114. "-framework CoreFoundation",
  115. "-framework Foundation",
  116. "-framework OpenGLES",
  117. "-framework UIKit",
  118. "-framework QuartzCore",
  119. }
  120. configuration { "qnx*" }
  121. targetextension ""
  122. links {
  123. "EGL",
  124. "GLESv2",
  125. }
  126. configuration {}
  127. strip()
  128. end
  129. dofile "bgfx.lua"
  130. dofile "example-common.lua"
  131. exampleProject("00-helloworld", "ff2c8450-ebf4-11e0-9572-0800200c9a66")
  132. exampleProject("01-cubes", "fec3bc94-e1e5-11e1-9c59-c7eeec2c1c51")
  133. exampleProject("02-metaballs", "413b2cb4-f7db-11e1-bf5f-a716de6a022f")
  134. exampleProject("03-raymarch", "1cede802-0220-11e2-91ba-e108de6a022f")
  135. exampleProject("04-mesh", "546bbc76-0c4a-11e2-ab09-debcdd6a022f")
  136. exampleProject("05-instancing", "5d3da660-1105-11e2-aece-71e4dd6a022f")
  137. exampleProject("06-bump", "ffb23e6c-167b-11e2-81df-94c4dd6a022f")
  138. exampleProject("07-callback", "acc53bbc-52f0-11e2-9781-ad8edd4b7d02")
  139. exampleProject("08-update", "e011e246-5862-11e2-b202-b7cb257a7926")
  140. exampleProject("09-hdr", "969a4626-67ee-11e2-9726-9023267a7926")
  141. exampleProject("10-font" , "ef6fd5b3-b52a-41c2-a257-9dfe709af9e1")
  142. exampleProject("11-fontsdf", "f4e6f96f-3daa-4c68-8df8-bf2a3ecd9092")
  143. exampleProject("12-lod", "0512e9e6-bfd8-11e2-8e34-0291bd4c8125")
  144. exampleProject("13-stencil", "d12d6522-37bc-11e3-b89c-e46428d43830")
  145. exampleProject("14-shadowvolumes", "d7eb4bcc-37bc-11e3-b7a4-e46428d43830")
  146. exampleProject("15-shadowmaps-simple", "a10f22ab-e0ee-471a-b2b6-2f6cb1c63fdc")
  147. exampleProject("16-shadowmaps", "f9a91cb0-7b1b-11e3-981f-0800200c9a66")
  148. exampleProject("17-drawstress", "9aeea4c6-80dc-11e3-b3ca-4da6db0f677b")
  149. exampleProject("18-ibl", "711bcbb0-9531-11e3-a5e2-0800200c9a66")
  150. exampleProject("19-oit", "d7eca4fc-96d7-11e3-a73b-fcafdb0f677b")
  151. exampleProject("20-nanovg", "359ce7c4-cd06-11e3-bb8b-6c2f9a125b5a")
  152. exampleProject("21-deferred", "f89e59ec-d16b-11e3-bc9c-2dfd99125b5a")
  153. if _OPTIONS["with-tools"] then
  154. dofile "makedisttex.lua"
  155. dofile "shaderc.lua"
  156. dofile "texturec.lua"
  157. dofile "geometryc.lua"
  158. end