genie.lua 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. --
  2. -- Copyright (c) 2012-2015 Daniele Bartolini and individual contributors.
  3. -- License: https://github.com/taylor001/crown/blob/master/LICENSE
  4. --
  5. CROWN_DIR = (path.getabsolute("..") .. "/")
  6. local CROWN_THIRD_DIR = (CROWN_DIR .. "third/")
  7. local CROWN_BUILD_DIR = (CROWN_DIR .. ".build/")
  8. BGFX_DIR = (CROWN_DIR .. "third/bgfx/")
  9. BX_DIR = (CROWN_DIR .. "third/bx/")
  10. function copyLib()
  11. end
  12. newoption {
  13. trigger = "with-openal",
  14. description = "Build with OpenAL support."
  15. }
  16. newoption {
  17. trigger = "with-luajit",
  18. description = "Build with luajit support."
  19. }
  20. newoption {
  21. trigger = "with-tools",
  22. description = "Build with tools."
  23. }
  24. solution "crown"
  25. configurations {
  26. "debug",
  27. "development",
  28. "release",
  29. }
  30. platforms {
  31. "x32",
  32. "x64",
  33. "native"
  34. }
  35. language "C++"
  36. configuration {}
  37. dofile ("toolchain.lua")
  38. dofile (BGFX_DIR .. "scripts/bgfx.lua")
  39. dofile ("crown.lua")
  40. toolchain(CROWN_BUILD_DIR, CROWN_THIRD_DIR)
  41. group "libs"
  42. bgfxProject("", "StaticLib", os.is("windows") and { "BGFX_CONFIG_RENDERER_DIRECT3D9=1" } or {})
  43. if _OPTIONS["with-tools"] then
  44. dofile ("shaderc.lua")
  45. end
  46. if _OPTIONS["with-openal"] then
  47. dofile ("openal.lua")
  48. end
  49. group "engine"
  50. crown_project("", "ConsoleApp", {})
  51. -- Install
  52. configuration { "x32", "linux-*" }
  53. postbuildcommands {
  54. "cp " .. CROWN_THIRD_DIR .. "luajit/pre/linux_x86/luajit " .. CROWN_DIR .. ".build/linux32/bin",
  55. "cp -r " .. CROWN_THIRD_DIR .. "luajit/src/jit " .. CROWN_DIR .. ".build/linux32/bin",
  56. }
  57. configuration { "x64", "linux-*" }
  58. postbuildcommands {
  59. "cp " .. CROWN_THIRD_DIR .. "luajit/pre/linux_x64/luajit " .. CROWN_DIR .. ".build/linux64/bin",
  60. "cp -r " .. CROWN_THIRD_DIR .. "luajit/src/jit " .. CROWN_DIR .. ".build/linux64/bin",
  61. }
  62. configuration { "x32", "vs*" }
  63. postbuildcommands {
  64. "cp " .. CROWN_THIRD_DIR .. "luajit/pre/win_x86/luajit.exe " .. CROWN_DIR .. ".build/win32/bin",
  65. "cp " .. CROWN_THIRD_DIR .. "luajit/pre/win_x86/lua51.lib " .. CROWN_DIR .. ".build/win32/bin",
  66. "cp " .. CROWN_THIRD_DIR .. "luajit/pre/win_x86/lua51.exp " .. CROWN_DIR .. ".build/win32/bin",
  67. "cp " .. CROWN_THIRD_DIR .. "luajit/pre/win_x86/lua51.dll " .. CROWN_DIR .. ".build/win32/bin",
  68. "cp -r " .. CROWN_THIRD_DIR .. "luajit/src/jit " .. CROWN_DIR .. ".build/win32/bin",
  69. "cp " .. "$(PHYSX_SDK_WINDOWS)/bin/win32/PhysX3* " .. CROWN_DIR .. ".build/win32/bin",
  70. "cp " .. "$(PHYSX_SDK_WINDOWS)/bin/win32/nvToolsExt32_1.dll " .. CROWN_DIR .. ".build/win32/bin",
  71. }
  72. configuration { "x64", "vs*" }
  73. postbuildcommands {
  74. "cp " .. CROWN_THIRD_DIR .. "luajit/pre/win_x64/luajit.exe " .. CROWN_DIR .. ".build/win64/bin",
  75. "cp " .. CROWN_THIRD_DIR .. "luajit/pre/win_x64/lua51.lib " .. CROWN_DIR .. ".build/win64/bin",
  76. "cp " .. CROWN_THIRD_DIR .. "luajit/pre/win_x64/lua51.exp " .. CROWN_DIR .. ".build/win64/bin",
  77. "cp " .. CROWN_THIRD_DIR .. "luajit/pre/win_x64/lua51.dll " .. CROWN_DIR .. ".build/win64/bin",
  78. "cp -r " .. CROWN_THIRD_DIR .. "luajit/src/jit " .. CROWN_DIR .. ".build/win64/bin",
  79. "cp " .. "$(PHYSX_SDK_WINDOWS)/bin/win64/PhysX3* " .. CROWN_DIR .. ".build/win64/bin",
  80. "cp " .. "$(PHYSX_SDK_WINDOWS)/bin/win64/nvToolsExt64_1.dll " .. CROWN_DIR .. ".build/win64/bin",
  81. }