crown.lua 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. --
  2. -- Copyright (c) 2012-2017 Daniele Bartolini and individual contributors.
  3. -- License: https://github.com/taylor001/crown/blob/master/LICENSE
  4. --
  5. function crown_project(_name, _kind, _defines)
  6. project ("crown" .. _name)
  7. kind (_kind)
  8. includedirs {
  9. CROWN_DIR .. "src",
  10. CROWN_DIR .. "src/core",
  11. CROWN_DIR .. "src/core/containers",
  12. CROWN_DIR .. "src/core/error",
  13. CROWN_DIR .. "src/core/filesystem",
  14. CROWN_DIR .. "src/core/json",
  15. CROWN_DIR .. "src/core/math",
  16. CROWN_DIR .. "src/core/memory",
  17. CROWN_DIR .. "src/core/network",
  18. CROWN_DIR .. "src/core/strings",
  19. CROWN_DIR .. "src/core/thread",
  20. CROWN_DIR .. "src/device",
  21. CROWN_DIR .. "src/lua",
  22. CROWN_DIR .. "src/resource",
  23. CROWN_DIR .. "src/world",
  24. CROWN_DIR .. "3rdparty/bgfx/include",
  25. CROWN_DIR .. "3rdparty/bx/include",
  26. CROWN_DIR .. "3rdparty/stb",
  27. }
  28. defines {
  29. _defines,
  30. }
  31. links {
  32. "bgfx",
  33. }
  34. if _OPTIONS["with-luajit"] then
  35. includedirs {
  36. CROWN_DIR .. "3rdparty/luajit/src",
  37. }
  38. configuration { "not vs*" }
  39. links {
  40. "luajit"
  41. }
  42. configuration { "vs*"}
  43. links {
  44. "lua51"
  45. }
  46. configuration { "x32", "vs*" }
  47. libdirs {
  48. CROWN_DIR .. "3rdparty/luajit/pre/win_x86"
  49. }
  50. configuration { "x64", "vs*" }
  51. libdirs {
  52. CROWN_DIR .. "3rdparty/luajit/pre/win_x64"
  53. }
  54. configuration {}
  55. end
  56. if _OPTIONS["with-openal"] then
  57. includedirs {
  58. CROWN_DIR .. "3rdparty/openal/include"
  59. }
  60. configuration {}
  61. links { "openal", }
  62. configuration {}
  63. end
  64. if _OPTIONS["with-bullet"] then
  65. includedirs {
  66. CROWN_DIR .. "3rdparty/bullet3/src",
  67. }
  68. links {
  69. "bullet",
  70. }
  71. configuration {}
  72. end
  73. configuration { "debug or development" }
  74. defines {
  75. "CROWN_DEBUG=1"
  76. }
  77. configuration { "development" }
  78. defines {
  79. "CROWN_DEVELOPMENT=1"
  80. }
  81. configuration { "android*" }
  82. kind "ConsoleApp"
  83. targetextension ".so"
  84. linkoptions {
  85. "-shared"
  86. }
  87. links {
  88. "gcc",
  89. "EGL",
  90. "GLESv2",
  91. }
  92. configuration { "linux-*" }
  93. links {
  94. "X11",
  95. "Xrandr",
  96. "pthread",
  97. "dl",
  98. "GL",
  99. }
  100. configuration { "vs* or mingw*" }
  101. links {
  102. "dbghelp",
  103. "xinput",
  104. "psapi",
  105. "ws2_32",
  106. "ole32",
  107. }
  108. configuration {}
  109. files {
  110. CROWN_DIR .. "src/**.h",
  111. CROWN_DIR .. "src/**.cpp"
  112. }
  113. strip()
  114. configuration {} -- reset configuration
  115. end