genie.lua 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. --
  2. -- Copyright (c) 2012-2016 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-bullet",
  22. description = "Build with Bullet support."
  23. }
  24. newoption {
  25. trigger = "with-physx",
  26. description = "Build with PhysX support."
  27. }
  28. newoption {
  29. trigger = "with-tools",
  30. description = "Build with tools."
  31. }
  32. solution "crown"
  33. configurations {
  34. "debug",
  35. "development",
  36. "release",
  37. }
  38. platforms {
  39. "x32",
  40. "x64",
  41. "native"
  42. }
  43. language "C++"
  44. configuration {}
  45. dofile ("toolchain.lua")
  46. dofile (BGFX_DIR .. "scripts/bgfx.lua")
  47. dofile ("crown.lua")
  48. toolchain(CROWN_BUILD_DIR, CROWN_THIRD_DIR)
  49. group "libs"
  50. bgfxProject("", "StaticLib", os.is("windows") and { "BGFX_CONFIG_RENDERER_DIRECT3D9=1" } or {})
  51. if _OPTIONS["with-tools"] then
  52. dofile ("shaderc.lua")
  53. end
  54. if _OPTIONS["with-openal"] then
  55. dofile ("openal.lua")
  56. end
  57. if _OPTIONS["with-bullet"] then
  58. dofile ("bullet.lua")
  59. end
  60. group "engine"
  61. crown_project("", "ConsoleApp", {})
  62. -- Install
  63. configuration { "x32", "linux-*" }
  64. postbuildcommands {
  65. "cp " .. CROWN_THIRD_DIR .. "luajit/pre/linux_x86/luajit " .. CROWN_BUILD_DIR .. "linux32/bin",
  66. "cp -r " .. CROWN_THIRD_DIR .. "luajit/src/jit " .. CROWN_BUILD_DIR .. "linux32/bin",
  67. }
  68. if _OPTIONS["with-physx"] then
  69. postbuildcommands {
  70. "cp -r " .. "$(PHYSX_SDK_LINUX)/Bin/linux32/libPhysX3* " .. CROWN_BUILD_DIR .. "linux32/bin",
  71. }
  72. end
  73. configuration { "x64", "linux-*" }
  74. postbuildcommands {
  75. "cp " .. CROWN_THIRD_DIR .. "luajit/pre/linux_x64/luajit " .. CROWN_BUILD_DIR .. "linux64/bin",
  76. "cp -r " .. CROWN_THIRD_DIR .. "luajit/src/jit " .. CROWN_BUILD_DIR .. "linux64/bin",
  77. }
  78. if _OPTIONS["with-physx"] then
  79. postbuildcommands {
  80. "cp -r " .. "$(PHYSX_SDK_LINUX)/Bin/linux64/libPhysX3* " .. CROWN_BUILD_DIR .. "linux64/bin",
  81. }
  82. end
  83. configuration { "x32", "vs*" }
  84. postbuildcommands {
  85. "cp " .. CROWN_THIRD_DIR .. "luajit/pre/win_x86/luajit.exe " .. CROWN_BUILD_DIR .. "win32/bin",
  86. "cp " .. CROWN_THIRD_DIR .. "luajit/pre/win_x86/lua51.lib " .. CROWN_BUILD_DIR .. "win32/bin",
  87. "cp " .. CROWN_THIRD_DIR .. "luajit/pre/win_x86/lua51.exp " .. CROWN_BUILD_DIR .. "win32/bin",
  88. "cp " .. CROWN_THIRD_DIR .. "luajit/pre/win_x86/lua51.dll " .. CROWN_BUILD_DIR .. "win32/bin",
  89. "cp -r " .. CROWN_THIRD_DIR .. "luajit/src/jit " .. CROWN_BUILD_DIR .. "win32/bin",
  90. }
  91. if _OPTIONS["with-physx"] then
  92. postbuildcommands {
  93. "cp " .. "$(PHYSX_SDK_WINDOWS)/bin/win32/PhysX3* " .. CROWN_BUILD_DIR .. "win32/bin",
  94. "cp " .. "$(PHYSX_SDK_WINDOWS)/bin/win32/nvToolsExt32_1.dll " .. CROWN_BUILD_DIR .. "win32/bin",
  95. }
  96. end
  97. configuration { "x64", "vs*" }
  98. postbuildcommands {
  99. "cp " .. CROWN_THIRD_DIR .. "luajit/pre/win_x64/luajit.exe " .. CROWN_BUILD_DIR .. "win64/bin",
  100. "cp " .. CROWN_THIRD_DIR .. "luajit/pre/win_x64/lua51.lib " .. CROWN_BUILD_DIR .. "win64/bin",
  101. "cp " .. CROWN_THIRD_DIR .. "luajit/pre/win_x64/lua51.exp " .. CROWN_BUILD_DIR .. "win64/bin",
  102. "cp " .. CROWN_THIRD_DIR .. "luajit/pre/win_x64/lua51.dll " .. CROWN_BUILD_DIR .. "win64/bin",
  103. "cp -r " .. CROWN_THIRD_DIR .. "luajit/src/jit " .. CROWN_BUILD_DIR .. "win64/bin",
  104. }
  105. if _OPTIONS["with-physx"] then
  106. postbuildcommands {
  107. "cp " .. "$(PHYSX_SDK_WINDOWS)/bin/win64/PhysX3* " .. CROWN_BUILD_DIR .. "win64/bin",
  108. "cp " .. "$(PHYSX_SDK_WINDOWS)/bin/win64/nvToolsExt64_1.dll " .. CROWN_BUILD_DIR .. "win64/bin",
  109. }
  110. end