diff --git a/Demos/OpenGL/premake4.lua b/Demos/OpenGL/premake4.lua new file mode 100644 index 000000000..3e2208e59 --- /dev/null +++ b/Demos/OpenGL/premake4.lua @@ -0,0 +1,18 @@ + project "OpenGLSupport" + + kind "StaticLib" + targetdir "../../lib" + includedirs { + ".", + "../../src" + } + configuration {"Windows"} + includedirs { + "../../Glut" + } + configuration{} + + files { + "**.cpp", + "**.h" + } diff --git a/Demos/premake4.lua b/Demos/premake4.lua new file mode 100644 index 000000000..17ec919bb --- /dev/null +++ b/Demos/premake4.lua @@ -0,0 +1,88 @@ + + + +function createDemos( demos, incdirs, linknames) + for _, name in ipairs(demos) do + + project ( "App_" .. name ) + + kind "ConsoleApp" + targetdir ".." + + includedirs {incdirs} + + configuration { "Windows" } + links { "glut32","glew32","opengl32" } + includedirs{ "../Glut" } + libdirs {"../Glut"} + files { "../msvc/bullet.rc" } + + configuration {"MaxOSX"} + linkoptions { "-framework Carbon -framework OpenGL -framework AGL -framework Glut" } + + configuration {"not Windows", "not MacOSX"} + links {"GL","GLU","glut"} + + configuration{} + + links { + linknames + } + + files { + "./" .. name .. "/*.cpp" , + "./" .. name .. "/*.h" + } + end +end + +-- "CharacterDemo", fixme: it includes BspDemo files + + local localdemos = { + "BasicDemo", + "Box2dDemo", + "BspDemo", + "CcdPhysicsDemo", + "CollisionDemo", + "CollisionInterfaceDemo", + "ConcaveConvexcastDemo", + "ConcaveDemo", + "ConcaveRaycastDemo", + "ConstraintDemo", + "ContinuousConvexCollision", + "ConvexHullDistance", + "DynamicControlDemo", + "EPAPenDepthDemo", + "ForkLiftDemo", + "FractureDemo", + "GenericJointDemo", + "GimpactTestDemo", + "GjkConvexCastDemo", + "HelloWorld", + "InternalEdgeDemo", + "MovingConcaveDemo", + "MultiMaterialDemo", + "RagdollDemo", + "Raytracer", + "SimplexDemo", + "SliderConstraintDemo", + "TerrainDemo", + "UserCollisionAlgorithm", + "VehicleDemo" + } + +-- the following demos require custom include or link settings + + createDemos(localdemos,{"../src","OpenGL"},{"OpenGLSupport","LinearMath","BulletCollision","BulletDynamics"}) + + createDemos({"ConvexDecompositionDemo"},{"../Extras/HACD","../src","OpenGL"},{"OpenGLSupport","LinearMath","BulletCollision","BulletDynamics", "HACD"}) + + createDemos({"SoftDemo"},{"../src","OpenGL"}, {"OpenGLSupport","LinearMath","BulletCollision","BulletDynamics", "BulletSoftBody"}) + + createDemos({"SerializeDemo"},{"../Extras/Serialize/BulletFileLoader","../Extras/Serialize/BulletWorldImporter","../src","OpenGL"},{"OpenGLSupport","LinearMath","BulletCollision","BulletDynamics", "BulletSoftBody", "BulletFileLoader","BulletWorldImporter"}) + + + +include "OpenGL" + + \ No newline at end of file diff --git a/Extras/HACD/hacdHACD.cpp b/Extras/HACD/hacdHACD.cpp index d68b1ee58..c4b028777 100644 --- a/Extras/HACD/hacdHACD.cpp +++ b/Extras/HACD/hacdHACD.cpp @@ -12,7 +12,10 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#ifndef _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS +#endif //_CRT_SECURE_NO_WARNINGS + #include #include #include diff --git a/Extras/HACD/premake4.lua b/Extras/HACD/premake4.lua new file mode 100644 index 000000000..127d89018 --- /dev/null +++ b/Extras/HACD/premake4.lua @@ -0,0 +1,9 @@ + project "HACD" + + kind "StaticLib" + targetdir "../../lib" + includedirs {"."} + files { + "**.cpp", + "**.h" + } \ No newline at end of file diff --git a/Extras/Serialize/BulletFileLoader/premake4.lua b/Extras/Serialize/BulletFileLoader/premake4.lua new file mode 100644 index 000000000..b9480ed63 --- /dev/null +++ b/Extras/Serialize/BulletFileLoader/premake4.lua @@ -0,0 +1,12 @@ + project "BulletFileLoader" + + kind "StaticLib" + targetdir "../../lib" + includedirs { + "../../../src" + } + + files { + "**.cpp", + "**.h" + } \ No newline at end of file diff --git a/Extras/Serialize/BulletWorldImporter/premake4.lua b/Extras/Serialize/BulletWorldImporter/premake4.lua new file mode 100644 index 000000000..170bc651b --- /dev/null +++ b/Extras/Serialize/BulletWorldImporter/premake4.lua @@ -0,0 +1,13 @@ + project "BulletWorldImporter" + + kind "StaticLib" + targetdir "../../lib" + includedirs { + "../BulletFileLoader", + "../../../src" + } + + files { + "**.cpp", + "**.h" + } \ No newline at end of file diff --git a/Extras/premake4.lua b/Extras/premake4.lua new file mode 100644 index 000000000..71f94a38c --- /dev/null +++ b/Extras/premake4.lua @@ -0,0 +1,5 @@ + +include "HACD" + +include "Serialize/BulletFileLoader" +include "Serialize/BulletWorldImporter" diff --git a/lib/readme.txt b/lib/readme.txt index 9c19ebd12..b384ca28f 100644 --- a/lib/readme.txt +++ b/lib/readme.txt @@ -1,13 +1,13 @@ At the moment there are no binary packages from Bullet library. -Once this is done, 3 libraries will be placed here: +Once this is done, the libraries will be placed here -bulletmath.a -bulletcollision.a -bulletdynamics.a +LinearMath +BulletCollision +BulletDynamics The C-API will be available in the include folder. For now, there is only C++ files, see src/btBulletCollisionCommon.h and src/btBulletDynamicsCommon.h -http://bullet.sf.net +http://bullet.googlecode.com Erwin Coumans diff --git a/msvc/bullet.rc b/msvc/bullet.rc index 503348dac..704b4d2ea 100644 --- a/msvc/bullet.rc +++ b/msvc/bullet.rc @@ -1,8 +1,8 @@ // This file is generated automatically. 1 VERSIONINFO -FILEVERSION 2, 76, 0, 0 -PRODUCTVERSION 2, 76, 0, 0 +FILEVERSION 2, 79, 0, 0 +PRODUCTVERSION 2, 79, 0, 0 #ifdef CS_DEBUG FILEFLAGS 0x1 #else @@ -14,9 +14,9 @@ FILEFLAGS 0x0 BLOCK "040904E4" { VALUE "ProductName", "Bullet Continuous Collision Detection and Physics Library" - VALUE "ProductVersion", "2.76" - VALUE "FileVersion", "2.76" - VALUE "LegalCopyright", "Copyright (c) 2005-2010 Erwin Coumans" + VALUE "ProductVersion", "2.79" + VALUE "FileVersion", "2.79" + VALUE "LegalCopyright", "Copyright (c) 2005-2011 Erwin Coumans" #ifdef CS_DEBUG VALUE "Comments", "Debug build" #else diff --git a/msvc/findDirectX11.lua b/msvc/findDirectX11.lua new file mode 100644 index 000000000..7f41abcc6 --- /dev/null +++ b/msvc/findDirectX11.lua @@ -0,0 +1,36 @@ +function findDirectX11() + local dx11path = os.getenv("DXSDK_DIR") + if (dx11path) then + local filepath = string.format("%s%s",dx11path,"Include/D3D11.h") + headerdx11 = io.open(filepath, "r") + if (headerdx11) then + printf("Found DX11: '%s'", filepath) + return true + end + end + return false + end + +function initDirectX11() + configuration {} + + local dx11path = os.getenv("DXSDK_DIR") + defines { "ADL_ENABLE_DX11"} + includedirs {"$(DXSDK_DIR)/include"} + + configuration "x32" + libdirs {"$(DXSDK_DIR)/Lib/x86"} + configuration "x64" + libdirs {"$(DXSDK_DIR)/Lib/x64"} + configuration {} + links {"d3dcompiler", + "dxerr", + "dxguid", + "d3dx9", + "d3d9", + "winmm", + "comctl32", + "d3dx11" + } + return true +end \ No newline at end of file diff --git a/msvc/findOpenCL.lua b/msvc/findOpenCL.lua new file mode 100644 index 000000000..c77631f78 --- /dev/null +++ b/msvc/findOpenCL.lua @@ -0,0 +1,84 @@ + -- todo: add Apple OpenCL environment vars + + function findOpenCL_AMD() + local amdopenclpath = os.getenv("AMDAPPSDKROOT") + if (amdopenclpath) then + return true + end + return false + end + + function findOpenCL_NVIDIA() + local nvidiaopenclpath = os.getenv("CUDA_PATH") + if (nvidiaopenclpath) then + return true + end + return false + end + + function findOpenCL_Intel() + local intelopenclpath = os.getenv("INTELOCLSDKROOT") + if (intelopenclpath) then + return true + end + return false + end + + function initOpenCL_AMD() + configuration {} + local amdopenclpath = os.getenv("AMDAPPSDKROOT") + if (amdopenclpath) then + defines { "ADL_ENABLE_CL" , "CL_PLATFORM_AMD"} + includedirs { + "$(AMDAPPSDKROOT)/include" + } + configuration "x32" + libdirs {"$(AMDAPPSDKROOT)/lib/x86"} + configuration "x64" + libdirs {"$(AMDAPPSDKROOT)/lib/x86_64"} + configuration {} + links {"OpenCL"} + return true + end + return false + end + + + function initOpenCL_NVIDIA() + configuration {} + local nvidiaopenclpath = os.getenv("CUDA_PATH") + if (nvidiaopenclpath) then + defines { "ADL_ENABLE_CL" , "CL_PLATFORM_NVIDIA"} + includedirs { + "$(CUDA_PATH)/include" + } + configuration "x32" + libdirs {"$(CUDA_PATH)/lib/Win32"} + configuration "x64" + libdirs {"$(CUDA_PATH)/lib/x64"} + configuration {} + links {"OpenCL"} + return true + end + return false + end + + function initOpenCL_Intel() + configuration {} + local intelopenclpath = os.getenv("INTELOCLSDKROOT") + if (intelopenclpath) then + defines { "ADL_ENABLE_CL" , "CL_PLATFORM_INTEL"} + includedirs { + "$(INTELOCLSDKROOT)/include" + } + configuration "x32" + libdirs {"$(INTELOCLSDKROOT)/lib/x86"} + configuration "x64" + libdirs {"$(INTELOCLSDKROOT)/lib/x64"} + configuration {} + links {"OpenCL"} + return true + end + return false + end + \ No newline at end of file diff --git a/msvc/premake4.exe b/msvc/premake4.exe new file mode 100644 index 000000000..b4230f197 Binary files /dev/null and b/msvc/premake4.exe differ diff --git a/msvc/premake4.lua b/msvc/premake4.lua new file mode 100644 index 000000000..1d7099367 --- /dev/null +++ b/msvc/premake4.lua @@ -0,0 +1,77 @@ +--add the 0 so the solution comes first in the directory (when sorted on name) + +solution "0BulletSolution" + + -- Multithreaded compiling + if _ACTION == "vs2010" or _ACTION=="vs2008" then + buildoptions { "/MP" } + end + + newoption { + trigger = "with-nacl", + description = "Enable Native Client build" + } + + newoption { + trigger = "with-dx11", + description = "Enable DirectX11 build" + } + + + configurations {"Release", "Debug"} + configuration "Release" + flags { "Optimize", "StaticRuntime", "NoMinimalRebuild", "FloatFast"} + configuration "Debug" + flags { "Symbols", "StaticRuntime" , "NoMinimalRebuild", "NoEditAndContinue" ,"FloatFast"} + + platforms {"x32", "x64"} + + configuration "x64" + targetsuffix "_64" + configuration {"x64", "debug"} + targetsuffix "_x64_debug" + configuration {"x64", "release"} + targetsuffix "_x64" + configuration {"x32", "debug"} + targetsuffix "_debug" + + configuration {"Windows"} + defines { "_CRT_SECURE_NO_WARNINGS","_CRT_SECURE_NO_DEPRECATE"} + + configuration{} + + + +if not _OPTIONS["with-nacl"] then + flags { "NoRTTI", "NoExceptions"} + defines { "_HAS_EXCEPTIONS=0" } + targetdir "../bin" +else + targetdir "../bin_html" +end + + + dofile ("findOpenCL.lua") + dofile ("findDirectX11.lua") + + language "C++" + + location("./" .. _ACTION) + + if _OPTIONS["with-dx11"] then + include "../Demos/DX11ClothDemo" + include "../src/BulletMultiThreaded/GpuSoftBodySolvers/DX11" + end + + if not _OPTIONS["with-dx11"] and not _OPTIONS["with-nacl"] then + include "../Demos" + include "../Extras" + end + + include "../src/LinearMath" + include "../src/BulletCollision" + include "../src/BulletDynamics" + include "../src/BulletSoftBody" + + + diff --git a/msvc/vs2005.bat b/msvc/vs2005.bat new file mode 100644 index 000000000..2bd3f8e0f --- /dev/null +++ b/msvc/vs2005.bat @@ -0,0 +1,4 @@ + +premake4 vs2005 + +pause \ No newline at end of file diff --git a/msvc/vs2008.bat b/msvc/vs2008.bat new file mode 100644 index 000000000..f172640a5 --- /dev/null +++ b/msvc/vs2008.bat @@ -0,0 +1,10 @@ + +rem premake4 --no-pelibs vs2008 +rem premake4 --no-pedemos vs2008 +rem premake4 --no-bulletlibs --no-pelibs vs2008 +rem premake4 --with-nacl vs2008 + +premake4 vs2008 + + +pause \ No newline at end of file diff --git a/msvc/vs2008_dx11.bat b/msvc/vs2008_dx11.bat new file mode 100644 index 000000000..0e6ff1a2c --- /dev/null +++ b/msvc/vs2008_dx11.bat @@ -0,0 +1,4 @@ + +premake4 --with-dx11 vs2008 + +pause \ No newline at end of file diff --git a/msvc/vs2008_nacl.bat b/msvc/vs2008_nacl.bat new file mode 100644 index 000000000..696136dbc --- /dev/null +++ b/msvc/vs2008_nacl.bat @@ -0,0 +1,8 @@ + +rem premake4 --no-pelibs vs2008 +rem premake4 --no-pedemos vs2008 +rem premake4 --no-bulletlibs --no-pelibs vs2008 +premake4 --with-nacl vs2008 + + +pause \ No newline at end of file diff --git a/msvc/vs2010.bat b/msvc/vs2010.bat new file mode 100644 index 000000000..839456178 --- /dev/null +++ b/msvc/vs2010.bat @@ -0,0 +1,4 @@ + +premake4 vs2010 + +pause \ No newline at end of file diff --git a/src/BulletCollision/premake4.lua b/src/BulletCollision/premake4.lua new file mode 100644 index 000000000..094b306ee --- /dev/null +++ b/src/BulletCollision/premake4.lua @@ -0,0 +1,11 @@ + project "BulletCollision" + + kind "StaticLib" + targetdir "../../lib" + includedirs { + "..", + } + files { + "**.cpp", + "**.h" + } \ No newline at end of file diff --git a/src/BulletDynamics/premake4.lua b/src/BulletDynamics/premake4.lua new file mode 100644 index 000000000..9af6d3abf --- /dev/null +++ b/src/BulletDynamics/premake4.lua @@ -0,0 +1,11 @@ + project "BulletDynamics" + + kind "StaticLib" + targetdir "../../lib" + includedirs { + "..", + } + files { + "**.cpp", + "**.h" + } \ No newline at end of file diff --git a/src/BulletMultiThreaded/GpuSoftBodySolvers/DX11/premake4.lua b/src/BulletMultiThreaded/GpuSoftBodySolvers/DX11/premake4.lua new file mode 100644 index 000000000..8f95f6252 --- /dev/null +++ b/src/BulletMultiThreaded/GpuSoftBodySolvers/DX11/premake4.lua @@ -0,0 +1,23 @@ + +hasDX11 = findDirectX11() + +if (hasDX11) then + + project "BulletSoftBodyDX11Solvers" + + initDirectX11() + + kind "StaticLib" + + targetdir "../../../../lib" + + includedirs { + ".", + "../../.." + } + files { + "**.cpp", + "**.h" + } + +end diff --git a/src/BulletSoftBody/premake4.lua b/src/BulletSoftBody/premake4.lua new file mode 100644 index 000000000..2c78bbb51 --- /dev/null +++ b/src/BulletSoftBody/premake4.lua @@ -0,0 +1,11 @@ + project "BulletSoftBody" + + kind "StaticLib" + targetdir "../../lib" + includedirs { + "..", + } + files { + "**.cpp", + "**.h" + } \ No newline at end of file diff --git a/src/LinearMath/premake4.lua b/src/LinearMath/premake4.lua new file mode 100644 index 000000000..b698bed8e --- /dev/null +++ b/src/LinearMath/premake4.lua @@ -0,0 +1,11 @@ + project "LinearMath" + + kind "StaticLib" + targetdir "../../lib" + includedirs { + "..", + } + files { + "**.cpp", + "**.h" + } \ No newline at end of file