premake4.lua 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697
  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/backend/sles_sound_world.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. ":libbgfxRelease.a",
  373. "android",
  374. "c",
  375. "dl",
  376. "EGL",
  377. "gcc",
  378. "GLESv2",
  379. "gnustl_static",
  380. "log",
  381. "m",
  382. "OpenSLES"
  383. }
  384. includedirs {
  385. CROWN_THIRD_DIR .. "luajit/src",
  386. CROWN_THIRD_DIR .. "bgfx/include",
  387. CROWN_THIRD_DIR .. "bx/include",
  388. CROWN_THIRD_DIR .. "openal/include",
  389. CROWN_THIRD_DIR .. "freetype",
  390. CROWN_THIRD_DIR .. "stb_image",
  391. CROWN_THIRD_DIR .. "stb_vorbis",
  392. "$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.8/include",
  393. "$(ANDROID_NDK_ROOT)/sources/android/native_app_glue",
  394. "$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a/include",
  395. "$(PHYSX_SDK_ANDROID)/Include",
  396. "$(PHYSX_SDK_ANDROID)/Include/common",
  397. "$(PHYSX_SDK_ANDROID)/Include/characterkinematic",
  398. "$(PHYSX_SDK_ANDROID)/Include/cloth",
  399. "$(PHYSX_SDK_ANDROID)/Include/common",
  400. "$(PHYSX_SDK_ANDROID)/Include/cooking",
  401. "$(PHYSX_SDK_ANDROID)/Include/extensions",
  402. "$(PHYSX_SDK_ANDROID)/Include/foundation",
  403. "$(PHYSX_SDK_ANDROID)/Include/geometry",
  404. "$(PHYSX_SDK_ANDROID)/Include/particles",
  405. "$(PHYSX_SDK_ANDROID)/Include/physxprofilesdk",
  406. "$(PHYSX_SDK_ANDROID)/Include/physxvisualdebuggersdk",
  407. "$(PHYSX_SDK_ANDROID)/Include/pvd",
  408. "$(PHYSX_SDK_ANDROID)/Include/pxtask",
  409. "$(PHYSX_SDK_ANDROID)/Include/RepX",
  410. "$(PHYSX_SDK_ANDROID)/Include/RepXUpgrader",
  411. "$(PHYSX_SDK_ANDROID)/Include/vehicle",
  412. }
  413. libdirs {
  414. CROWN_THIRD_DIR .. "luajit/src",
  415. CROWN_THIRD_DIR .. "bgfx/.build/android-arm/bin",
  416. "$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a",
  417. "$(ANDROID_NDK_ROOT)/platforms/android-14/arch-arm/usr/lib",
  418. "$(PHYSX_SDK_ANDROID)/Lib/android9_neon",
  419. }
  420. excludes {
  421. CROWN_SOURCE_DIR .. "engine/audio/backend/al_sound_world.cpp"
  422. }
  423. configuration { "debug", "android" }
  424. linkoptions {
  425. "-Wl,--start-group $(addprefix -l," ..
  426. " LowLevelCloth" ..
  427. " PhysX3 " ..
  428. " PhysX3Common" ..
  429. " PxTask" ..
  430. " LowLevel" ..
  431. " PhysX3CharacterKinematic" ..
  432. " PhysX3Cooking" ..
  433. " PhysX3Extensions" ..
  434. " PhysX3Vehicle" ..
  435. " PhysXProfileSDK" ..
  436. " PhysXVisualDebuggerSDK" ..
  437. " PvdRuntime" ..
  438. " SceneQuery" ..
  439. " SimulationController" ..
  440. ") -Wl,--end-group"
  441. }
  442. configuration { "development", "android"}
  443. linkoptions {
  444. "-Wl,--start-group $(addprefix -l," ..
  445. " LowLevelCloth" ..
  446. " PhysX3 " ..
  447. " PhysX3Common" ..
  448. " PxTask" ..
  449. " LowLevel" ..
  450. " PhysX3CharacterKinematic" ..
  451. " PhysX3Cooking" ..
  452. " PhysX3Extensions" ..
  453. " PhysX3Vehicle" ..
  454. " PhysXProfileSDK" ..
  455. " PhysXVisualDebuggerSDK" ..
  456. " PvdRuntime" ..
  457. " SceneQuery" ..
  458. " SimulationController" ..
  459. ") -Wl,--end-group"
  460. }
  461. configuration { "release", "android"}
  462. linkoptions {
  463. "-Wl,--start-group $(addprefix -l," ..
  464. " LowLevelCloth" ..
  465. " PhysX3 " ..
  466. " PhysX3Common" ..
  467. " PxTask" ..
  468. " LowLevel" ..
  469. " PhysX3CharacterKinematic" ..
  470. " PhysX3Cooking" ..
  471. " PhysX3Extensions" ..
  472. " PhysX3Vehicle" ..
  473. " PhysXProfileSDK" ..
  474. " PhysXVisualDebuggerSDK" ..
  475. " PvdRuntime" ..
  476. " SceneQuery" ..
  477. " SimulationController" ..
  478. ") -Wl,--end-group"
  479. }
  480. configuration { "vs*" }
  481. kind "ConsoleApp"
  482. targetdir (CROWN_INSTALL_DIR .. "windows")
  483. linkoptions {
  484. "/ignore:4199", -- LNK4199: /DELAYLOAD:*.dll ignored; no imports found from *.dll
  485. "/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
  486. }
  487. defines {
  488. "WIN32",
  489. "_WIN32",
  490. "_HAS_EXCEPTIONS=0",
  491. "_HAS_ITERATOR_DEBUGGING=0",
  492. "_SCL_SECURE=0",
  493. "_SECURE_SCL=0",
  494. "_SCL_SECURE_NO_WARNINGS",
  495. "_CRT_SECURE_NO_WARNINGS",
  496. "_CRT_SECURE_NO_DEPRECATE"
  497. }
  498. buildoptions {
  499. "/Oy-", -- Suppresses creation of frame pointers on the call stack.
  500. "/Ob2", -- The Inline Function Expansion
  501. }
  502. links {
  503. "OpenGL32",
  504. "lua51",
  505. "OpenAL32"
  506. }
  507. includedirs {
  508. CROWN_SOURCE_DIR .. "core/compat/msvc",
  509. CROWN_THIRD_DIR .. "luajit/src",
  510. CROWN_THIRD_DIR .. "openal/include",
  511. CROWN_THIRD_DIR .. "freetype",
  512. CROWN_THIRD_DIR .. "stb_image",
  513. CROWN_THIRD_DIR .. "stb_vorbis",
  514. CROWN_THIRD_DIR .. "bgfx/src",
  515. CROWN_THIRD_DIR .. "bgfx/include",
  516. CROWN_THIRD_DIR .. "bx/include",
  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. "$(DXSDK_DIR)/Include",
  535. }
  536. excludes {
  537. CROWN_SOURCE_DIR .. "engine/audio/backend/sles_sound_world.cpp"
  538. }
  539. configuration { "x32", "vs*" }
  540. libdirs {
  541. CROWN_THIRD_DIR .. "luajit/src",
  542. CROWN_THIRD_DIR .. "openal/lib",
  543. CROWN_THIRD_DIR .. "bgfx/.build/win32_vs2012/bin",
  544. "$(PHYSX_SDK_WINDOWS)/Lib/win32",
  545. "$(DXSDK_DIR)/Lib/x86",
  546. }
  547. configuration { "x64", "vs*" }
  548. defines { "_WIN64" }
  549. libdirs {
  550. CROWN_THIRD_DIR .. "luajit/src",
  551. CROWN_THIRD_DIR .. "openal/lib",
  552. CROWN_THIRD_DIR .. "bgfx/.build/win64_vs2012/bin",
  553. "$(PHYSX_SDK_WINDOWS)/Lib/win64",
  554. "$(DXSDK_DIR)/Lib/x64",
  555. }
  556. configuration { "debug", "x32", "vs*"}
  557. links {
  558. "PhysX3CharacterKinematicCHECKED_x86",
  559. "PhysX3CHECKED_x86",
  560. "PhysX3CommonCHECKED_x86",
  561. "PhysX3CookingCHECKED_x86",
  562. "PhysX3ExtensionsCHECKED",
  563. "bgfxDebug"
  564. }
  565. configuration { "debug", "x64", "vs*" }
  566. links {
  567. "PhysX3CharacterKinematicCHECKED_x64",
  568. "PhysX3CHECKED_x64",
  569. "PhysX3CommonCHECKED_x64",
  570. "PhysX3CookingCHECKED_x64",
  571. "PhysX3ExtensionsCHECKED",
  572. "bgfxDebug"
  573. }
  574. configuration { "development", "x32", "vs*" }
  575. links {
  576. "PhysX3CharacterKinematicPROFILE_x86",
  577. "PhysX3PROFILE_x86",
  578. "PhysX3CommonPROFILE_x86",
  579. "PhysX3CookingPROFILE_x86",
  580. "PhysX3ExtensionsPROFILE",
  581. "bgfxDebug"
  582. }
  583. configuration { "development", "x64", "vs*" }
  584. links {
  585. "PhysX3CharacterKinematicPROFILE_x64",
  586. "PhysX3PROFILE_x64",
  587. "PhysX3CommonPROFILE_x64",
  588. "PhysX3CookingPROFILE_x64",
  589. "PhysX3ExtensionsPROFILE",
  590. "bgfxDebug"
  591. }
  592. configuration { "release", "x32", "vs*" }
  593. links {
  594. "PhysX3CharacterKinematic_x86",
  595. "PhysX3_x86",
  596. "PhysX3Common_x86",
  597. "PhysX3Cooking_x86",
  598. "PhysX3Extensions",
  599. "bgfxRelease"
  600. }
  601. configuration { "release", "x64", "vs*" }
  602. links {
  603. "PhysX3CharacterKinematic_x64",
  604. "PhysX3_x64",
  605. "PhysX3Common_x64",
  606. "PhysX3Cooking_x64",
  607. "PhysX3Extensions",
  608. "bgfxRelease"
  609. }