genie.lua 4.0 KB

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