cleanup main premake script

added premake options:
  --no-demos
  --no-test
  --no-bullet3
This commit is contained in:
Andrew Meadows
2015-12-03 18:58:10 -08:00
parent 01c4720d62
commit f385bffffb

View File

@@ -1,11 +1,11 @@
solution "0_Bullet3Solution" solution "0_Bullet3Solution"
local osversion = os.getversion() local osversion = os.getversion()
print(string.format(" %d.%d.%d (%s)", print(string.format(" %d.%d.%d (%s)",
osversion.majorversion, osversion.minorversion, osversion.revision, osversion.majorversion, osversion.minorversion, osversion.revision,
osversion.description)) osversion.description))
-- Multithreaded compiling -- Multithreaded compiling
if _ACTION == "vs2010" or _ACTION=="vs2008" then if _ACTION == "vs2010" or _ACTION=="vs2008" then
@@ -18,22 +18,22 @@
act = _ACTION act = _ACTION
end end
newoption { newoption {
trigger = "ios", trigger = "ios",
description = "Enable iOS target (requires xcode4)" description = "Enable iOS target (requires xcode4)"
} }
newoption newoption
{ {
trigger = "force_dlopen_opengl", trigger = "force_dlopen_opengl",
description = "Dynamically load OpenGL (instead of static/dynamic linking)" description = "Dynamically load OpenGL (instead of static/dynamic linking)"
} }
newoption newoption
{ {
trigger = "force_dlopen_x11", trigger = "force_dlopen_x11",
description = "Dynamically load OpenGL (instead of static/dynamic linking)" description = "Dynamically load OpenGL (instead of static/dynamic linking)"
} }
newoption newoption
{ {
@@ -49,43 +49,55 @@
-- --_OPTIONS["midi"] = "1"; -- --_OPTIONS["midi"] = "1";
newoption newoption
{ {
trigger = "bullet2demos", trigger = "no-demos",
description = "Compile the Bullet 2 demos (Demo/Extra folder)" description = "Don't build demos"
} }
newoption newoption
{ {
trigger = "enet", trigger = "enet",
description = "Enable enet NAT punchthrough test" description = "Enable enet NAT punchthrough test"
} }
newoption newoption
{ {
trigger = "lua", trigger = "lua",
description = "Enable Lua scipting support in Example Browser" description = "Enable Lua scipting support in Example Browser"
} }
newoption { newoption {
trigger = "targetdir", trigger = "targetdir",
value = "path such as ../bin", value = "path such as ../bin",
description = "Set the output location for the generated project files" description = "Set the output location for the generated project files"
} }
newoption newoption
{ {
trigger = "without-gtest", trigger = "no-test",
description = "Disable all tests"
}
newoption
{
trigger = "no-gtest",
description = "Disable unit tests using gtest" description = "Disable unit tests using gtest"
} }
newoption
{
trigger = "no-bullet3",
description = "Do not build bullet3 libs"
}
configurations {"Release", "Debug"} configurations {"Release", "Debug"}
configuration "Release" configuration "Release"
flags { "Optimize", "EnableSSE2","StaticRuntime", "NoMinimalRebuild", "FloatFast"} flags { "Optimize", "EnableSSE2","StaticRuntime", "NoMinimalRebuild", "FloatFast"}
configuration "Debug" configuration "Debug"
defines {"_DEBUG=1"} defines {"_DEBUG=1"}
flags { "Symbols", "StaticRuntime" , "NoMinimalRebuild", "NoEditAndContinue" ,"FloatFast"} flags { "Symbols", "StaticRuntime" , "NoMinimalRebuild", "NoEditAndContinue" ,"FloatFast"}
if os.is("Linux") or os.is("macosx") then if os.is("Linux") or os.is("macosx") then
if os.is64bit() then if os.is64bit() then
platforms {"x64"} platforms {"x64"}
@@ -112,25 +124,25 @@
postfix="" postfix=""
if _ACTION == "xcode4" then if _ACTION == "xcode4" then
if _OPTIONS["ios"] then if _OPTIONS["ios"] then
postfix = "ios"; postfix = "ios";
xcodebuildsettings xcodebuildsettings
{ {
'INFOPLIST_FILE = "../../test/Bullet2/Info.plist"', 'INFOPLIST_FILE = "../../test/Bullet2/Info.plist"',
'CODE_SIGN_IDENTITY = "iPhone Developer"', 'CODE_SIGN_IDENTITY = "iPhone Developer"',
"SDKROOT = iphoneos", "SDKROOT = iphoneos",
'ARCHS = "armv7"', 'ARCHS = "armv7"',
'TARGETED_DEVICE_FAMILY = "1,2"', 'TARGETED_DEVICE_FAMILY = "1,2"',
'VALID_ARCHS = "armv7"', 'VALID_ARCHS = "armv7"',
} }
else else
xcodebuildsettings xcodebuildsettings
{ {
'ARCHS = "$(ARCHS_STANDARD_32_BIT) $(ARCHS_STANDARD_64_BIT)"', 'ARCHS = "$(ARCHS_STANDARD_32_BIT) $(ARCHS_STANDARD_64_BIT)"',
'VALID_ARCHS = "x86_64 i386"', 'VALID_ARCHS = "x86_64 i386"',
-- 'SDKROOT = "macosx10.9"', -- 'SDKROOT = "macosx10.9"',
} }
end end
end end
-- comment-out for now, URDF reader needs exceptions -- comment-out for now, URDF reader needs exceptions
@@ -148,57 +160,83 @@
dofile ("findOpenCL.lua") dofile ("findOpenCL.lua")
dofile ("findDirectX11.lua") dofile ("findDirectX11.lua")
dofile ("findOpenGLGlewGlut.lua") dofile ("findOpenGLGlewGlut.lua")
if (not findOpenGL3()) then if (not findOpenGL3()) then
defines {"NO_OPENGL3"} defines {"NO_OPENGL3"}
end end
language "C++" language "C++"
if not _OPTIONS["ios"] then if _OPTIONS["ios"] then
_OPTIONS["no-bullet3"] = "1"
_OPTIONS["no-gtest"] = "1"
end
include "../examples/ExampleBrowser" if _OPTIONS["no-bullet3"] then
include "../examples/OpenGLWindow" _OPTIONS["no-demos"] = "1"
include "../examples/SharedMemory" else
include "../examples/MultiThreading" include "../src/Bullet3Common"
include "../examples/ThirdPartyLibs/Gwen" include "../src/Bullet3Geometry"
include "../Extras" include "../src/Bullet3Collision"
include "../src/Bullet3Dynamics"
include "../src/Bullet3OpenCL"
include "../src/Bullet3Serialize/Bullet2FileLoader"
end
include "../examples/HelloWorld" if _OPTIONS["no-extras"] then
include "../examples/BasicDemo" _OPTIONS["no-demos"] = "1"
include "../test/SharedMemory" else
include "../Extras"
if _OPTIONS["enet"] then end
include "../examples/ThirdPartyLibs/enet"
include "../test/enet/client"
include "../test/enet/server"
end
if _OPTIONS["lua"] then if not _OPTIONS["no-demos"] then
include "../examples/ThirdPartyLibs/lua-5.2.3" include "../examples/ExampleBrowser"
end include "../examples/OpenGLWindow"
include "../examples/ThirdPartyLibs/Gwen"
include "../src/Bullet3Common"
include "../src/Bullet3Geometry"
include "../src/Bullet3Collision"
include "../src/Bullet3Dynamics"
include "../src/Bullet3OpenCL"
include "../src/Bullet3Serialize/Bullet2FileLoader"
if not _OPTIONS["without-gtest"] then include "../examples/HelloWorld"
include "../test/gtest-1.7.0" include "../examples/BasicDemo"
-- include "../test/hello_gtest"
include "../test/collision" include "../examples/SharedMemory"
include "../test/InverseDynamics" include "../examples/MultiThreading"
include "../test/TestBullet3OpenCL"
include "../test/GwenOpenGLTest" if _OPTIONS["lua"] then
include "../examples/ThirdPartyLibs/lua-5.2.3"
end end
end
include "../test/Bullet2" if not _OPTIONS["no-test"] then
include "../test/SharedMemory"
if _OPTIONS["enet"] then
include "../examples/ThirdPartyLibs/enet"
include "../test/enet/client"
include "../test/enet/server"
end
end
end
if not _OPTIONS["no-test"] then
include "../test/Bullet2"
if not _OPTIONS["no-gtest"] then
include "../test/gtest-1.7.0"
-- include "../test/hello_gtest"
include "../test/collision"
if not _OPTIONS["no-bullet3"] then
if _OPTIONS["no-extras"] then
include "../test/InverseDynamics"
end
include "../test/TestBullet3OpenCL"
end
if not _OPTIONS["no-demos"] then
-- Gwen is only used for demos
include "../test/GwenOpenGLTest"
end
end
end
include "../src/BulletInverseDynamics" include "../src/BulletInverseDynamics"
include "../src/BulletSoftBody" include "../src/BulletSoftBody"
include "../src/BulletDynamics" include "../src/BulletDynamics"
include "../src/BulletCollision" include "../src/BulletCollision"
include "../src/LinearMath" include "../src/LinearMath"