premake4.lua 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699
  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/memory",
  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. configuration { "linux-*", "debug" }
  210. buildoptions {
  211. "-O0"
  212. }
  213. links {
  214. "bgfxDebug"
  215. }
  216. linkoptions {
  217. "-rdynamic",
  218. "-Wl,--start-group $(addprefix -l," ..
  219. " LowLevelClothCHECKED" ..
  220. " PhysX3CHECKED " ..
  221. " PhysX3CommonCHECKED" ..
  222. " PxTaskCHECKED" ..
  223. " LowLevelCHECKED" ..
  224. " PhysX3CharacterKinematicCHECKED" ..
  225. " PhysX3CookingCHECKED" ..
  226. " PhysX3ExtensionsCHECKED" ..
  227. " PhysX3VehicleCHECKED" ..
  228. " PhysXProfileSDKCHECKED" ..
  229. " PhysXVisualDebuggerSDKCHECKED" ..
  230. " PvdRuntimeCHECKED" ..
  231. " SceneQueryCHECKED" ..
  232. " SimulationControllerCHECKED" ..
  233. ") -Wl,--end-group"
  234. }
  235. configuration { "linux-*", "development" }
  236. buildoptions {
  237. "-O2"
  238. }
  239. links {
  240. "bgfxDebug"
  241. }
  242. linkoptions
  243. {
  244. "-rdynamic",
  245. "-Wl,--start-group $(addprefix -l," ..
  246. " LowLevelClothPROFILE" ..
  247. " PhysX3PROFILE " ..
  248. " PhysX3CommonPROFILE" ..
  249. " PxTaskPROFILE" ..
  250. " LowLevelPROFILE" ..
  251. " PhysX3CharacterKinematicPROFILE" ..
  252. " PhysX3CookingPROFILE" ..
  253. " PhysX3ExtensionsPROFILE" ..
  254. " PhysX3VehiclePROFILE" ..
  255. " PhysXProfileSDKPROFILE" ..
  256. " PhysXVisualDebuggerSDKPROFILE" ..
  257. " PvdRuntimePROFILE" ..
  258. " SceneQueryPROFILE" ..
  259. " SimulationControllerPROFILE" ..
  260. ") -Wl,--end-group"
  261. }
  262. configuration { "linux-*", "release" }
  263. buildoptions {
  264. "-O2"
  265. }
  266. links {
  267. "bgfxRelease"
  268. }
  269. linkoptions {
  270. "-Wl,--start-group $(addprefix -l," ..
  271. " LowLevelCloth" ..
  272. " PhysX3 " ..
  273. " PhysX3Common" ..
  274. " PxTask" ..
  275. " LowLevel" ..
  276. " PhysX3CharacterKinematic" ..
  277. " PhysX3Cooking" ..
  278. " PhysX3Extensions" ..
  279. " PhysX3Vehicle" ..
  280. " PhysXProfileSDK" ..
  281. " PhysXVisualDebuggerSDK" ..
  282. " PvdRuntime" ..
  283. " SceneQuery" ..
  284. " SimulationController" ..
  285. ") -Wl,--end-group"
  286. }
  287. configuration { "linux-*", "x32" }
  288. targetdir(CROWN_INSTALL_DIR .. "bin/linux32")
  289. buildoptions {
  290. "-malign-double" -- Required by PhysX
  291. }
  292. libdirs {
  293. CROWN_THIRD_DIR .. "luajit/src",
  294. CROWN_THIRD_DIR .. "bgfx/.build/linux32_gcc/bin",
  295. "$(PHYSX_SDK_LINUX)/Lib/linux32"
  296. }
  297. postbuildcommands {
  298. "cp " .. CROWN_THIRD_DIR .. "luajit/src/luajit " .. CROWN_INSTALL_DIR .. "bin/linux32/",
  299. "cp " .. CROWN_THIRD_DIR .. "luajit/src/jit " .. CROWN_INSTALL_DIR .. "bin/linux32/" .. " -r",
  300. }
  301. configuration { "linux-*", "x64" }
  302. targetdir(CROWN_INSTALL_DIR .. "bin/linux64")
  303. libdirs {
  304. CROWN_THIRD_DIR .. "luajit/src",
  305. CROWN_THIRD_DIR .. "bgfx/.build/linux64_gcc/bin",
  306. "$(PHYSX_SDK_LINUX)/Lib/linux64"
  307. }
  308. postbuildcommands {
  309. "cp " .. CROWN_THIRD_DIR .. "luajit/src/luajit " .. CROWN_INSTALL_DIR .. "bin/linux64/",
  310. "cp " .. CROWN_THIRD_DIR .. "luajit/src/jit " .. CROWN_INSTALL_DIR .. "bin/linux64/" .. " -r",
  311. }
  312. configuration { "debug or development", "x32", "linux-*" }
  313. postbuildcommands {
  314. "cp " .. CROWN_THIRD_DIR .. "bgfx/.build/linux32_gcc/bin/shadercDebug " .. CROWN_INSTALL_DIR .. "bin/linux32/shaderc"
  315. }
  316. configuration { "release", "x32", "linux-*" }
  317. postbuildcommands {
  318. "cp " .. CROWN_THIRD_DIR .. "bgfx/.build/linux32_gcc/bin/shadercRelease " .. CROWN_INSTALL_DIR .. "bin/linux32/shaderc"
  319. }
  320. configuration { "debug or development", "x64", "linux-*" }
  321. postbuildcommands {
  322. "cp " .. CROWN_THIRD_DIR .. "bgfx/.build/linux64_gcc/bin/shadercDebug " .. CROWN_INSTALL_DIR .. "bin/linux64/shaderc"
  323. }
  324. configuration { "release", "x64", "linux-*" }
  325. postbuildcommands {
  326. "cp " .. CROWN_THIRD_DIR .. "bgfx/.build/linux64_gcc/bin/shadercRelease " .. CROWN_INSTALL_DIR .. "bin/linux64/shaderc"
  327. }
  328. configuration { "android" }
  329. kind "ConsoleApp"
  330. targetprefix "lib"
  331. targetextension ".so"
  332. targetdir(CROWN_INSTALL_DIR .. "bin/android") -- must be specified by user -- tmp
  333. flags { "NoImportLib" }
  334. defines {
  335. "__STDC_FORMAT_MACROS",
  336. "__STDC_CONSTANT_MACROS",
  337. "__STDC_LIMIT_MACROS"
  338. }
  339. buildoptions {
  340. "--sysroot=$(ANDROID_NDK_ROOT)/platforms/android-14/arch-arm",
  341. "-ffunction-sections",
  342. "-fPIC",
  343. "-march=armv7-a",
  344. "-mfloat-abi=softfp",
  345. "-mthumb",
  346. "-no-canonical-prefixes",
  347. "-std=c++03",
  348. "-Wno-psabi", -- note: the mangling of 'va_list' has changed in GCC 4.4.0
  349. "-no-canonical-prefixes",
  350. "-fstack-protector",
  351. "-mfpu=neon",
  352. "-Wa,--noexecstack",
  353. }
  354. linkoptions {
  355. "-shared",
  356. "-nostdlib",
  357. "-static-libgcc",
  358. "--sysroot=$(ANDROID_NDK_ROOT)/platforms/android-14/arch-arm",
  359. "$(ANDROID_NDK_ROOT)/platforms/android-14/arch-arm/usr/lib/crtbegin_so.o",
  360. "$(ANDROID_NDK_ROOT)/platforms/android-14/arch-arm/usr/lib/crtend_so.o",
  361. "-no-canonical-prefixes",
  362. "-Wl,--no-undefined",
  363. "-Wl,-z,noexecstack",
  364. "-Wl,-z,relro",
  365. "-Wl,-z,now",
  366. "-march=armv7-a",
  367. "-Wl,--fix-cortex-a8",
  368. }
  369. links {
  370. ":libluajit.a",
  371. "android",
  372. "c",
  373. "dl",
  374. "EGL",
  375. "gcc",
  376. "GLESv2",
  377. "gnustl_static",
  378. "log",
  379. "m",
  380. "OpenSLES"
  381. }
  382. includedirs {
  383. CROWN_THIRD_DIR .. "luajit/src",
  384. CROWN_THIRD_DIR .. "bgfx/include",
  385. CROWN_THIRD_DIR .. "bx/include",
  386. CROWN_THIRD_DIR .. "openal/include",
  387. CROWN_THIRD_DIR .. "freetype",
  388. CROWN_THIRD_DIR .. "stb_image",
  389. CROWN_THIRD_DIR .. "stb_vorbis",
  390. "$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.8/include",
  391. "$(ANDROID_NDK_ROOT)/sources/android/native_app_glue",
  392. "$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a/include",
  393. "$(PHYSX_SDK_ANDROID)/Include",
  394. "$(PHYSX_SDK_ANDROID)/Include/common",
  395. "$(PHYSX_SDK_ANDROID)/Include/characterkinematic",
  396. "$(PHYSX_SDK_ANDROID)/Include/cloth",
  397. "$(PHYSX_SDK_ANDROID)/Include/common",
  398. "$(PHYSX_SDK_ANDROID)/Include/cooking",
  399. "$(PHYSX_SDK_ANDROID)/Include/extensions",
  400. "$(PHYSX_SDK_ANDROID)/Include/foundation",
  401. "$(PHYSX_SDK_ANDROID)/Include/geometry",
  402. "$(PHYSX_SDK_ANDROID)/Include/particles",
  403. "$(PHYSX_SDK_ANDROID)/Include/physxprofilesdk",
  404. "$(PHYSX_SDK_ANDROID)/Include/physxvisualdebuggersdk",
  405. "$(PHYSX_SDK_ANDROID)/Include/pvd",
  406. "$(PHYSX_SDK_ANDROID)/Include/pxtask",
  407. "$(PHYSX_SDK_ANDROID)/Include/RepX",
  408. "$(PHYSX_SDK_ANDROID)/Include/RepXUpgrader",
  409. "$(PHYSX_SDK_ANDROID)/Include/vehicle",
  410. }
  411. libdirs {
  412. CROWN_THIRD_DIR .. "luajit/src",
  413. CROWN_THIRD_DIR .. "bgfx/.build/android-arm/bin",
  414. "$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a",
  415. "$(ANDROID_NDK_ROOT)/platforms/android-14/arch-arm/usr/lib",
  416. "$(PHYSX_SDK_ANDROID)/Lib/android9_neon",
  417. }
  418. configuration { "debug", "android" }
  419. links {
  420. ":libbgfxDebug.a",
  421. }
  422. linkoptions {
  423. "-Wl,--start-group $(addprefix -l," ..
  424. " LowLevelCloth" ..
  425. " PhysX3 " ..
  426. " PhysX3Common" ..
  427. " PxTask" ..
  428. " LowLevel" ..
  429. " PhysX3CharacterKinematic" ..
  430. " PhysX3Cooking" ..
  431. " PhysX3Extensions" ..
  432. " PhysX3Vehicle" ..
  433. " PhysXProfileSDK" ..
  434. " PhysXVisualDebuggerSDK" ..
  435. " PvdRuntime" ..
  436. " SceneQuery" ..
  437. " SimulationController" ..
  438. ") -Wl,--end-group"
  439. }
  440. configuration { "development", "android"}
  441. links {
  442. ":libbgfxDebug.a",
  443. }
  444. linkoptions {
  445. "-Wl,--start-group $(addprefix -l," ..
  446. " LowLevelCloth" ..
  447. " PhysX3 " ..
  448. " PhysX3Common" ..
  449. " PxTask" ..
  450. " LowLevel" ..
  451. " PhysX3CharacterKinematic" ..
  452. " PhysX3Cooking" ..
  453. " PhysX3Extensions" ..
  454. " PhysX3Vehicle" ..
  455. " PhysXProfileSDK" ..
  456. " PhysXVisualDebuggerSDK" ..
  457. " PvdRuntime" ..
  458. " SceneQuery" ..
  459. " SimulationController" ..
  460. ") -Wl,--end-group"
  461. }
  462. configuration { "release", "android"}
  463. links {
  464. ":libbgfxRelease.a",
  465. }
  466. linkoptions {
  467. "-Wl,--start-group $(addprefix -l," ..
  468. " LowLevelCloth" ..
  469. " PhysX3 " ..
  470. " PhysX3Common" ..
  471. " PxTask" ..
  472. " LowLevel" ..
  473. " PhysX3CharacterKinematic" ..
  474. " PhysX3Cooking" ..
  475. " PhysX3Extensions" ..
  476. " PhysX3Vehicle" ..
  477. " PhysXProfileSDK" ..
  478. " PhysXVisualDebuggerSDK" ..
  479. " PvdRuntime" ..
  480. " SceneQuery" ..
  481. " SimulationController" ..
  482. ") -Wl,--end-group"
  483. }
  484. configuration { "vs*" }
  485. kind "ConsoleApp"
  486. targetdir (CROWN_INSTALL_DIR .. "windows")
  487. linkoptions {
  488. "/ignore:4199", -- LNK4199: /DELAYLOAD:*.dll ignored; no imports found from *.dll
  489. "/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
  490. }
  491. defines {
  492. "WIN32",
  493. "_WIN32",
  494. "_HAS_EXCEPTIONS=0",
  495. "_HAS_ITERATOR_DEBUGGING=0",
  496. "_SCL_SECURE=0",
  497. "_SECURE_SCL=0",
  498. "_SCL_SECURE_NO_WARNINGS",
  499. "_CRT_SECURE_NO_WARNINGS",
  500. "_CRT_SECURE_NO_DEPRECATE"
  501. }
  502. buildoptions {
  503. "/Oy-", -- Suppresses creation of frame pointers on the call stack.
  504. "/Ob2", -- The Inline Function Expansion
  505. }
  506. links {
  507. "OpenGL32",
  508. "lua51",
  509. "OpenAL32",
  510. "dbghelp"
  511. }
  512. includedirs {
  513. CROWN_SOURCE_DIR .. "core/compat/msvc",
  514. CROWN_THIRD_DIR .. "luajit/src",
  515. CROWN_THIRD_DIR .. "openal/include",
  516. CROWN_THIRD_DIR .. "freetype",
  517. CROWN_THIRD_DIR .. "stb_image",
  518. CROWN_THIRD_DIR .. "stb_vorbis",
  519. CROWN_THIRD_DIR .. "bgfx/src",
  520. CROWN_THIRD_DIR .. "bgfx/include",
  521. CROWN_THIRD_DIR .. "bx/include",
  522. "$(PHYSX_SDK_WINDOWS)/Include",
  523. "$(PHYSX_SDK_WINDOWS)/Include/common",
  524. "$(PHYSX_SDK_WINDOWS)/Include/characterkinematic",
  525. "$(PHYSX_SDK_WINDOWS)/Include/cloth",
  526. "$(PHYSX_SDK_WINDOWS)/Include/common",
  527. "$(PHYSX_SDK_WINDOWS)/Include/cooking",
  528. "$(PHYSX_SDK_WINDOWS)/Include/extensions",
  529. "$(PHYSX_SDK_WINDOWS)/Include/foundation",
  530. "$(PHYSX_SDK_WINDOWS)/Include/geometry",
  531. "$(PHYSX_SDK_WINDOWS)/Include/particles",
  532. "$(PHYSX_SDK_WINDOWS)/Include/physxprofilesdk",
  533. "$(PHYSX_SDK_WINDOWS)/Include/physxvisualdebuggersdk",
  534. "$(PHYSX_SDK_WINDOWS)/Include/pvd",
  535. "$(PHYSX_SDK_WINDOWS)/Include/pxtask",
  536. "$(PHYSX_SDK_WINDOWS)/Include/RepX",
  537. "$(PHYSX_SDK_WINDOWS)/Include/RepXUpgrader",
  538. "$(PHYSX_SDK_WINDOWS)/Include/vehicle",
  539. "$(DXSDK_DIR)/Include",
  540. }
  541. configuration { "x32", "vs*" }
  542. libdirs {
  543. CROWN_THIRD_DIR .. "luajit/src",
  544. CROWN_THIRD_DIR .. "openal/lib",
  545. CROWN_THIRD_DIR .. "bgfx/.build/win32_vs2012/bin",
  546. "$(PHYSX_SDK_WINDOWS)/Lib/win32",
  547. "$(DXSDK_DIR)/Lib/x86",
  548. }
  549. configuration { "x64", "vs*" }
  550. defines { "_WIN64" }
  551. libdirs {
  552. CROWN_THIRD_DIR .. "luajit/src",
  553. CROWN_THIRD_DIR .. "openal/lib",
  554. CROWN_THIRD_DIR .. "bgfx/.build/win64_vs2012/bin",
  555. "$(PHYSX_SDK_WINDOWS)/Lib/win64",
  556. "$(DXSDK_DIR)/Lib/x64",
  557. }
  558. configuration { "debug", "x32", "vs*"}
  559. links {
  560. "PhysX3CharacterKinematicCHECKED_x86",
  561. "PhysX3CHECKED_x86",
  562. "PhysX3CommonCHECKED_x86",
  563. "PhysX3CookingCHECKED_x86",
  564. "PhysX3ExtensionsCHECKED",
  565. "bgfxDebug"
  566. }
  567. configuration { "debug", "x64", "vs*" }
  568. links {
  569. "PhysX3CharacterKinematicCHECKED_x64",
  570. "PhysX3CHECKED_x64",
  571. "PhysX3CommonCHECKED_x64",
  572. "PhysX3CookingCHECKED_x64",
  573. "PhysX3ExtensionsCHECKED",
  574. "bgfxDebug"
  575. }
  576. configuration { "development", "x32", "vs*" }
  577. links {
  578. "PhysX3CharacterKinematicPROFILE_x86",
  579. "PhysX3PROFILE_x86",
  580. "PhysX3CommonPROFILE_x86",
  581. "PhysX3CookingPROFILE_x86",
  582. "PhysX3ExtensionsPROFILE",
  583. "bgfxDebug"
  584. }
  585. configuration { "development", "x64", "vs*" }
  586. links {
  587. "PhysX3CharacterKinematicPROFILE_x64",
  588. "PhysX3PROFILE_x64",
  589. "PhysX3CommonPROFILE_x64",
  590. "PhysX3CookingPROFILE_x64",
  591. "PhysX3ExtensionsPROFILE",
  592. "bgfxDebug"
  593. }
  594. configuration { "release", "x32", "vs*" }
  595. links {
  596. "PhysX3CharacterKinematic_x86",
  597. "PhysX3_x86",
  598. "PhysX3Common_x86",
  599. "PhysX3Cooking_x86",
  600. "PhysX3Extensions",
  601. "bgfxRelease"
  602. }
  603. configuration { "release", "x64", "vs*" }
  604. links {
  605. "PhysX3CharacterKinematic_x64",
  606. "PhysX3_x64",
  607. "PhysX3Common_x64",
  608. "PhysX3Cooking_x64",
  609. "PhysX3Extensions",
  610. "bgfxRelease"
  611. }