premake4.lua 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738
  1. -- Copyright (c) 2013 - 2014 Daniele Bartolini, Michele Rossi
  2. -- Copyright (c) 2012 Daniele Bartolini, Simone Boscaratto
  3. --
  4. -- Permission is hereby granted, free of charge, to any person
  5. -- obtaining a copy of this software and associated documentation
  6. -- files (the "Software"), to deal in the Software without
  7. -- restriction, including without limitation the rights to use,
  8. -- copy, modify, merge, publish, distribute, sublicense, and/or sell
  9. -- copies of the Software, and to permit persons to whom the
  10. -- Software is furnished to do so, subject to the following
  11. -- conditions:
  12. --
  13. -- The above copyright notice and this permission notice shall be
  14. -- included in all copies or substantial portions of the Software.
  15. --
  16. -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  17. -- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
  18. -- OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  19. -- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  20. -- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  21. -- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  22. -- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  23. -- OTHER DEALINGS IN THE SOFTWARE.
  24. ------------------------------------------------------------------------------
  25. -- Options
  26. newoption
  27. {
  28. trigger = "install-dir",
  29. value = "DIR",
  30. description = "Output directory"
  31. }
  32. newoption
  33. {
  34. trigger = "compiler",
  35. value = "COMPILER",
  36. description = "Choose compiler",
  37. allowed =
  38. {
  39. { "android", "Android (ARM only)" }, -- gcc
  40. -- { "android-mips", "Android - MIPS" }, -- gcc
  41. -- { "android-x86", "Android - x86" }, -- gcc
  42. { "linux-gcc", "Linux (GCC compiler)" }, -- gcc
  43. -- { "linux-clang", "Linux (Clang compiler)" }, -- clang
  44. -- { "osx-gcc", "OSX" }, -- gcc
  45. -- { "ios-arm", "iOS - ARM" }, -- clang
  46. -- { "ios-simulator", "iOS - Simulator" } -- clang
  47. }
  48. }
  49. CROWN_SOURCE_DIR = path.getabsolute("..") .. "/"
  50. CROWN_THIRD_DIR = CROWN_SOURCE_DIR .. "third/"
  51. CROWN_BUILD_DIR = CROWN_SOURCE_DIR .. ".build/"
  52. CROWN_INSTALL_DIR = os.getenv("CROWN_INSTALL_DIR")
  53. if not CROWN_INSTALL_DIR then
  54. if not path.isabsolute(CROWN_INSTALL_DIR) then
  55. CROWN_INSTALL_DIR = CROWN_SOURCE_DIR .. ".install"
  56. end
  57. end
  58. CROWN_INSTALL_DIR = CROWN_INSTALL_DIR .. "/" -- Add slash to end string
  59. -------------------------------------------------------------------------------
  60. -- Solution
  61. solution "crown"
  62. configurations { "debug", "development", "release" }
  63. platforms { "native", "x32", "x64" }
  64. -- Avoid error invoking premake4 --help
  65. if _ACTION == nil then return end
  66. if _ACTION == "clean" then os.rmdir(CROWN_BUILD_DIR) end
  67. if _ACTION == "gmake" then
  68. if _OPTIONS["compiler"] == "linux-gcc" then
  69. if not os.is("linux") then print("Action not valid in current OS.") end
  70. location(CROWN_BUILD_DIR .. "linux")
  71. elseif _OPTIONS["compiler"] == "android" then
  72. if not os.getenv("ANDROID_NDK_ROOT") then print("Set ANDROID_NDK_ROOT environment variable.") end
  73. if not os.getenv("ANDROID_NDK_ARM") then print("Set ANDROID_NDK_ARM environment variables.") end
  74. premake.gcc.cc = "$(ANDROID_NDK_ARM)/bin/arm-linux-androideabi-gcc"
  75. premake.gcc.cxx = "$(ANDROID_NDK_ARM)/bin/arm-linux-androideabi-g++"
  76. premake.gcc.ar = "$(ANDROID_NDK_ARM)/bin/arm-linux-androideabi-ar"
  77. location(CROWN_BUILD_DIR .. "android")
  78. end
  79. end
  80. if _ACTION == "vs2010" or _ACTION == "vs2008" then
  81. if not os.is("windows") then print("Action not valid in current OS.") end
  82. if not os.getenv("DXSDK_DIR") then print("Environment variable DXSDK_DIR must be set.") end
  83. location(CROWN_BUILD_DIR .. "windows")
  84. end
  85. configuration { "debug" }
  86. defines { "_DEBUG", "CROWN_DEBUG" }
  87. configuration { "development" }
  88. defines { "_DEBUG", "CROWN_DEBUG" }
  89. configuration { "release" }
  90. defines { "NDEBUG" }
  91. configuration { "debug", "x32" }
  92. targetsuffix "-debug-32"
  93. configuration { "debug", "x64" }
  94. targetsuffix "-debug-64"
  95. configuration { "development", "x32" }
  96. targetsuffix "-development-32"
  97. configuration { "development", "x64" }
  98. targetsuffix "-development-64"
  99. configuration { "release", "x32" }
  100. targetsuffix "-release-32"
  101. configuration { "release", "x64" }
  102. targetsuffix "-release-64"
  103. configuration { "debug", "native" }
  104. targetsuffix "-debug"
  105. configuration { "debug", "native" }
  106. targetsuffix "-debug"
  107. configuration { "development", "native" }
  108. targetsuffix "-development"
  109. configuration { "development", "native" }
  110. targetsuffix "-development"
  111. configuration { "release", "native" }
  112. targetsuffix "-release"
  113. configuration { "release", "native" }
  114. targetsuffix "-release"
  115. -------------------------------------------------------------------------------
  116. project "crown"
  117. language "C++"
  118. includedirs
  119. {
  120. CROWN_SOURCE_DIR .. "/engine",
  121. CROWN_SOURCE_DIR .. "/engine/core",
  122. CROWN_SOURCE_DIR .. "/engine/core/bv",
  123. CROWN_SOURCE_DIR .. "/engine/core/containers",
  124. CROWN_SOURCE_DIR .. "/engine/core/math",
  125. CROWN_SOURCE_DIR .. "/engine/core/mem",
  126. CROWN_SOURCE_DIR .. "/engine/core/compressors",
  127. CROWN_SOURCE_DIR .. "/engine/core/filesystem",
  128. CROWN_SOURCE_DIR .. "/engine/core/json",
  129. CROWN_SOURCE_DIR .. "/engine/core/strings",
  130. CROWN_SOURCE_DIR .. "/engine/core/settings",
  131. CROWN_SOURCE_DIR .. "/engine/os",
  132. CROWN_SOURCE_DIR .. "/engine/input",
  133. CROWN_SOURCE_DIR .. "/engine/renderers",
  134. CROWN_SOURCE_DIR .. "/engine/renderers/backend",
  135. CROWN_SOURCE_DIR .. "/engine/resource",
  136. CROWN_SOURCE_DIR .. "/engine/lua",
  137. CROWN_SOURCE_DIR .. "/engine/audio",
  138. CROWN_SOURCE_DIR .. "/engine/compilers",
  139. CROWN_SOURCE_DIR .. "/engine/physics",
  140. CROWN_SOURCE_DIR .. "/engine/world"
  141. }
  142. files
  143. {
  144. CROWN_SOURCE_DIR .. "engine/**.h",
  145. CROWN_SOURCE_DIR .. "engine/**.cpp"
  146. }
  147. configuration { "linux-*" }
  148. kind "ConsoleApp"
  149. includedirs {
  150. CROWN_SOURCE_DIR .. "/engine/os/linux",
  151. CROWN_SOURCE_DIR .. "/engine/renderers/backend/gl/glx"
  152. }
  153. buildoptions
  154. {
  155. "-std=c++03",
  156. }
  157. linkoptions
  158. {
  159. "-Wl,-rpath=\\$$ORIGIN"
  160. }
  161. links
  162. {
  163. "Xrandr",
  164. "pthread",
  165. "dl",
  166. "GL",
  167. "X11",
  168. "openal",
  169. "luajit-5.1"
  170. }
  171. excludes
  172. {
  173. CROWN_SOURCE_DIR .. "engine/os/android/*",
  174. CROWN_SOURCE_DIR .. "engine/os/win/*",
  175. CROWN_SOURCE_DIR .. "engine/renderers/backend/gl/egl/*",
  176. CROWN_SOURCE_DIR .. "engine/renderers/backend/gl/wgl/*",
  177. CROWN_SOURCE_DIR .. "engine/audio/backend/SLESSoundWorld.cpp"
  178. }
  179. configuration { "debug", "linux-*" }
  180. buildoptions
  181. {
  182. "-g",
  183. "-pg",
  184. "-Wall",
  185. -- "-Werror",
  186. "-Wno-unknown-pragmas",
  187. "-Wno-unused-local-typedefs",
  188. "-O0"
  189. }
  190. linkoptions
  191. {
  192. "-Wl,--start-group $(addprefix -l," ..
  193. " LowLevelClothCHECKED" ..
  194. " PhysX3CHECKED " ..
  195. " PhysX3CommonCHECKED" ..
  196. " PxTaskCHECKED" ..
  197. " LowLevelCHECKED" ..
  198. " PhysX3CharacterKinematicCHECKED" ..
  199. " PhysX3CookingCHECKED" ..
  200. " PhysX3ExtensionsCHECKED" ..
  201. " PhysX3VehicleCHECKED" ..
  202. " PhysXProfileSDKCHECKED" ..
  203. " PhysXVisualDebuggerSDKCHECKED" ..
  204. " PvdRuntimeCHECKED" ..
  205. " SceneQueryCHECKED" ..
  206. " SimulationControllerCHECKED" ..
  207. ") -Wl,--end-group"
  208. }
  209. configuration { "development", "linux-*" }
  210. buildoptions
  211. {
  212. "-g",
  213. "-pg",
  214. "-Wall",
  215. -- "-Werror",
  216. "-Wno-unknown-pragmas",
  217. "-Wno-unused-local-typedefs",
  218. "-O2"
  219. }
  220. linkoptions
  221. {
  222. "-Wl,--start-group $(addprefix -l," ..
  223. " LowLevelClothPROFILE" ..
  224. " PhysX3PROFILE " ..
  225. " PhysX3CommonPROFILE" ..
  226. " PxTaskPROFILE" ..
  227. " LowLevelPROFILE" ..
  228. " PhysX3CharacterKinematicPROFILE" ..
  229. " PhysX3CookingPROFILE" ..
  230. " PhysX3ExtensionsPROFILE" ..
  231. " PhysX3VehiclePROFILE" ..
  232. " PhysXProfileSDKPROFILE" ..
  233. " PhysXVisualDebuggerSDKPROFILE" ..
  234. " PvdRuntimePROFILE" ..
  235. " SceneQueryPROFILE" ..
  236. " SimulationControllerPROFILE" ..
  237. ") -Wl,--end-group"
  238. }
  239. configuration { "release", "linux-*" }
  240. buildoptions
  241. {
  242. "-O2"
  243. }
  244. linkoptions
  245. {
  246. "-Wl,--start-group $(addprefix -l," ..
  247. " LowLevelCloth" ..
  248. " PhysX3 " ..
  249. " PhysX3Common" ..
  250. " PxTask" ..
  251. " LowLevel" ..
  252. " PhysX3CharacterKinematic" ..
  253. " PhysX3Cooking" ..
  254. " PhysX3Extensions" ..
  255. " PhysX3Vehicle" ..
  256. " PhysXProfileSDK" ..
  257. " PhysXVisualDebuggerSDK" ..
  258. " PvdRuntime" ..
  259. " SceneQuery" ..
  260. " SimulationController" ..
  261. ") -Wl,--end-group"
  262. }
  263. configuration { "x32", "linux-*" }
  264. targetdir(CROWN_INSTALL_DIR .. "bin/linux32")
  265. buildoptions
  266. {
  267. "-malign-double"
  268. }
  269. includedirs
  270. {
  271. CROWN_THIRD_DIR .. "luajit/x86/include/luajit-2.0",
  272. CROWN_THIRD_DIR .. "physx/x86/include",
  273. CROWN_THIRD_DIR .. "physx/x86/include/common",
  274. CROWN_THIRD_DIR .. "physx/x86/include/characterkinematic",
  275. CROWN_THIRD_DIR .. "physx/x86/include/cloth",
  276. CROWN_THIRD_DIR .. "physx/x86/include/common",
  277. CROWN_THIRD_DIR .. "physx/x86/include/cooking",
  278. CROWN_THIRD_DIR .. "physx/x86/include/extensions",
  279. CROWN_THIRD_DIR .. "physx/x86/include/foundation",
  280. CROWN_THIRD_DIR .. "physx/x86/include/geometry",
  281. CROWN_THIRD_DIR .. "physx/x86/include/particles",
  282. CROWN_THIRD_DIR .. "physx/x86/include/physxprofilesdk",
  283. CROWN_THIRD_DIR .. "physx/x86/include/physxvisualdebuggersdk",
  284. CROWN_THIRD_DIR .. "physx/x86/include/pvd",
  285. CROWN_THIRD_DIR .. "physx/x86/include/pxtask",
  286. CROWN_THIRD_DIR .. "physx/x86/include/RepX",
  287. CROWN_THIRD_DIR .. "physx/x86/include/RepXUpgrader",
  288. CROWN_THIRD_DIR .. "physx/x86/include/vehicle",
  289. CROWN_THIRD_DIR .. "opengl",
  290. CROWN_THIRD_DIR .. "openal/include",
  291. CROWN_THIRD_DIR .. "freetype",
  292. CROWN_THIRD_DIR .. "stb_image",
  293. CROWN_THIRD_DIR .. "stb_vorbis"
  294. }
  295. libdirs
  296. {
  297. CROWN_THIRD_DIR .. "luajit/x86/lib",
  298. CROWN_THIRD_DIR .. "physx/x86/lib"
  299. }
  300. configuration { "x64", "linux-*" }
  301. targetdir(CROWN_INSTALL_DIR .. "bin/linux64")
  302. includedirs {
  303. CROWN_THIRD_DIR .. "luajit/x86_64/include/luajit-2.0",
  304. CROWN_THIRD_DIR .. "physx/x86_64/include",
  305. CROWN_THIRD_DIR .. "physx/x86_64/include/common",
  306. CROWN_THIRD_DIR .. "physx/x86_64/include/characterkinematic",
  307. CROWN_THIRD_DIR .. "physx/x86_64/include/cloth",
  308. CROWN_THIRD_DIR .. "physx/x86_64/include/common",
  309. CROWN_THIRD_DIR .. "physx/x86_64/include/cooking",
  310. CROWN_THIRD_DIR .. "physx/x86_64/include/extensions",
  311. CROWN_THIRD_DIR .. "physx/x86_64/include/foundation",
  312. CROWN_THIRD_DIR .. "physx/x86_64/include/geometry",
  313. CROWN_THIRD_DIR .. "physx/x86_64/include/particles",
  314. CROWN_THIRD_DIR .. "physx/x86_64/include/physxprofilesdk",
  315. CROWN_THIRD_DIR .. "physx/x86_64/include/physxvisualdebuggersdk",
  316. CROWN_THIRD_DIR .. "physx/x86_64/include/pvd",
  317. CROWN_THIRD_DIR .. "physx/x86_64/include/pxtask",
  318. CROWN_THIRD_DIR .. "physx/x86_64/include/RepX",
  319. CROWN_THIRD_DIR .. "physx/x86_64/include/RepXUpgrader",
  320. CROWN_THIRD_DIR .. "physx/x86_64/include/vehicle",
  321. CROWN_THIRD_DIR .. "opengl",
  322. CROWN_THIRD_DIR .. "openal/include",
  323. CROWN_THIRD_DIR .. "freetype",
  324. CROWN_THIRD_DIR .. "stb_image",
  325. CROWN_THIRD_DIR .. "stb_vorbis"
  326. }
  327. libdirs
  328. {
  329. CROWN_THIRD_DIR .. "luajit/x86_64/lib",
  330. CROWN_THIRD_DIR .. "physx/x86_64/lib"
  331. }
  332. configuration { "android" }
  333. kind "SharedLib"
  334. targetdir(CROWN_INSTALL_DIR .. "bin/android") -- must be specified by user -- tmp
  335. buildoptions
  336. {
  337. "-std=c++03",
  338. "--sysroot=$(ANDROID_NDK_ROOT)/platforms/android-18/arch-arm"
  339. }
  340. linkoptions
  341. {
  342. "-Wl,-rpath=\\$$ORIGIN",
  343. "-nostdlib",
  344. "-static-libgcc",
  345. "--sysroot=$(ANDROID_NDK_ROOT)/platforms/android-18/arch-arm",
  346. "$(ANDROID_NDK_ROOT)/platforms/android-18/arch-arm/usr/lib/crtbegin_so.o",
  347. "$(ANDROID_NDK_ROOT)/platforms/android-18/arch-arm/usr/lib/crtend_so.o",
  348. }
  349. links
  350. {
  351. "log",
  352. "android",
  353. "EGL",
  354. "GLESv2",
  355. "z",
  356. "OpenSLES",
  357. }
  358. includedirs {
  359. CROWN_SOURCE_DIR .. "engine/os/android",
  360. CROWN_SOURCE_DIR .. "/engine/renderers/backend/gl/egl",
  361. CROWN_THIRD_DIR .. "luajit/android/include/luajit-2.0",
  362. CROWN_THIRD_DIR .. "physx/android/include",
  363. CROWN_THIRD_DIR .. "physx/android/include/common",
  364. CROWN_THIRD_DIR .. "physx/android/include/characterkinematic",
  365. CROWN_THIRD_DIR .. "physx/android/include/cloth",
  366. CROWN_THIRD_DIR .. "physx/android/include/common",
  367. CROWN_THIRD_DIR .. "physx/android/include/cooking",
  368. CROWN_THIRD_DIR .. "physx/android/include/extensions",
  369. CROWN_THIRD_DIR .. "physx/android/include/foundation",
  370. CROWN_THIRD_DIR .. "physx/android/include/geometry",
  371. CROWN_THIRD_DIR .. "physx/android/include/particles",
  372. CROWN_THIRD_DIR .. "physx/android/include/physxprofilesdk",
  373. CROWN_THIRD_DIR .. "physx/android/include/physxvisualdebuggersdk",
  374. CROWN_THIRD_DIR .. "physx/android/include/pvd",
  375. CROWN_THIRD_DIR .. "physx/android/include/pxtask",
  376. CROWN_THIRD_DIR .. "physx/android/include/RepX",
  377. CROWN_THIRD_DIR .. "physx/android/include/RepXUpgrader",
  378. CROWN_THIRD_DIR .. "physx/android/include/vehicle",
  379. CROWN_THIRD_DIR .. "opengl",
  380. CROWN_THIRD_DIR .. "openal/include",
  381. CROWN_THIRD_DIR .. "freetype",
  382. CROWN_THIRD_DIR .. "stb_image",
  383. CROWN_THIRD_DIR .. "stb_vorbis",
  384. "$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.8/include",
  385. "$(ANDROID_NDK_ROOT)/sources/android/native_app_glue",
  386. "$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a/include"
  387. }
  388. libdirs
  389. {
  390. CROWN_THIRD_DIR .. "luajit/android/lib",
  391. CROWN_THIRD_DIR .. "physx/android/lib",
  392. "$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a",
  393. "$(ANDROID_NDK_ROOT)/platforms/android-18/arch-arm/usr/lib"
  394. }
  395. excludes
  396. {
  397. CROWN_SOURCE_DIR .. "engine/os/linux/*",
  398. CROWN_SOURCE_DIR .. "engine/os/win/*",
  399. CROWN_SOURCE_DIR .. "engine/renderers/backend/gl/glx/*",
  400. CROWN_SOURCE_DIR .. "engine/renderers/backend/gl/wgl/*",
  401. CROWN_SOURCE_DIR .. "engine/audio/backend/ALSoundWorld.cpp"
  402. }
  403. configuration { "debug", "android" }
  404. linkoptions
  405. {
  406. "-Wl,--start-group $(addprefix -l," ..
  407. " LowLevelClothCHECKED" ..
  408. " PhysX3CHECKED " ..
  409. " PhysX3CommonCHECKED" ..
  410. " PxTaskCHECKED" ..
  411. " LowLevelCHECKED" ..
  412. " PhysX3CharacterKinematicCHECKED" ..
  413. " PhysX3CookingCHECKED" ..
  414. " PhysX3ExtensionsCHECKED" ..
  415. " PhysX3VehicleCHECKED" ..
  416. " PhysXProfileSDKCHECKED" ..
  417. " PhysXVisualDebuggerSDKCHECKED" ..
  418. " PvdRuntimeCHECKED" ..
  419. " SceneQueryCHECKED" ..
  420. " SimulationControllerCHECKED" ..
  421. ") -Wl,--end-group"
  422. }
  423. configuration { "development", "android"}
  424. linkoptions
  425. {
  426. "-Wl,--start-group $(addprefix -l," ..
  427. " LowLevelClothPROFILE" ..
  428. " PhysX3PROFILE " ..
  429. " PhysX3CommonPROFILE" ..
  430. " PxTaskPROFILE" ..
  431. " LowLevelPROFILE" ..
  432. " PhysX3CharacterKinematicPROFILE" ..
  433. " PhysX3CookingPROFILE" ..
  434. " PhysX3ExtensionsPROFILE" ..
  435. " PhysX3VehiclePROFILE" ..
  436. " PhysXProfileSDKPROFILE" ..
  437. " PhysXVisualDebuggerSDKPROFILE" ..
  438. " PvdRuntimePROFILE" ..
  439. " SceneQueryPROFILE" ..
  440. " SimulationControllerPROFILE" ..
  441. ") -Wl,--end-group"
  442. }
  443. configuration { "release", "android"}
  444. linkoptions
  445. {
  446. "-Wl,--start-group $(addprefix -l," ..
  447. " LowLevelCloth" ..
  448. " PhysX3 " ..
  449. " PhysX3Common" ..
  450. " PxTask" ..
  451. " LowLevel" ..
  452. " PhysX3CharacterKinematic" ..
  453. " PhysX3Cooking" ..
  454. " PhysX3Extensions" ..
  455. " PhysX3Vehicle" ..
  456. " PhysXProfileSDK" ..
  457. " PhysXVisualDebuggerSDK" ..
  458. " PvdRuntime" ..
  459. " SceneQuery" ..
  460. " SimulationController" ..
  461. ") -Wl,--end-group"
  462. }
  463. -- it's necessary to define DXSDK_DIR env variable to DirectX sdk directory
  464. configuration { "vs*" }
  465. kind "ConsoleApp"
  466. targetdir (CROWN_INSTALL_DIR .. "windows")
  467. linkoptions {
  468. "/ignore:4199", -- LNK4199: /DELAYLOAD:*.dll ignored; no imports found from *.dll
  469. "/ignore:4221", -- LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
  470. }
  471. links { -- this is needed only for testing with GLES2/3 on Windows with VS2008
  472. "DelayImp",
  473. }
  474. defines {
  475. "WIN32",
  476. "_WIN32",
  477. "_HAS_EXCEPTIONS=0",
  478. "_HAS_ITERATOR_DEBUGGING=0",
  479. "_SCL_SECURE=0",
  480. "_SECURE_SCL=0",
  481. "_SCL_SECURE_NO_WARNINGS",
  482. "_CRT_SECURE_NO_WARNINGS",
  483. "_CRT_SECURE_NO_DEPRECATE"
  484. }
  485. buildoptions {
  486. "/Oy-", -- Suppresses creation of frame pointers on the call stack.
  487. "/Ob2", -- The Inline Function Expansion
  488. }
  489. links
  490. {
  491. "OpenGL32",
  492. "lua51",
  493. "OpenAL32"
  494. }
  495. includedirs {
  496. CROWN_SOURCE_DIR .. "/engine/os/win",
  497. CROWN_SOURCE_DIR .. "/engine/renderers/backend/gl/wgl"
  498. }
  499. libdirs
  500. {
  501. CROWN_THIRD_DIR .. "openal/lib"
  502. }
  503. excludes
  504. {
  505. CROWN_SOURCE_DIR .. "engine/os/android/*",
  506. CROWN_SOURCE_DIR .. "engine/os/linux/*",
  507. CROWN_SOURCE_DIR .. "engine/os/posix/*",
  508. CROWN_SOURCE_DIR .. "engine/renderers/backend/gl/egl/*",
  509. CROWN_SOURCE_DIR .. "engine/renderers/backend/gl/glx/*",
  510. CROWN_SOURCE_DIR .. "engine/audio/backend/SLESSoundWorld.cpp"
  511. }
  512. configuration { "vs2010" }
  513. linkoptions {
  514. "/DELAYLOAD:\"libEGL.dll\"", -- this is needed only for testing with GLES2/3 on Windows with VS201x
  515. "/DELAYLOAD:\"libGLESv2.dll\""
  516. }
  517. configuration { "vs*", "debug" }
  518. links
  519. {
  520. "PhysX3ExtensionsCHECKED",
  521. "PhysXProfileSDKCHECKED",
  522. "PhysXVisualDebuggerSDKCHECKED",
  523. "PxTaskCHECKED"
  524. }
  525. configuration { "vs*", "development" }
  526. links
  527. {
  528. "PhysX3ExtensionsPROFILE",
  529. "PhysXProfileSDKPROFILE",
  530. "PhysXVisualDebuggerSDKPROFILE",
  531. "PxTaskPROFILE"
  532. }
  533. configuration { "vs*", "release" }
  534. links
  535. {
  536. "PhysX3Extensions",
  537. "PhysXProfileSDK",
  538. "PhysXVisualDebuggerSDK",
  539. "PxTask",
  540. }
  541. configuration { "x32", "vs*" }
  542. includedirs {
  543. CROWN_THIRD_DIR .. "luajit/win32/include/luajit-2.0",
  544. CROWN_THIRD_DIR .. "physx/win32/include",
  545. CROWN_THIRD_DIR .. "physx/win32/include/common",
  546. CROWN_THIRD_DIR .. "physx/win32/include/characterkinematic",
  547. CROWN_THIRD_DIR .. "physx/win32/include/cloth",
  548. CROWN_THIRD_DIR .. "physx/win32/include/common",
  549. CROWN_THIRD_DIR .. "physx/win32/include/cooking",
  550. CROWN_THIRD_DIR .. "physx/win32/include/extensions",
  551. CROWN_THIRD_DIR .. "physx/win32/include/foundation",
  552. CROWN_THIRD_DIR .. "physx/win32/include/geometry",
  553. CROWN_THIRD_DIR .. "physx/win32/include/particles",
  554. CROWN_THIRD_DIR .. "physx/win32/include/physxprofilesdk",
  555. CROWN_THIRD_DIR .. "physx/win32/include/physxvisualdebuggersdk",
  556. CROWN_THIRD_DIR .. "physx/win32/include/pvd",
  557. CROWN_THIRD_DIR .. "physx/win32/include/pxtask",
  558. CROWN_THIRD_DIR .. "physx/win32/include/RepX",
  559. CROWN_THIRD_DIR .. "physx/win32/include/RepXUpgrader",
  560. CROWN_THIRD_DIR .. "physx/win32/include/vehicle",
  561. CROWN_THIRD_DIR .. "opengl",
  562. CROWN_THIRD_DIR .. "openal/include",
  563. CROWN_THIRD_DIR .. "freetype",
  564. CROWN_THIRD_DIR .. "stb_image",
  565. CROWN_THIRD_DIR .. "stb_vorbis"
  566. }
  567. libdirs
  568. {
  569. CROWN_THIRD_DIR .. "luajit/win32/lib",
  570. CROWN_THIRD_DIR .. "physx/win32/lib"
  571. }
  572. configuration { "x64", "vs*" }
  573. defines { "_WIN64" }
  574. includedirs {
  575. CROWN_THIRD_DIR .. "luajit/win64/include/luajit-2.0",
  576. CROWN_THIRD_DIR .. "physx/win64/include",
  577. CROWN_THIRD_DIR .. "physx/win64/include/common",
  578. CROWN_THIRD_DIR .. "physx/win64/include/characterkinematic",
  579. CROWN_THIRD_DIR .. "physx/win64/include/cloth",
  580. CROWN_THIRD_DIR .. "physx/win64/include/common",
  581. CROWN_THIRD_DIR .. "physx/win64/include/cooking",
  582. CROWN_THIRD_DIR .. "physx/win64/include/extensions",
  583. CROWN_THIRD_DIR .. "physx/win64/include/foundation",
  584. CROWN_THIRD_DIR .. "physx/win64/include/geometry",
  585. CROWN_THIRD_DIR .. "physx/win64/include/particles",
  586. CROWN_THIRD_DIR .. "physx/win64/include/physxprofilesdk",
  587. CROWN_THIRD_DIR .. "physx/win64/include/physxvisualdebuggersdk",
  588. CROWN_THIRD_DIR .. "physx/win64/include/pvd",
  589. CROWN_THIRD_DIR .. "physx/win64/include/pxtask",
  590. CROWN_THIRD_DIR .. "physx/win64/include/RepX",
  591. CROWN_THIRD_DIR .. "physx/win64/include/RepXUpgrader",
  592. CROWN_THIRD_DIR .. "physx/win64/include/vehicle",
  593. CROWN_THIRD_DIR .. "opengl",
  594. CROWN_THIRD_DIR .. "openal/include",
  595. CROWN_THIRD_DIR .. "freetype",
  596. CROWN_THIRD_DIR .. "stb_image",
  597. CROWN_THIRD_DIR .. "stb_vorbis"
  598. }
  599. libdirs {
  600. CROWN_THIRD_DIR .. "luajit/win64/lib",
  601. CROWN_THIRD_DIR .. "physx/win64/lib"
  602. }
  603. configuration { "debug", "x32", "vs*"}
  604. links {
  605. "PhysX3CharacterKinematicCHECKED_x86",
  606. "PhysX3CHECKED_x86",
  607. "PhysX3CommonCHECKED_x86",
  608. "PhysX3CookingCHECKED_x86"
  609. }
  610. configuration { "debug", "x64", "vs*" }
  611. links {
  612. "PhysX3CharacterKinematicCHECKED_x64",
  613. "PhysX3CHECKED_x64",
  614. "PhysX3CommonCHECKED_x64",
  615. "PhysX3CookingCHECKED_x64"
  616. }
  617. configuration { "development", "x32", "vs*" }
  618. links {
  619. "PhysX3CharacterKinematicPROFILE_x86",
  620. "PhysX3PROFILE_x86",
  621. "PhysX3CommonPROFILE_x86",
  622. "PhysX3CookingPROFILE_x86"
  623. }
  624. configuration { "development", "x64", "vs*" }
  625. links {
  626. "PhysX3CharacterKinematicPROFILE_x64",
  627. "PhysX3PROFILE_x64",
  628. "PhysX3CommonPROFILE_x64",
  629. "PhysX3CookingPROFILE_x64"
  630. }
  631. configuration { "debug", "x32", "vs*" }
  632. links {
  633. "PhysX3CharacterKinematic_x86",
  634. "PhysX3_x86",
  635. "PhysX3Common_x86",
  636. "PhysX3Cooking_x86"
  637. }
  638. configuration { "debug", "x64", "vs*" }
  639. links {
  640. "PhysX3CharacterKinematic_x64",
  641. "PhysX3_x64",
  642. "PhysX3Common_x64",
  643. "PhysX3Cooking_x64"
  644. }
  645. os.copyfile(CROWN_THIRD_DIR .. "luajit/x86/bin/luajit-2.0.3", CROWN_INSTALL_DIR .. "bin/linux32")
  646. os.copyfile(CROWN_THIRD_DIR .. "luajit/x86/bin/luajit", CROWN_INSTALL_DIR .. "bin/linux32")
  647. os.copyfile(CROWN_THIRD_DIR .. "luajit/x86/lib/libluajit-5.1.so.2.0.3", CROWN_INSTALL_DIR .. "bin/linux32")
  648. os.copyfile(CROWN_THIRD_DIR .. "luajit/x86/lib/libluajit-5.1.so.2", CROWN_INSTALL_DIR .. "bin/linux32")
  649. os.mkdir(CROWN_INSTALL_DIR .. "bin/linux32/jit")
  650. os.copyfile(CROWN_THIRD_DIR .. "/luajit/x86/share/luajit-2.0.3/jit/*", CROWN_INSTALL_DIR .. "bin/linux32/jit")
  651. os.copyfile(CROWN_THIRD_DIR .. "luajit/x86_64/bin/luajit-2.0.3", CROWN_INSTALL_DIR .. "bin/linux64")
  652. os.copyfile(CROWN_THIRD_DIR .. "luajit/x86_64/bin/luajit", CROWN_INSTALL_DIR .. "bin/linux64")
  653. os.copyfile(CROWN_THIRD_DIR .. "luajit/x86_64/lib/libluajit-5.1.so.2.0.3", CROWN_INSTALL_DIR .. "bin/linux64")
  654. os.copyfile(CROWN_THIRD_DIR .. "luajit/x86_64/lib/libluajit-5.1.so.2", CROWN_INSTALL_DIR .. "bin/linux64")
  655. os.mkdir(CROWN_INSTALL_DIR .. "bin/linux64/jit")
  656. os.copyfile(CROWN_THIRD_DIR .. "/luajit/x86_64/share/luajit-2.0.3/jit/*", CROWN_INSTALL_DIR .. "bin/linux64/jit")
  657. os.copyfile(CROWN_THIRD_DIR .. "luajit/android/lib/libluajit-5.1.so.2.0.2", CROWN_INSTALL_DIR .. "bin/android")
  658. os.copyfile(CROWN_THIRD_DIR .. "luajit/android/lib/libluajit-5.1.so", CROWN_INSTALL_DIR .. "bin/android")