premake4.lua 3.7 KB

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