Imported Upstream version 2.81
[platform/upstream/libbullet.git] / build / premake4.lua
1 --add the 0 so the solution comes first in the directory (when sorted on name)\r
2 --print "uncomment this hello premake4 world for debugging the script"\r
3 \r
4 solution "0BulletSolution"\r
5 \r
6          newoption {\r
7     trigger     = "ios",\r
8     description = "Enable iOS target (requires xcode4)"\r
9   }\r
10   \r
11         newoption {\r
12                 trigger = "without-demos",\r
13           description = "Disable demos and extras"      \r
14         }\r
15 \r
16         newoption {\r
17     trigger     = "with-double-precision",\r
18     description = "Enable double precision build"\r
19   }\r
20 \r
21 \r
22         newoption {\r
23     trigger     = "with-nacl",\r
24     description = "Enable Native Client build"\r
25   }\r
26   \r
27   newoption {\r
28     trigger     = "with-dx11",\r
29     description = "Enable DirectX11 build"\r
30   }\r
31   \r
32    newoption {\r
33     trigger     = "with-opencl",\r
34     description = "Enable OpenCL builds (various SDKs)"\r
35   }\r
36 \r
37    newoption {\r
38     trigger     = "with-opencl-amd",\r
39     description = "Enable OpenCL builds (AMD SDK)"\r
40   }\r
41 \r
42    newoption {\r
43     trigger     = "with-opencl-intel",\r
44     description = "Enable OpenCL builds (Intel SDK)"\r
45   }\r
46    newoption {\r
47     trigger     = "with-opencl-nvidia",\r
48     description = "Enable OpenCL builds (NVIDIA SDK)"\r
49   }\r
50 \r
51   \r
52         configurations {"Release", "Debug"}\r
53         configuration "Release"\r
54                 flags { "Optimize", "StaticRuntime", "NoMinimalRebuild", "FloatFast"}\r
55         configuration "Debug"\r
56                 flags { "Symbols", "StaticRuntime" , "NoMinimalRebuild", "NoEditAndContinue" ,"FloatFast"}\r
57                 \r
58         platforms {"x32", "x64"}\r
59         --platforms {"x32"}\r
60 \r
61   configuration {"Windows"}\r
62         defines { "_CRT_SECURE_NO_WARNINGS","_CRT_SECURE_NO_DEPRECATE"}\r
63   \r
64         configuration{}\r
65 \r
66         postfix="";\r
67 \r
68   if _OPTIONS["with-double-precision"] then\r
69         defines {"BT_USE_DOUBLE_PRECISION"}\r
70   end\r
71   \r
72         if _ACTION == "xcode4" then\r
73                 if _OPTIONS["ios"] then\r
74                         postfix = "ios";\r
75                         xcodebuildsettings\r
76                         {\r
77                                 'INFOPLIST_FILE = "../../Test/Info.plist"',\r
78                                 'CODE_SIGN_IDENTITY = "iPhone Developer"',\r
79                                 "SDKROOT = iphoneos",\r
80                                 'ARCHS = "armv7"',\r
81                                 'TARGETED_DEVICE_FAMILY = "1,2"',\r
82                                 'VALID_ARCHS = "armv7"',\r
83                         }       \r
84                         else\r
85                         xcodebuildsettings\r
86                         {\r
87                                 'ARCHS = "$(ARCHS_STANDARD_32_BIT) $(ARCHS_STANDARD_64_BIT)"',\r
88                                 'VALID_ARCHS = "x86_64 i386"',\r
89                         }\r
90                 end\r
91         else\r
92         \r
93         end\r
94 \r
95     act = ""\r
96     \r
97     if _ACTION then\r
98         act = _ACTION\r
99     end\r
100         configuration {"x32"}\r
101                 targetsuffix ("_" .. act)\r
102         configuration "x64"             \r
103                 targetsuffix ("_" .. act .. "_64" )\r
104         configuration {"x64", "debug"}\r
105                 targetsuffix ("_" .. act .. "_x64_debug")\r
106         configuration {"x64", "release"}\r
107                 targetsuffix ("_" .. act .. "_x64_release" )\r
108         configuration {"x32", "debug"}\r
109                 targetsuffix ("_" .. act .. "_debug" )\r
110         \r
111         configuration{}\r
112 \r
113 \r
114 \r
115 if not _OPTIONS["with-nacl"] then\r
116 \r
117         flags { "NoRTTI"}\r
118         targetdir "../bin"\r
119 \r
120         -- Disable exception handling on MSVC 2008 and higher. MSVC 2005 without service pack has some linker issue (ConvexDecompositionDemo uses STL through HACD library)     \r
121         if _ACTION == "vs2010" or _ACTION=="vs2008" then\r
122                 flags { "NoExceptions"}\r
123                 defines { "_HAS_EXCEPTIONS=0" }\r
124         end\r
125 \r
126         -- Multithreaded compiling\r
127         if _ACTION == "vs2010" then\r
128                 buildoptions { "/MP"  }\r
129         end \r
130 \r
131 \r
132 else\r
133         targetdir "../bin_html"\r
134 end\r
135 \r
136 \r
137         dofile ("findOpenCL.lua")\r
138         dofile ("findDirectX11.lua")\r
139         \r
140         language "C++"\r
141         \r
142         location("./" .. act .. postfix)\r
143 \r
144         \r
145         if _OPTIONS["with-dx11"] then\r
146                 include "../Demos/DX11ClothDemo"\r
147                 include "../src/BulletMultiThreaded/GpuSoftBodySolvers/DX11"\r
148         end\r
149 \r
150 --choose any OpenCL sdk that is installed on the system\r
151         if _OPTIONS["with-opencl"] then\r
152                 include "../Demos/OpenCLClothDemo/AMD"\r
153                 include "../src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/AMD"\r
154                 include "../Demos/OpenCLClothDemo/NVidia"\r
155                 include "../src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/NVidia"\r
156                 include "../Demos/OpenCLClothDemo/Intel"\r
157                 include "../src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/Intel"\r
158         end\r
159 \r
160 --choose a particular OpenCL sdk, this is useful for distributing project files that just work for one OpenCL SDK       \r
161         if _OPTIONS["with-opencl-amd"] then\r
162                 include "../Demos/OpenCLClothDemo/AMD"\r
163                 include "../Demos/OpenGL"\r
164                 include "../Demos/SoftDemo/AMD"\r
165                 include "../src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/AMD"\r
166         end\r
167   \r
168   if _OPTIONS["with-opencl-intel"] then\r
169                 include "../Demos/OpenCLClothDemo/Intel"\r
170                 include "../src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/Intel"\r
171         end\r
172 \r
173   if _OPTIONS["with-opencl-nvidia"] then\r
174                 include "../Demos/OpenCLClothDemo/NVidia"\r
175                 include "../src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/NVidia"\r
176         end\r
177 \r
178         if not _OPTIONS["without-demos"] then\r
179                 if not _OPTIONS["ios"] then\r
180                 include "../Demos"\r
181                 end\r
182         include "../Extras"\r
183   end\r
184   \r
185   \r
186    if _OPTIONS["with-nacl"] then\r
187         include "../Demos/NativeClient"\r
188   else\r
189         include "../src/LinearMath"     \r
190                 include "../src/BulletCollision"        \r
191                 include "../src/BulletDynamics" \r
192                 include "../src/BulletSoftBody" \r
193         end\r
194         \r
195         include "../Test"\r
196         include "../Demos/HelloWorld"\r
197         include "../Demos/Benchmarks"\r
198         \r