genie.lua 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  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. }
  64. configuration { "vs201*" }
  65. linkoptions { -- this is needed only for testing with GLES2/3 on Windows with VS201x
  66. "/DELAYLOAD:\"libEGL.dll\"",
  67. "/DELAYLOAD:\"libGLESv2.dll\"",
  68. }
  69. configuration { "android*" }
  70. kind "ConsoleApp"
  71. targetextension ".so"
  72. linkoptions {
  73. "-shared",
  74. }
  75. links {
  76. "EGL",
  77. "GLESv2",
  78. }
  79. configuration { "nacl or nacl-arm" }
  80. kind "ConsoleApp"
  81. targetextension ".nexe"
  82. links {
  83. "ppapi",
  84. "ppapi_gles2",
  85. "pthread",
  86. }
  87. configuration { "pnacl" }
  88. kind "ConsoleApp"
  89. targetextension ".pexe"
  90. links {
  91. "ppapi",
  92. "ppapi_gles2",
  93. "pthread",
  94. }
  95. configuration { "asmjs" }
  96. kind "ConsoleApp"
  97. targetextension ".bc"
  98. configuration { "linux-*" }
  99. links {
  100. "X11",
  101. "GL",
  102. "pthread",
  103. }
  104. configuration { "rpi" }
  105. links {
  106. "X11",
  107. "GLESv2",
  108. "EGL",
  109. "bcm_host",
  110. "vcos",
  111. "vchiq_arm",
  112. "pthread",
  113. }
  114. configuration { "osx" }
  115. files {
  116. BGFX_DIR .. "examples/common/**.mm",
  117. }
  118. links {
  119. "Cocoa.framework",
  120. "OpenGL.framework",
  121. -- "SDL2",
  122. }
  123. configuration { "xcode4" }
  124. platforms {
  125. "Universal"
  126. }
  127. files {
  128. BGFX_DIR .. "examples/common/**.mm",
  129. }
  130. links {
  131. "Cocoa.framework",
  132. "Foundation.framework",
  133. "OpenGL.framework",
  134. }
  135. configuration { "ios*" }
  136. kind "ConsoleApp"
  137. files {
  138. BGFX_DIR .. "examples/common/**.mm",
  139. }
  140. linkoptions {
  141. "-framework CoreFoundation",
  142. "-framework Foundation",
  143. "-framework OpenGLES",
  144. "-framework UIKit",
  145. "-framework QuartzCore",
  146. }
  147. configuration { "qnx*" }
  148. targetextension ""
  149. links {
  150. "EGL",
  151. "GLESv2",
  152. }
  153. configuration {}
  154. strip()
  155. end
  156. dofile "bgfx.lua"
  157. dofile "example-common.lua"
  158. bgfxProject("", "StaticLib", {})
  159. exampleProject("00-helloworld")
  160. exampleProject("01-cubes")
  161. exampleProject("02-metaballs")
  162. exampleProject("03-raymarch")
  163. exampleProject("04-mesh")
  164. exampleProject("05-instancing")
  165. exampleProject("06-bump")
  166. exampleProject("07-callback")
  167. exampleProject("08-update")
  168. exampleProject("09-hdr")
  169. exampleProject("10-font")
  170. exampleProject("11-fontsdf")
  171. exampleProject("12-lod")
  172. exampleProject("13-stencil")
  173. exampleProject("14-shadowvolumes")
  174. exampleProject("15-shadowmaps-simple")
  175. exampleProject("16-shadowmaps")
  176. exampleProject("17-drawstress")
  177. exampleProject("18-ibl")
  178. exampleProject("19-oit")
  179. exampleProject("20-nanovg")
  180. exampleProject("21-deferred")
  181. if _OPTIONS["with-shared-lib"] then
  182. bgfxProject("-shared-lib", "SharedLib", {})
  183. end
  184. if _OPTIONS["with-tools"] then
  185. dofile "makedisttex.lua"
  186. dofile "shaderc.lua"
  187. dofile "texturec.lua"
  188. dofile "geometryc.lua"
  189. end