premake4.lua 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. --
  2. -- Copyright 2010-2012 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. }
  15. language "C++"
  16. BGFX_DIR = (path.getabsolute("..") .. "/")
  17. local BGFX_BUILD_DIR = (BGFX_DIR .. ".build/")
  18. local BGFX_THIRD_PARTY_DIR = (BGFX_DIR .. "3rdparty/")
  19. BX_DIR = (BGFX_DIR .. "../bx/")
  20. defines {
  21. "BX_CONFIG_ENABLE_MSVC_LEVEL4_WARNINGS=1"
  22. }
  23. dofile (BX_DIR .. "premake/toolchain.lua")
  24. toolchain(BGFX_BUILD_DIR, BGFX_THIRD_PARTY_DIR)
  25. function copyLib()
  26. end
  27. function exampleProject(_name, _uuid)
  28. project ("example-" .. _name)
  29. uuid (_uuid)
  30. kind "WindowedApp"
  31. configuration {}
  32. debugdir (BGFX_DIR .. "examples/runtime/")
  33. includedirs {
  34. BX_DIR .. "include",
  35. BGFX_DIR .. "include",
  36. }
  37. files {
  38. BGFX_DIR .. "examples/common/**.cpp",
  39. BGFX_DIR .. "examples/common/**.h",
  40. BGFX_DIR .. "examples/" .. _name .. "/**.cpp",
  41. BGFX_DIR .. "examples/" .. _name .. "/**.h",
  42. }
  43. links {
  44. "bgfx",
  45. }
  46. configuration { "emscripten" }
  47. targetextension ".bc"
  48. configuration { "nacl or nacl-arm or pnacl" }
  49. targetextension ".nexe"
  50. links {
  51. "ppapi",
  52. "ppapi_gles2",
  53. "pthread",
  54. }
  55. configuration { "nacl", "Release" }
  56. postbuildcommands {
  57. "@echo Stripping symbols.",
  58. "@$(NACL)/bin/x86_64-nacl-strip -s \"$(TARGET)\""
  59. }
  60. configuration { "linux" }
  61. links {
  62. "GL",
  63. "pthread",
  64. }
  65. configuration { "macosx" }
  66. files {
  67. BGFX_DIR .. "examples/common/**.mm",
  68. }
  69. links {
  70. "Cocoa.framework",
  71. "OpenGL.framework",
  72. }
  73. end
  74. dofile "bgfx.lua"
  75. exampleProject("00-helloworld", "ff2c8450-ebf4-11e0-9572-0800200c9a66")
  76. exampleProject("01-cubes", "fec3bc94-e1e5-11e1-9c59-c7eeec2c1c51")
  77. exampleProject("02-metaballs", "413b2cb4-f7db-11e1-bf5f-a716de6a022f")
  78. exampleProject("03-raymarch", "1cede802-0220-11e2-91ba-e108de6a022f")
  79. exampleProject("04-mesh", "546bbc76-0c4a-11e2-ab09-debcdd6a022f")
  80. exampleProject("05-instancing", "5d3da660-1105-11e2-aece-71e4dd6a022f")
  81. exampleProject("06-bump", "ffb23e6c-167b-11e2-81df-94c4dd6a022f")
  82. exampleProject("07-callback", "acc53bbc-52f0-11e2-9781-ad8edd4b7d02")
  83. exampleProject("08-update", "e011e246-5862-11e2-b202-b7cb257a7926")
  84. exampleProject("09-hdr", "969a4626-67ee-11e2-9726-9023267a7926")
  85. dofile "makedisttex.lua"
  86. dofile "shaderc.lua"
  87. dofile "texturec.lua"
  88. dofile "geometryc.lua"