premake4.lua 19 KB

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