crown.lua 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  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 { "android-arm" }
  39. libdirs {
  40. CROWN_DIR .. "3rdparty/luajit/pre/android_arm"
  41. }
  42. configuration { "linux-* or android-arm" }
  43. links {
  44. "luajit"
  45. }
  46. configuration { "x32", "linux-*" }
  47. libdirs {
  48. CROWN_DIR .. "3rdparty/luajit/pre/linux_x86"
  49. }
  50. configuration { "x64", "linux-*" }
  51. libdirs {
  52. CROWN_DIR .. "3rdparty/luajit/pre/linux_x64"
  53. }
  54. configuration { "mingw-*" }
  55. links {
  56. "luajit"
  57. }
  58. configuration { "vs*"}
  59. links {
  60. "lua51"
  61. }
  62. configuration { "x32", "vs*" }
  63. libdirs {
  64. CROWN_DIR .. "3rdparty/luajit/pre/win_x86"
  65. }
  66. configuration { "x64", "vs*" }
  67. libdirs {
  68. CROWN_DIR .. "3rdparty/luajit/pre/win_x64"
  69. }
  70. configuration {}
  71. end
  72. if _OPTIONS["with-openal"] then
  73. includedirs {
  74. CROWN_DIR .. "3rdparty/openal/include"
  75. }
  76. configuration {}
  77. links { "openal", }
  78. configuration {}
  79. end
  80. if _OPTIONS["with-bullet"] then
  81. includedirs {
  82. CROWN_DIR .. "3rdparty/bullet3/src",
  83. }
  84. links {
  85. "bullet",
  86. }
  87. configuration {}
  88. end
  89. configuration { "debug or development" }
  90. defines {
  91. "CROWN_DEBUG=1"
  92. }
  93. configuration { "development" }
  94. defines {
  95. "CROWN_DEVELOPMENT=1"
  96. }
  97. configuration { "android*" }
  98. kind "ConsoleApp"
  99. targetextension ".so"
  100. linkoptions {
  101. "-shared"
  102. }
  103. links {
  104. "gcc",
  105. "EGL",
  106. "GLESv2",
  107. }
  108. configuration { "linux-*" }
  109. links {
  110. "X11",
  111. "Xrandr",
  112. "pthread",
  113. "dl",
  114. "GL",
  115. }
  116. configuration { "vs* or mingw*" }
  117. links {
  118. "dbghelp",
  119. "xinput",
  120. "psapi",
  121. "ws2_32",
  122. "ole32",
  123. }
  124. configuration {}
  125. files {
  126. CROWN_DIR .. "src/**.h",
  127. CROWN_DIR .. "src/**.cpp"
  128. }
  129. strip()
  130. configuration {} -- reset configuration
  131. end