premake4.lua 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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. }
  38. files {
  39. BGFX_DIR .. "examples/common/**.cpp",
  40. BGFX_DIR .. "examples/common/**.h",
  41. BGFX_DIR .. "examples/" .. _name .. "/**.cpp",
  42. BGFX_DIR .. "examples/" .. _name .. "/**.h",
  43. }
  44. links {
  45. "bgfx",
  46. }
  47. configuration { "android*" }
  48. kind "SharedLib"
  49. targetextension ".so"
  50. links {
  51. "EGL",
  52. "GLESv2",
  53. }
  54. configuration { "emscripten" }
  55. targetextension ".bc"
  56. configuration { "nacl or nacl-arm or pnacl" }
  57. targetextension ".nexe"
  58. links {
  59. "ppapi",
  60. "ppapi_gles2",
  61. "pthread",
  62. }
  63. configuration { "linux" }
  64. links {
  65. "GL",
  66. "pthread",
  67. }
  68. configuration { "osx" }
  69. files {
  70. BGFX_DIR .. "examples/common/**.mm",
  71. }
  72. links {
  73. "Cocoa.framework",
  74. "OpenGL.framework",
  75. }
  76. configuration { "qnx*" }
  77. targetextension ""
  78. links {
  79. "EGL",
  80. "GLESv2",
  81. }
  82. configuration {}
  83. strip()
  84. end
  85. dofile "bgfx.lua"
  86. exampleProject("00-helloworld", "ff2c8450-ebf4-11e0-9572-0800200c9a66")
  87. exampleProject("01-cubes", "fec3bc94-e1e5-11e1-9c59-c7eeec2c1c51")
  88. exampleProject("02-metaballs", "413b2cb4-f7db-11e1-bf5f-a716de6a022f")
  89. exampleProject("03-raymarch", "1cede802-0220-11e2-91ba-e108de6a022f")
  90. exampleProject("04-mesh", "546bbc76-0c4a-11e2-ab09-debcdd6a022f")
  91. exampleProject("05-instancing", "5d3da660-1105-11e2-aece-71e4dd6a022f")
  92. exampleProject("06-bump", "ffb23e6c-167b-11e2-81df-94c4dd6a022f")
  93. exampleProject("07-callback", "acc53bbc-52f0-11e2-9781-ad8edd4b7d02")
  94. exampleProject("08-update", "e011e246-5862-11e2-b202-b7cb257a7926")
  95. exampleProject("09-hdr", "969a4626-67ee-11e2-9726-9023267a7926")
  96. exampleProject("10-font" , "EF6FD5B3-B52A-41C2-A257-9DFE709AF9E1")
  97. exampleProject("11-fontdfs", "F4E6F96F-3DAA-4C68-8DF8-BF2A3ECD9092")
  98. dofile "makedisttex.lua"
  99. dofile "shaderc.lua"
  100. dofile "texturec.lua"
  101. dofile "geometryc.lua"