genie.lua 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  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. newoption {
  10. trigger = "with-shared-lib",
  11. description = "Enable building shared library.",
  12. }
  13. newoption {
  14. trigger = "with-sdl",
  15. description = "Enable SDL entry.",
  16. }
  17. solution "bgfx"
  18. configurations {
  19. "Debug",
  20. "Release",
  21. }
  22. platforms {
  23. "x32",
  24. "x64",
  25. -- "Xbox360",
  26. "Native", -- for targets where bitness is not specified
  27. }
  28. language "C++"
  29. startproject "example-00-helloworld"
  30. BGFX_DIR = (path.getabsolute("..") .. "/")
  31. local BGFX_BUILD_DIR = (BGFX_DIR .. ".build/")
  32. local BGFX_THIRD_PARTY_DIR = (BGFX_DIR .. "3rdparty/")
  33. BX_DIR = (BGFX_DIR .. "../bx/")
  34. defines {
  35. "BX_CONFIG_ENABLE_MSVC_LEVEL4_WARNINGS=1"
  36. }
  37. dofile (BX_DIR .. "scripts/toolchain.lua")
  38. toolchain(BGFX_BUILD_DIR, BGFX_THIRD_PARTY_DIR)
  39. function copyLib()
  40. end
  41. function exampleProject(_name)
  42. project ("example-" .. _name)
  43. uuid (os.uuid("example-" .. _name))
  44. kind "WindowedApp"
  45. configuration {}
  46. debugdir (BGFX_DIR .. "examples/runtime/")
  47. includedirs {
  48. BX_DIR .. "include",
  49. BGFX_DIR .. "include",
  50. BGFX_DIR .. "3rdparty",
  51. BGFX_DIR .. "examples/common",
  52. }
  53. files {
  54. BGFX_DIR .. "examples/" .. _name .. "/**.cpp",
  55. BGFX_DIR .. "examples/" .. _name .. "/**.h",
  56. }
  57. links {
  58. "bgfx",
  59. "example-common",
  60. }
  61. if _OPTIONS["with-sdl"] then
  62. defines { "ENTRY_CONFIG_USE_SDL=1" }
  63. links { "SDL2" }
  64. end
  65. configuration { "vs*" }
  66. linkoptions {
  67. "/ignore:4199", -- LNK4199: /DELAYLOAD:*.dll ignored; no imports found from *.dll
  68. }
  69. links { -- this is needed only for testing with GLES2/3 on Windows with VS2008
  70. "DelayImp",
  71. }
  72. configuration { "vs201*" }
  73. linkoptions { -- this is needed only for testing with GLES2/3 on Windows with VS201x
  74. "/DELAYLOAD:\"libEGL.dll\"",
  75. "/DELAYLOAD:\"libGLESv2.dll\"",
  76. }
  77. configuration { "android*" }
  78. kind "ConsoleApp"
  79. targetextension ".so"
  80. linkoptions {
  81. "-shared",
  82. }
  83. links {
  84. "EGL",
  85. "GLESv2",
  86. }
  87. configuration { "nacl or nacl-arm" }
  88. kind "ConsoleApp"
  89. targetextension ".nexe"
  90. links {
  91. "ppapi",
  92. "ppapi_gles2",
  93. "pthread",
  94. }
  95. configuration { "pnacl" }
  96. kind "ConsoleApp"
  97. targetextension ".pexe"
  98. links {
  99. "ppapi",
  100. "ppapi_gles2",
  101. "pthread",
  102. }
  103. configuration { "asmjs" }
  104. kind "ConsoleApp"
  105. targetextension ".bc"
  106. configuration { "linux-*" }
  107. links {
  108. "X11",
  109. "GL",
  110. "pthread",
  111. }
  112. configuration { "rpi" }
  113. links {
  114. "X11",
  115. "GLESv2",
  116. "EGL",
  117. "bcm_host",
  118. "vcos",
  119. "vchiq_arm",
  120. "pthread",
  121. }
  122. configuration { "osx" }
  123. files {
  124. BGFX_DIR .. "examples/common/**.mm",
  125. }
  126. links {
  127. "Cocoa.framework",
  128. "OpenGL.framework",
  129. }
  130. configuration { "xcode4" }
  131. platforms {
  132. "Universal"
  133. }
  134. files {
  135. BGFX_DIR .. "examples/common/**.mm",
  136. }
  137. links {
  138. "Cocoa.framework",
  139. "Foundation.framework",
  140. "OpenGL.framework",
  141. }
  142. configuration { "ios*" }
  143. kind "ConsoleApp"
  144. files {
  145. BGFX_DIR .. "examples/common/**.mm",
  146. }
  147. linkoptions {
  148. "-framework CoreFoundation",
  149. "-framework Foundation",
  150. "-framework OpenGLES",
  151. "-framework UIKit",
  152. "-framework QuartzCore",
  153. }
  154. configuration { "qnx*" }
  155. targetextension ""
  156. links {
  157. "EGL",
  158. "GLESv2",
  159. }
  160. configuration {}
  161. strip()
  162. end
  163. dofile "bgfx.lua"
  164. dofile "example-common.lua"
  165. bgfxProject("", "StaticLib", {})
  166. exampleProject("00-helloworld")
  167. exampleProject("01-cubes")
  168. exampleProject("02-metaballs")
  169. exampleProject("03-raymarch")
  170. exampleProject("04-mesh")
  171. exampleProject("05-instancing")
  172. exampleProject("06-bump")
  173. exampleProject("07-callback")
  174. exampleProject("08-update")
  175. exampleProject("09-hdr")
  176. exampleProject("10-font")
  177. exampleProject("11-fontsdf")
  178. exampleProject("12-lod")
  179. exampleProject("13-stencil")
  180. exampleProject("14-shadowvolumes")
  181. exampleProject("15-shadowmaps-simple")
  182. exampleProject("16-shadowmaps")
  183. exampleProject("17-drawstress")
  184. exampleProject("18-ibl")
  185. exampleProject("19-oit")
  186. exampleProject("20-nanovg")
  187. exampleProject("21-deferred")
  188. exampleProject("22-windows")
  189. if _OPTIONS["with-shared-lib"] then
  190. bgfxProject("-shared-lib", "SharedLib", {})
  191. end
  192. if _OPTIONS["with-tools"] then
  193. dofile "makedisttex.lua"
  194. dofile "shaderc.lua"
  195. dofile "texturec.lua"
  196. dofile "geometryc.lua"
  197. end