premake4.lua 19 KB

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