premake4.lua 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765
  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. { "linux-gcc", "Linux (GCC compiler)" }, -- gcc
  41. }
  42. }
  43. CROWN_SOURCE_DIR = path.getabsolute("..") .. "/"
  44. CROWN_THIRD_DIR = CROWN_SOURCE_DIR .. "third/"
  45. CROWN_BUILD_DIR = CROWN_SOURCE_DIR .. ".build/"
  46. CROWN_INSTALL_DIR = os.getenv("CROWN_INSTALL_DIR")
  47. if not CROWN_INSTALL_DIR then
  48. if not path.isabsolute(CROWN_INSTALL_DIR) then
  49. CROWN_INSTALL_DIR = CROWN_SOURCE_DIR .. ".install"
  50. end
  51. end
  52. CROWN_INSTALL_DIR = CROWN_INSTALL_DIR .. "/" -- Add slash to end string
  53. -------------------------------------------------------------------------------
  54. -- Solution
  55. solution "crown"
  56. configurations { "debug", "development", "release" }
  57. platforms { "native", "x32", "x64" }
  58. -- Avoid error invoking premake4 --help
  59. if _ACTION == nil then return end
  60. if _ACTION == "clean" then os.rmdir(CROWN_BUILD_DIR) end
  61. if _ACTION == "gmake" then
  62. if _OPTIONS["compiler"] == "linux-gcc" then
  63. if not os.is("linux") then print("Action not valid in current OS.") end
  64. location(CROWN_BUILD_DIR .. "linux")
  65. elseif _OPTIONS["compiler"] == "android" then
  66. if not os.getenv("ANDROID_NDK_ROOT") then print("Set ANDROID_NDK_ROOT environment variable.") end
  67. if not os.getenv("ANDROID_NDK_ARM") then print("Set ANDROID_NDK_ARM environment variables.") end
  68. premake.gcc.cc = "$(ANDROID_NDK_ARM)/bin/arm-linux-androideabi-gcc"
  69. premake.gcc.cxx = "$(ANDROID_NDK_ARM)/bin/arm-linux-androideabi-g++"
  70. premake.gcc.ar = "$(ANDROID_NDK_ARM)/bin/arm-linux-androideabi-ar"
  71. location(CROWN_BUILD_DIR .. "android")
  72. end
  73. end
  74. if _ACTION == "vs2010" or _ACTION == "vs2008" then
  75. if not os.is("windows") then print("Action not valid in current OS.") end
  76. if not os.getenv("DXSDK_DIR") then print("Environment variable DXSDK_DIR must be set.") end
  77. location(CROWN_BUILD_DIR .. "windows")
  78. end
  79. flags {
  80. "NoMinimalRebuild",
  81. "NoPCH",
  82. "NoRTTI",
  83. "NoExceptions",
  84. "NoEditAndContinue",
  85. }
  86. configuration { "debug" }
  87. flags { "Symbols" }
  88. defines { "_DEBUG", "CROWN_DEBUG" }
  89. configuration { "development" }
  90. flags { "Symbols" }
  91. defines { "_DEBUG", "CROWN_DEBUG" }
  92. configuration { "release" }
  93. defines { "NDEBUG" }
  94. configuration { "debug", "x32" }
  95. targetsuffix "-debug-32"
  96. configuration { "debug", "x64" }
  97. targetsuffix "-debug-64"
  98. configuration { "development", "x32" }
  99. targetsuffix "-development-32"
  100. configuration { "development", "x64" }
  101. targetsuffix "-development-64"
  102. configuration { "release", "x32" }
  103. targetsuffix "-release-32"
  104. configuration { "release", "x64" }
  105. targetsuffix "-release-64"
  106. configuration { "debug", "native" }
  107. targetsuffix "-debug"
  108. configuration { "development", "native" }
  109. targetsuffix "-development"
  110. configuration { "release", "native" }
  111. targetsuffix "-release"
  112. -------------------------------------------------------------------------------
  113. project "crown"
  114. language "C++"
  115. includedirs {
  116. CROWN_SOURCE_DIR .. "/engine",
  117. CROWN_SOURCE_DIR .. "/engine/core",
  118. CROWN_SOURCE_DIR .. "/engine/core/bv",
  119. CROWN_SOURCE_DIR .. "/engine/core/containers",
  120. CROWN_SOURCE_DIR .. "/engine/core/math",
  121. CROWN_SOURCE_DIR .. "/engine/core/mem",
  122. CROWN_SOURCE_DIR .. "/engine/core/compressors",
  123. CROWN_SOURCE_DIR .. "/engine/core/filesystem",
  124. CROWN_SOURCE_DIR .. "/engine/core/json",
  125. CROWN_SOURCE_DIR .. "/engine/core/strings",
  126. CROWN_SOURCE_DIR .. "/engine/core/settings",
  127. CROWN_SOURCE_DIR .. "/engine/os",
  128. CROWN_SOURCE_DIR .. "/engine/input",
  129. CROWN_SOURCE_DIR .. "/engine/renderers",
  130. CROWN_SOURCE_DIR .. "/engine/renderers/backend",
  131. CROWN_SOURCE_DIR .. "/engine/resource",
  132. CROWN_SOURCE_DIR .. "/engine/lua",
  133. CROWN_SOURCE_DIR .. "/engine/audio",
  134. CROWN_SOURCE_DIR .. "/engine/compilers",
  135. CROWN_SOURCE_DIR .. "/engine/physics",
  136. CROWN_SOURCE_DIR .. "/engine/world"
  137. }
  138. files {
  139. CROWN_SOURCE_DIR .. "engine/**.h",
  140. CROWN_SOURCE_DIR .. "engine/**.cpp"
  141. }
  142. configuration { "linux-*" }
  143. kind "ConsoleApp"
  144. buildoptions {
  145. "-std=c++03",
  146. "-Wall",
  147. "-Wextra",
  148. -- "-Werror",
  149. -- "-pedantic",
  150. "-Wno-unknown-pragmas",
  151. "-Wno-unused-local-typedefs"
  152. }
  153. linkoptions {
  154. "-Wl,-rpath=\\$$ORIGIN"
  155. }
  156. links {
  157. "Xrandr",
  158. "pthread",
  159. "dl",
  160. "GL",
  161. "X11",
  162. "openal",
  163. "luajit-5.1"
  164. }
  165. includedirs {
  166. CROWN_SOURCE_DIR .. "/engine/os/linux",
  167. CROWN_SOURCE_DIR .. "/engine/renderers/backend/gl/glx",
  168. }
  169. excludes {
  170. CROWN_SOURCE_DIR .. "engine/os/android/*",
  171. CROWN_SOURCE_DIR .. "engine/os/win/*",
  172. CROWN_SOURCE_DIR .. "engine/renderers/backend/gl/egl/*",
  173. CROWN_SOURCE_DIR .. "engine/renderers/backend/gl/wgl/*",
  174. CROWN_SOURCE_DIR .. "engine/audio/backend/SLESSoundWorld.cpp",
  175. }
  176. configuration { "linux-*", "debug" }
  177. buildoptions {
  178. "-O0"
  179. }
  180. linkoptions {
  181. "-Wl,--start-group $(addprefix -l," ..
  182. " LowLevelClothCHECKED" ..
  183. " PhysX3CHECKED " ..
  184. " PhysX3CommonCHECKED" ..
  185. " PxTaskCHECKED" ..
  186. " LowLevelCHECKED" ..
  187. " PhysX3CharacterKinematicCHECKED" ..
  188. " PhysX3CookingCHECKED" ..
  189. " PhysX3ExtensionsCHECKED" ..
  190. " PhysX3VehicleCHECKED" ..
  191. " PhysXProfileSDKCHECKED" ..
  192. " PhysXVisualDebuggerSDKCHECKED" ..
  193. " PvdRuntimeCHECKED" ..
  194. " SceneQueryCHECKED" ..
  195. " SimulationControllerCHECKED" ..
  196. ") -Wl,--end-group"
  197. }
  198. configuration { "linux-*", "development" }
  199. buildoptions {
  200. "-O2"
  201. }
  202. linkoptions
  203. {
  204. "-Wl,--start-group $(addprefix -l," ..
  205. " LowLevelClothPROFILE" ..
  206. " PhysX3PROFILE " ..
  207. " PhysX3CommonPROFILE" ..
  208. " PxTaskPROFILE" ..
  209. " LowLevelPROFILE" ..
  210. " PhysX3CharacterKinematicPROFILE" ..
  211. " PhysX3CookingPROFILE" ..
  212. " PhysX3ExtensionsPROFILE" ..
  213. " PhysX3VehiclePROFILE" ..
  214. " PhysXProfileSDKPROFILE" ..
  215. " PhysXVisualDebuggerSDKPROFILE" ..
  216. " PvdRuntimePROFILE" ..
  217. " SceneQueryPROFILE" ..
  218. " SimulationControllerPROFILE" ..
  219. ") -Wl,--end-group"
  220. }
  221. configuration { "linux-*", "release" }
  222. buildoptions {
  223. "-O2"
  224. }
  225. linkoptions {
  226. "-Wl,--start-group $(addprefix -l," ..
  227. " LowLevelCloth" ..
  228. " PhysX3 " ..
  229. " PhysX3Common" ..
  230. " PxTask" ..
  231. " LowLevel" ..
  232. " PhysX3CharacterKinematic" ..
  233. " PhysX3Cooking" ..
  234. " PhysX3Extensions" ..
  235. " PhysX3Vehicle" ..
  236. " PhysXProfileSDK" ..
  237. " PhysXVisualDebuggerSDK" ..
  238. " PvdRuntime" ..
  239. " SceneQuery" ..
  240. " SimulationController" ..
  241. ") -Wl,--end-group"
  242. }
  243. configuration { "linux-*", "x32" }
  244. targetdir(CROWN_INSTALL_DIR .. "bin/linux32")
  245. buildoptions {
  246. "-malign-double" -- Required by PhysX
  247. }
  248. includedirs {
  249. CROWN_THIRD_DIR .. "luajit/x86/include/luajit-2.0",
  250. CROWN_THIRD_DIR .. "physx/x86/include",
  251. CROWN_THIRD_DIR .. "physx/x86/include/common",
  252. CROWN_THIRD_DIR .. "physx/x86/include/characterkinematic",
  253. CROWN_THIRD_DIR .. "physx/x86/include/cloth",
  254. CROWN_THIRD_DIR .. "physx/x86/include/common",
  255. CROWN_THIRD_DIR .. "physx/x86/include/cooking",
  256. CROWN_THIRD_DIR .. "physx/x86/include/extensions",
  257. CROWN_THIRD_DIR .. "physx/x86/include/foundation",
  258. CROWN_THIRD_DIR .. "physx/x86/include/geometry",
  259. CROWN_THIRD_DIR .. "physx/x86/include/particles",
  260. CROWN_THIRD_DIR .. "physx/x86/include/physxprofilesdk",
  261. CROWN_THIRD_DIR .. "physx/x86/include/physxvisualdebuggersdk",
  262. CROWN_THIRD_DIR .. "physx/x86/include/pvd",
  263. CROWN_THIRD_DIR .. "physx/x86/include/pxtask",
  264. CROWN_THIRD_DIR .. "physx/x86/include/RepX",
  265. CROWN_THIRD_DIR .. "physx/x86/include/RepXUpgrader",
  266. CROWN_THIRD_DIR .. "physx/x86/include/vehicle",
  267. CROWN_THIRD_DIR .. "opengl",
  268. CROWN_THIRD_DIR .. "openal/include",
  269. CROWN_THIRD_DIR .. "freetype",
  270. CROWN_THIRD_DIR .. "stb_image",
  271. CROWN_THIRD_DIR .. "stb_vorbis"
  272. }
  273. libdirs {
  274. CROWN_THIRD_DIR .. "luajit/x86/lib",
  275. CROWN_THIRD_DIR .. "physx/x86/lib"
  276. }
  277. postbuildcommands {
  278. "cp " .. CROWN_THIRD_DIR .. "luajit/x86/bin/luajit " .. CROWN_INSTALL_DIR .. "bin/linux32/",
  279. "cp " .. CROWN_THIRD_DIR .. "luajit/x86/lib/libluajit-5.1.so.2 " .. CROWN_INSTALL_DIR .. "bin/linux32/",
  280. "cp -r " .. CROWN_THIRD_DIR .. "/luajit/x86/share/luajit-2.0.3/jit " .. CROWN_INSTALL_DIR .. "bin/linux32/"
  281. }
  282. configuration { "linux-*", "x64" }
  283. targetdir(CROWN_INSTALL_DIR .. "bin/linux64")
  284. includedirs {
  285. CROWN_THIRD_DIR .. "luajit/x86_64/include/luajit-2.0",
  286. CROWN_THIRD_DIR .. "physx/x86_64/include",
  287. CROWN_THIRD_DIR .. "physx/x86_64/include/common",
  288. CROWN_THIRD_DIR .. "physx/x86_64/include/characterkinematic",
  289. CROWN_THIRD_DIR .. "physx/x86_64/include/cloth",
  290. CROWN_THIRD_DIR .. "physx/x86_64/include/common",
  291. CROWN_THIRD_DIR .. "physx/x86_64/include/cooking",
  292. CROWN_THIRD_DIR .. "physx/x86_64/include/extensions",
  293. CROWN_THIRD_DIR .. "physx/x86_64/include/foundation",
  294. CROWN_THIRD_DIR .. "physx/x86_64/include/geometry",
  295. CROWN_THIRD_DIR .. "physx/x86_64/include/particles",
  296. CROWN_THIRD_DIR .. "physx/x86_64/include/physxprofilesdk",
  297. CROWN_THIRD_DIR .. "physx/x86_64/include/physxvisualdebuggersdk",
  298. CROWN_THIRD_DIR .. "physx/x86_64/include/pvd",
  299. CROWN_THIRD_DIR .. "physx/x86_64/include/pxtask",
  300. CROWN_THIRD_DIR .. "physx/x86_64/include/RepX",
  301. CROWN_THIRD_DIR .. "physx/x86_64/include/RepXUpgrader",
  302. CROWN_THIRD_DIR .. "physx/x86_64/include/vehicle",
  303. CROWN_THIRD_DIR .. "opengl",
  304. CROWN_THIRD_DIR .. "openal/include",
  305. CROWN_THIRD_DIR .. "freetype",
  306. CROWN_THIRD_DIR .. "stb_image",
  307. CROWN_THIRD_DIR .. "stb_vorbis",
  308. }
  309. libdirs {
  310. CROWN_THIRD_DIR .. "luajit/x86_64/lib",
  311. CROWN_THIRD_DIR .. "physx/x86_64/lib",
  312. }
  313. postbuildcommands {
  314. "cp " .. CROWN_THIRD_DIR .. "luajit/x86_64/bin/luajit " .. CROWN_INSTALL_DIR .. "bin/linux64/",
  315. "cp " .. CROWN_THIRD_DIR .. "luajit/x86_64/lib/libluajit-5.1.so.2 " .. CROWN_INSTALL_DIR .. "bin/linux64/",
  316. "cp -r " .. CROWN_THIRD_DIR .. "/luajit/x86_64/share/luajit-2.0.3/jit " .. CROWN_INSTALL_DIR .. "bin/linux64/"
  317. }
  318. configuration { "android" }
  319. kind "ConsoleApp"
  320. targetprefix "lib"
  321. targetextension ".so"
  322. targetdir(CROWN_INSTALL_DIR .. "bin/android") -- must be specified by user -- tmp
  323. flags { "NoImportLib" }
  324. defines { "__STDC_FORMAT_MACROS" }
  325. buildoptions {
  326. "--sysroot=$(ANDROID_NDK_ROOT)/platforms/android-14/arch-arm",
  327. "-ffunction-sections",
  328. "-fPIC",
  329. "-march=armv7-a",
  330. "-mfloat-abi=softfp",
  331. "-mthumb",
  332. "-no-canonical-prefixes",
  333. "-std=c++03",
  334. "-Wno-psabi", -- note: the mangling of 'va_list' has changed in GCC 4.4.0
  335. "-no-canonical-prefixes",
  336. "-fstack-protector",
  337. "-mfpu=neon",
  338. "-Wa,--noexecstack",
  339. }
  340. linkoptions {
  341. "-shared",
  342. "-nostdlib",
  343. "-static-libgcc",
  344. "--sysroot=$(ANDROID_NDK_ROOT)/platforms/android-14/arch-arm",
  345. "$(ANDROID_NDK_ROOT)/platforms/android-14/arch-arm/usr/lib/crtbegin_so.o",
  346. "$(ANDROID_NDK_ROOT)/platforms/android-14/arch-arm/usr/lib/crtend_so.o",
  347. "-no-canonical-prefixes",
  348. "-Wl,--no-undefined",
  349. "-Wl,-z,noexecstack",
  350. "-Wl,-z,relro",
  351. "-Wl,-z,now",
  352. "-march=armv7-a",
  353. "-Wl,--fix-cortex-a8",
  354. }
  355. links {
  356. ":libluajit-5.1.a",
  357. "android",
  358. "c",
  359. "dl",
  360. "EGL",
  361. "gcc",
  362. "GLESv2",
  363. "gnustl_static",
  364. "log",
  365. "m",
  366. "OpenSLES"
  367. }
  368. includedirs {
  369. CROWN_SOURCE_DIR .. "engine/os/android",
  370. CROWN_SOURCE_DIR .. "/engine/renderers/backend/gl/egl",
  371. CROWN_THIRD_DIR .. "luajit/android/include/luajit-2.0",
  372. CROWN_THIRD_DIR .. "physx/android/include",
  373. CROWN_THIRD_DIR .. "physx/android/include/common",
  374. CROWN_THIRD_DIR .. "physx/android/include/characterkinematic",
  375. CROWN_THIRD_DIR .. "physx/android/include/cloth",
  376. CROWN_THIRD_DIR .. "physx/android/include/common",
  377. CROWN_THIRD_DIR .. "physx/android/include/cooking",
  378. CROWN_THIRD_DIR .. "physx/android/include/extensions",
  379. CROWN_THIRD_DIR .. "physx/android/include/foundation",
  380. CROWN_THIRD_DIR .. "physx/android/include/geometry",
  381. CROWN_THIRD_DIR .. "physx/android/include/particles",
  382. CROWN_THIRD_DIR .. "physx/android/include/physxprofilesdk",
  383. CROWN_THIRD_DIR .. "physx/android/include/physxvisualdebuggersdk",
  384. CROWN_THIRD_DIR .. "physx/android/include/pvd",
  385. CROWN_THIRD_DIR .. "physx/android/include/pxtask",
  386. CROWN_THIRD_DIR .. "physx/android/include/RepX",
  387. CROWN_THIRD_DIR .. "physx/android/include/RepXUpgrader",
  388. CROWN_THIRD_DIR .. "physx/android/include/vehicle",
  389. CROWN_THIRD_DIR .. "opengl",
  390. CROWN_THIRD_DIR .. "openal/include",
  391. CROWN_THIRD_DIR .. "freetype",
  392. CROWN_THIRD_DIR .. "stb_image",
  393. CROWN_THIRD_DIR .. "stb_vorbis",
  394. "$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.8/include",
  395. "$(ANDROID_NDK_ROOT)/sources/android/native_app_glue",
  396. "$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a/include"
  397. }
  398. libdirs {
  399. CROWN_THIRD_DIR .. "luajit/android/lib",
  400. CROWN_THIRD_DIR .. "physx/android/lib",
  401. "$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a",
  402. "$(ANDROID_NDK_ROOT)/platforms/android-14/arch-arm/usr/lib"
  403. }
  404. excludes {
  405. CROWN_SOURCE_DIR .. "engine/os/linux/*",
  406. CROWN_SOURCE_DIR .. "engine/os/win/*",
  407. CROWN_SOURCE_DIR .. "engine/renderers/backend/gl/glx/*",
  408. CROWN_SOURCE_DIR .. "engine/renderers/backend/gl/wgl/*",
  409. CROWN_SOURCE_DIR .. "engine/audio/backend/ALSoundWorld.cpp"
  410. }
  411. configuration { "debug", "android" }
  412. -- linkoptions
  413. -- {
  414. -- "-Wl,--start-group $(addprefix -l," ..
  415. -- " LowLevelClothCHECKED" ..
  416. -- " PhysX3CHECKED " ..
  417. -- " PhysX3CommonCHECKED" ..
  418. -- " PxTaskCHECKED" ..
  419. -- " LowLevelCHECKED" ..
  420. -- " PhysX3CharacterKinematicCHECKED" ..
  421. -- " PhysX3CookingCHECKED" ..
  422. -- " PhysX3ExtensionsCHECKED" ..
  423. -- " PhysX3VehicleCHECKED" ..
  424. -- " PhysXProfileSDKCHECKED" ..
  425. -- " PhysXVisualDebuggerSDKCHECKED" ..
  426. -- " PvdRuntimeCHECKED" ..
  427. -- " SceneQueryCHECKED" ..
  428. -- " SimulationControllerCHECKED" ..
  429. -- ") -Wl,--end-group"
  430. -- }
  431. linkoptions {
  432. "-Wl,--start-group $(addprefix -l," ..
  433. " LowLevelCloth" ..
  434. " PhysX3 " ..
  435. " PhysX3Common" ..
  436. " PxTask" ..
  437. " LowLevel" ..
  438. " PhysX3CharacterKinematic" ..
  439. " PhysX3Cooking" ..
  440. " PhysX3Extensions" ..
  441. " PhysX3Vehicle" ..
  442. " PhysXProfileSDK" ..
  443. " PhysXVisualDebuggerSDK" ..
  444. " PvdRuntime" ..
  445. " SceneQuery" ..
  446. " SimulationController" ..
  447. ") -Wl,--end-group"
  448. }
  449. configuration { "development", "android"}
  450. -- linkoptions
  451. -- {
  452. -- "-Wl,--start-group $(addprefix -l," ..
  453. -- " LowLevelClothPROFILE" ..
  454. -- " PhysX3PROFILE " ..
  455. -- " PhysX3CommonPROFILE" ..
  456. -- " PxTaskPROFILE" ..
  457. -- " LowLevelPROFILE" ..
  458. -- " PhysX3CharacterKinematicPROFILE" ..
  459. -- " PhysX3CookingPROFILE" ..
  460. -- " PhysX3ExtensionsPROFILE" ..
  461. -- " PhysX3VehiclePROFILE" ..
  462. -- " PhysXProfileSDKPROFILE" ..
  463. -- " PhysXVisualDebuggerSDKPROFILE" ..
  464. -- " PvdRuntimePROFILE" ..
  465. -- " SceneQueryPROFILE" ..
  466. -- " SimulationControllerPROFILE" ..
  467. -- ") -Wl,--end-group"
  468. -- }
  469. linkoptions {
  470. "-Wl,--start-group $(addprefix -l," ..
  471. " LowLevelCloth" ..
  472. " PhysX3 " ..
  473. " PhysX3Common" ..
  474. " PxTask" ..
  475. " LowLevel" ..
  476. " PhysX3CharacterKinematic" ..
  477. " PhysX3Cooking" ..
  478. " PhysX3Extensions" ..
  479. " PhysX3Vehicle" ..
  480. " PhysXProfileSDK" ..
  481. " PhysXVisualDebuggerSDK" ..
  482. " PvdRuntime" ..
  483. " SceneQuery" ..
  484. " SimulationController" ..
  485. ") -Wl,--end-group"
  486. }
  487. configuration { "release", "android"}
  488. linkoptions {
  489. "-Wl,--start-group $(addprefix -l," ..
  490. " LowLevelCloth" ..
  491. " PhysX3 " ..
  492. " PhysX3Common" ..
  493. " PxTask" ..
  494. " LowLevel" ..
  495. " PhysX3CharacterKinematic" ..
  496. " PhysX3Cooking" ..
  497. " PhysX3Extensions" ..
  498. " PhysX3Vehicle" ..
  499. " PhysXProfileSDK" ..
  500. " PhysXVisualDebuggerSDK" ..
  501. " PvdRuntime" ..
  502. " SceneQuery" ..
  503. " SimulationController" ..
  504. ") -Wl,--end-group"
  505. }
  506. -- it's necessary to define DXSDK_DIR env variable to DirectX sdk directory
  507. configuration { "vs*" }
  508. kind "ConsoleApp"
  509. targetdir (CROWN_INSTALL_DIR .. "windows")
  510. linkoptions {
  511. "/ignore:4199", -- LNK4199: /DELAYLOAD:*.dll ignored; no imports found from *.dll
  512. "/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
  513. }
  514. links { -- this is needed only for testing with GLES2/3 on Windows with VS2008
  515. "DelayImp",
  516. }
  517. defines {
  518. "WIN32",
  519. "_WIN32",
  520. "_HAS_EXCEPTIONS=0",
  521. "_HAS_ITERATOR_DEBUGGING=0",
  522. "_SCL_SECURE=0",
  523. "_SECURE_SCL=0",
  524. "_SCL_SECURE_NO_WARNINGS",
  525. "_CRT_SECURE_NO_WARNINGS",
  526. "_CRT_SECURE_NO_DEPRECATE"
  527. }
  528. buildoptions {
  529. "/Oy-", -- Suppresses creation of frame pointers on the call stack.
  530. "/Ob2", -- The Inline Function Expansion
  531. }
  532. links {
  533. "OpenGL32",
  534. "lua51",
  535. "OpenAL32"
  536. }
  537. includedirs {
  538. CROWN_SOURCE_DIR .. "/engine/os/win",
  539. CROWN_SOURCE_DIR .. "/engine/renderers/backend/gl/wgl"
  540. }
  541. libdirs {
  542. CROWN_THIRD_DIR .. "openal/lib"
  543. }
  544. excludes {
  545. CROWN_SOURCE_DIR .. "engine/os/android/*",
  546. CROWN_SOURCE_DIR .. "engine/os/linux/*",
  547. CROWN_SOURCE_DIR .. "engine/os/posix/*",
  548. CROWN_SOURCE_DIR .. "engine/renderers/backend/gl/egl/*",
  549. CROWN_SOURCE_DIR .. "engine/renderers/backend/gl/glx/*",
  550. CROWN_SOURCE_DIR .. "engine/audio/backend/SLESSoundWorld.cpp"
  551. }
  552. configuration { "vs2010" }
  553. linkoptions {
  554. "/DELAYLOAD:\"libEGL.dll\"", -- this is needed only for testing with GLES2/3 on Windows with VS201x
  555. "/DELAYLOAD:\"libGLESv2.dll\""
  556. }
  557. configuration { "vs*", "debug" }
  558. links {
  559. "PhysX3ExtensionsCHECKED",
  560. "PhysXProfileSDKCHECKED",
  561. "PhysXVisualDebuggerSDKCHECKED",
  562. "PxTaskCHECKED"
  563. }
  564. configuration { "vs*", "development" }
  565. links {
  566. "PhysX3ExtensionsPROFILE",
  567. "PhysXProfileSDKPROFILE",
  568. "PhysXVisualDebuggerSDKPROFILE",
  569. "PxTaskPROFILE"
  570. }
  571. configuration { "vs*", "release" }
  572. links {
  573. "PhysX3Extensions",
  574. "PhysXProfileSDK",
  575. "PhysXVisualDebuggerSDK",
  576. "PxTask",
  577. }
  578. configuration { "x32", "vs*" }
  579. includedirs {
  580. CROWN_THIRD_DIR .. "luajit/win32/include/luajit-2.0",
  581. CROWN_THIRD_DIR .. "physx/win32/include",
  582. CROWN_THIRD_DIR .. "physx/win32/include/common",
  583. CROWN_THIRD_DIR .. "physx/win32/include/characterkinematic",
  584. CROWN_THIRD_DIR .. "physx/win32/include/cloth",
  585. CROWN_THIRD_DIR .. "physx/win32/include/common",
  586. CROWN_THIRD_DIR .. "physx/win32/include/cooking",
  587. CROWN_THIRD_DIR .. "physx/win32/include/extensions",
  588. CROWN_THIRD_DIR .. "physx/win32/include/foundation",
  589. CROWN_THIRD_DIR .. "physx/win32/include/geometry",
  590. CROWN_THIRD_DIR .. "physx/win32/include/particles",
  591. CROWN_THIRD_DIR .. "physx/win32/include/physxprofilesdk",
  592. CROWN_THIRD_DIR .. "physx/win32/include/physxvisualdebuggersdk",
  593. CROWN_THIRD_DIR .. "physx/win32/include/pvd",
  594. CROWN_THIRD_DIR .. "physx/win32/include/pxtask",
  595. CROWN_THIRD_DIR .. "physx/win32/include/RepX",
  596. CROWN_THIRD_DIR .. "physx/win32/include/RepXUpgrader",
  597. CROWN_THIRD_DIR .. "physx/win32/include/vehicle",
  598. CROWN_THIRD_DIR .. "opengl",
  599. CROWN_THIRD_DIR .. "openal/include",
  600. CROWN_THIRD_DIR .. "freetype",
  601. CROWN_THIRD_DIR .. "stb_image",
  602. CROWN_THIRD_DIR .. "stb_vorbis"
  603. }
  604. libdirs {
  605. CROWN_THIRD_DIR .. "luajit/win32/lib",
  606. CROWN_THIRD_DIR .. "physx/win32/lib"
  607. }
  608. configuration { "x64", "vs*" }
  609. defines { "_WIN64" }
  610. includedirs {
  611. CROWN_THIRD_DIR .. "luajit/win64/include/luajit-2.0",
  612. CROWN_THIRD_DIR .. "physx/win64/include",
  613. CROWN_THIRD_DIR .. "physx/win64/include/common",
  614. CROWN_THIRD_DIR .. "physx/win64/include/characterkinematic",
  615. CROWN_THIRD_DIR .. "physx/win64/include/cloth",
  616. CROWN_THIRD_DIR .. "physx/win64/include/common",
  617. CROWN_THIRD_DIR .. "physx/win64/include/cooking",
  618. CROWN_THIRD_DIR .. "physx/win64/include/extensions",
  619. CROWN_THIRD_DIR .. "physx/win64/include/foundation",
  620. CROWN_THIRD_DIR .. "physx/win64/include/geometry",
  621. CROWN_THIRD_DIR .. "physx/win64/include/particles",
  622. CROWN_THIRD_DIR .. "physx/win64/include/physxprofilesdk",
  623. CROWN_THIRD_DIR .. "physx/win64/include/physxvisualdebuggersdk",
  624. CROWN_THIRD_DIR .. "physx/win64/include/pvd",
  625. CROWN_THIRD_DIR .. "physx/win64/include/pxtask",
  626. CROWN_THIRD_DIR .. "physx/win64/include/RepX",
  627. CROWN_THIRD_DIR .. "physx/win64/include/RepXUpgrader",
  628. CROWN_THIRD_DIR .. "physx/win64/include/vehicle",
  629. CROWN_THIRD_DIR .. "opengl",
  630. CROWN_THIRD_DIR .. "openal/include",
  631. CROWN_THIRD_DIR .. "freetype",
  632. CROWN_THIRD_DIR .. "stb_image",
  633. CROWN_THIRD_DIR .. "stb_vorbis"
  634. }
  635. libdirs {
  636. CROWN_THIRD_DIR .. "luajit/win64/lib",
  637. CROWN_THIRD_DIR .. "physx/win64/lib"
  638. }
  639. configuration { "debug", "x32", "vs*"}
  640. links {
  641. "PhysX3CharacterKinematicCHECKED_x86",
  642. "PhysX3CHECKED_x86",
  643. "PhysX3CommonCHECKED_x86",
  644. "PhysX3CookingCHECKED_x86"
  645. }
  646. configuration { "debug", "x64", "vs*" }
  647. links {
  648. "PhysX3CharacterKinematicCHECKED_x64",
  649. "PhysX3CHECKED_x64",
  650. "PhysX3CommonCHECKED_x64",
  651. "PhysX3CookingCHECKED_x64"
  652. }
  653. configuration { "development", "x32", "vs*" }
  654. links {
  655. "PhysX3CharacterKinematicPROFILE_x86",
  656. "PhysX3PROFILE_x86",
  657. "PhysX3CommonPROFILE_x86",
  658. "PhysX3CookingPROFILE_x86"
  659. }
  660. configuration { "development", "x64", "vs*" }
  661. links {
  662. "PhysX3CharacterKinematicPROFILE_x64",
  663. "PhysX3PROFILE_x64",
  664. "PhysX3CommonPROFILE_x64",
  665. "PhysX3CookingPROFILE_x64"
  666. }
  667. configuration { "debug", "x32", "vs*" }
  668. links {
  669. "PhysX3CharacterKinematic_x86",
  670. "PhysX3_x86",
  671. "PhysX3Common_x86",
  672. "PhysX3Cooking_x86"
  673. }
  674. configuration { "debug", "x64", "vs*" }
  675. links {
  676. "PhysX3CharacterKinematic_x64",
  677. "PhysX3_x64",
  678. "PhysX3Common_x64",
  679. "PhysX3Cooking_x64"
  680. }