premake4.lua 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  1. solution "0_Bullet3Solution"
  2. local osversion = os.getversion()
  3. print(string.format(" %d.%d.%d (%s)",
  4. osversion.majorversion, osversion.minorversion, osversion.revision,
  5. osversion.description))
  6. if _ACTION == "vs2010" or _ACTION=="vs2008" then
  7. buildoptions
  8. {
  9. -- Multithreaded compiling
  10. "/MP",
  11. -- Disable a few useless warnings
  12. "/wd4244",
  13. "/wd4267"
  14. }
  15. end
  16. act = ""
  17. if _ACTION then
  18. act = _ACTION
  19. end
  20. newoption {
  21. trigger = "ios",
  22. description = "Enable iOS target (requires xcode4)"
  23. }
  24. newoption
  25. {
  26. trigger = "enable_system_opengl",
  27. description = "Try to link and use the system OpenGL headers version instead of dynamically loading OpenGL (dlopen is default)"
  28. }
  29. newoption
  30. {
  31. trigger = "enable_openvr",
  32. description = "Enable experimental Virtual Reality examples, using OpenVR for HTC Vive and Oculus Rift"
  33. }
  34. newoption
  35. {
  36. trigger = "enable_system_x11",
  37. description = "Try to link and use system X11 headers instead of dynamically loading X11 (dlopen is default)"
  38. }
  39. newoption
  40. {
  41. trigger = "noopengl3",
  42. description = "Don't compile any OpenGL3+ code"
  43. }
  44. newoption
  45. {
  46. trigger = "midi",
  47. description = "Use Midi controller to control parameters"
  48. }
  49. -- --_OPTIONS["midi"] = "1";
  50. newoption
  51. {
  52. trigger = "no-demos",
  53. description = "Don't build demos"
  54. }
  55. newoption
  56. {
  57. trigger = "no-extras",
  58. description = "Don't build Extras"
  59. }
  60. newoption
  61. {
  62. trigger = "enet",
  63. description = "Enable enet NAT punchthrough test"
  64. }
  65. newoption
  66. {
  67. trigger = "lua",
  68. description = "Enable Lua scipting support in Example Browser"
  69. }
  70. newoption
  71. {
  72. trigger = "enable_pybullet",
  73. description = "Enable high-level Python scripting of Bullet with URDF/SDF import and synthetic camera."
  74. }
  75. if os.is("Linux") then
  76. default_python_include_dir = "/usr/include/python2.7"
  77. default_python_lib_dir = "/usr/local/lib/"
  78. end
  79. if os.is("Windows") then
  80. default_python_include_dir = "C:/Python-3.5.2/include"
  81. default_python_lib_dir = "C:/Python-3.5.2/libs"
  82. end
  83. newoption
  84. {
  85. trigger = "python_include_dir",
  86. value = default_python_include_dir,
  87. description = "Python (2.x or 3.x) include directory"
  88. }
  89. newoption
  90. {
  91. trigger = "python_lib_dir",
  92. value = default_python_lib_dir,
  93. description = "Python (2.x or 3.x) library directory "
  94. }
  95. newoption {
  96. trigger = "targetdir",
  97. value = "path such as ../bin",
  98. description = "Set the output location for the generated project files"
  99. }
  100. newoption
  101. {
  102. trigger = "no-test",
  103. description = "Disable all tests"
  104. }
  105. newoption
  106. {
  107. trigger = "no-gtest",
  108. description = "Disable unit tests using gtest"
  109. }
  110. newoption
  111. {
  112. trigger = "no-bullet3",
  113. description = "Do not build bullet3 libs"
  114. }
  115. newoption
  116. {
  117. trigger = "double",
  118. description = "Double precision version of Bullet"
  119. }
  120. if _OPTIONS["double"] then
  121. defines {"BT_USE_DOUBLE_PRECISION"}
  122. end
  123. configurations {"Release", "Debug"}
  124. configuration "Release"
  125. flags { "Optimize", "EnableSSE2","StaticRuntime", "NoMinimalRebuild", "FloatFast"}
  126. configuration "Debug"
  127. defines {"_DEBUG=1"}
  128. flags { "Symbols", "StaticRuntime" , "NoMinimalRebuild", "NoEditAndContinue" ,"FloatFast"}
  129. if os.is("Linux") or os.is("macosx") then
  130. if os.is64bit() then
  131. platforms {"x64"}
  132. else
  133. platforms {"x32"}
  134. end
  135. else
  136. platforms {"x32","x64"}
  137. end
  138. configuration {"x32"}
  139. targetsuffix ("_" .. act)
  140. configuration "x64"
  141. targetsuffix ("_" .. act .. "_64" )
  142. configuration {"x64", "debug"}
  143. targetsuffix ("_" .. act .. "_x64_debug")
  144. configuration {"x64", "release"}
  145. targetsuffix ("_" .. act .. "_x64_release" )
  146. configuration {"x32", "debug"}
  147. targetsuffix ("_" .. act .. "_debug" )
  148. configuration{}
  149. postfix=""
  150. if _ACTION == "xcode4" then
  151. if _OPTIONS["ios"] then
  152. _OPTIONS["no-bullet3"] = "1"
  153. _OPTIONS["no-gtest"] = "1"
  154. postfix = "ios";
  155. xcodebuildsettings
  156. {
  157. 'INFOPLIST_FILE = "../../test/Bullet2/Info.plist"',
  158. 'CODE_SIGN_IDENTITY = "iPhone Developer"',
  159. "SDKROOT = iphoneos",
  160. 'ARCHS = "armv7"',
  161. 'TARGETED_DEVICE_FAMILY = "1,2"',
  162. 'VALID_ARCHS = "armv7"',
  163. }
  164. else
  165. xcodebuildsettings
  166. {
  167. 'ARCHS = "$(ARCHS_STANDARD_32_BIT) $(ARCHS_STANDARD_64_BIT)"',
  168. 'VALID_ARCHS = "x86_64 i386"',
  169. -- 'SDKROOT = "macosx10.9"',
  170. }
  171. end
  172. end
  173. -- comment-out for now, URDF reader needs exceptions
  174. -- flags { "NoRTTI", "NoExceptions"}
  175. -- defines { "_HAS_EXCEPTIONS=0" }
  176. --printf ( _OPTIONS["targetdir"] )
  177. targetdir( _OPTIONS["targetdir"] or "../bin" )
  178. location("./" .. act .. postfix)
  179. if not _OPTIONS["python_include_dir"] then
  180. _OPTIONS["python_include_dir"] = default_python_include_dir
  181. end
  182. if not _OPTIONS["python_lib_dir"] then
  183. _OPTIONS["python_lib_dir"] = default_python_lib_dir
  184. end
  185. projectRootDir = os.getcwd() .. "/../"
  186. print("Project root directory: " .. projectRootDir);
  187. dofile ("findOpenCL.lua")
  188. dofile ("findDirectX11.lua")
  189. dofile ("findOpenGLGlewGlut.lua")
  190. if (not findOpenGL3()) then
  191. defines {"NO_OPENGL3"}
  192. end
  193. language "C++"
  194. if not _OPTIONS["no-demos"] then
  195. include "../examples/ExampleBrowser"
  196. include "../examples/OpenGLWindow"
  197. include "../examples/ThirdPartyLibs/Gwen"
  198. include "../examples/SimpleOpenGL3"
  199. include "../examples/TinyRenderer"
  200. include "../examples/HelloWorld"
  201. include "../examples/BasicDemo"
  202. include "../examples/InverseDynamics"
  203. include "../examples/ExtendedTutorials"
  204. include "../examples/SharedMemory"
  205. include "../examples/ThirdPartyLibs/BussIK"
  206. include "../examples/MultiThreading"
  207. if _OPTIONS["lua"] then
  208. include "../examples/ThirdPartyLibs/lua-5.2.3"
  209. end
  210. if _OPTIONS["enable_pybullet"] then
  211. include "../examples/pybullet"
  212. end
  213. if not _OPTIONS["no-test"] then
  214. include "../test/SharedMemory"
  215. if _OPTIONS["enet"] then
  216. include "../examples/ThirdPartyLibs/enet"
  217. include "../test/enet/client"
  218. include "../test/enet/server"
  219. end
  220. end
  221. end
  222. if _OPTIONS["no-bullet3"] then
  223. print "--no-bullet3 implies --no-demos"
  224. _OPTIONS["no-demos"] = "1"
  225. else
  226. include "../src/Bullet3Common"
  227. include "../src/Bullet3Geometry"
  228. include "../src/Bullet3Collision"
  229. include "../src/Bullet3Dynamics"
  230. include "../src/Bullet3OpenCL"
  231. include "../src/Bullet3Serialize/Bullet2FileLoader"
  232. end
  233. if _OPTIONS["no-extras"] then
  234. print "--no-extras implies --no-demos"
  235. _OPTIONS["no-demos"] = "1"
  236. else
  237. include "../Extras"
  238. end
  239. if not _OPTIONS["no-test"] then
  240. include "../test/Bullet2"
  241. if not _OPTIONS["no-gtest"] then
  242. include "../test/gtest-1.7.0"
  243. -- include "../test/hello_gtest"
  244. include "../test/collision"
  245. include "../test/BulletDynamics/pendulum"
  246. if not _OPTIONS["no-bullet3"] then
  247. if not _OPTIONS["no-extras"] then
  248. include "../test/InverseDynamics"
  249. end
  250. include "../test/TestBullet3OpenCL"
  251. end
  252. if not _OPTIONS["no-demos"] then
  253. -- Gwen is only used for demos
  254. include "../test/GwenOpenGLTest"
  255. end
  256. end
  257. end
  258. include "../src/BulletInverseDynamics"
  259. include "../src/BulletSoftBody"
  260. include "../src/BulletDynamics"
  261. include "../src/BulletCollision"
  262. include "../src/LinearMath"