premake4.lua 19 KB

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