genie.lua 4.1 KB

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