diff --git a/Demos3/AllBullet2Demos/CMakeLists.txt b/Demos3/AllBullet2Demos/CMakeLists.txt index 29cfb6d24..04e995302 100644 --- a/Demos3/AllBullet2Demos/CMakeLists.txt +++ b/Demos3/AllBullet2Demos/CMakeLists.txt @@ -41,9 +41,13 @@ IF (WIN32) ) ADD_DEFINITIONS(-DGLEW_STATIC) ELSE(WIN32) - IF(NOT APPLE) + IF(APPLE) + find_library(COCOA NAMES Cocoa) + MESSAGE(${COCOA}) + link_libraries(${COCOA}) + ELSE(APPLE) LINK_LIBRARIES( GLEW) - ENDIF(NOT APPLE) + ENDIF(APPLE) ENDIF(WIN32) @@ -61,4 +65,4 @@ IF (INTERNAL_ADD_POSTFIX_EXECUTABLE_NAMES) SET_TARGET_PROPERTIES(App_AllBullet2Demos PROPERTIES DEBUG_POSTFIX "_Debug") SET_TARGET_PROPERTIES(App_AllBullet2Demos PROPERTIES MINSIZEREL_POSTFIX "_MinsizeRel") SET_TARGET_PROPERTIES(App_AllBullet2Demos PROPERTIES RELWITHDEBINFO_POSTFIX "_RelWithDebugInfo") -ENDIF(INTERNAL_ADD_POSTFIX_EXECUTABLE_NAMES) \ No newline at end of file +ENDIF(INTERNAL_ADD_POSTFIX_EXECUTABLE_NAMES) diff --git a/Demos3/GpuDemos/CMakeLists.txt b/Demos3/GpuDemos/CMakeLists.txt index 74bbe45c2..06dc4e81a 100644 --- a/Demos3/GpuDemos/CMakeLists.txt +++ b/Demos3/GpuDemos/CMakeLists.txt @@ -45,9 +45,13 @@ IF (WIN32) ) ADD_DEFINITIONS(-DGLEW_STATIC) ELSE(WIN32) - IF(NOT APPLE) + IF(APPLE) + find_library(COCOA NAMES Cocoa) + MESSAGE(${COCOA}) + link_libraries(${COCOA}) + ELSE(APPLE) LINK_LIBRARIES( GLEW X11 dl) - ENDIF(NOT APPLE) + ENDIF(APPLE) ENDIF(WIN32) @@ -60,4 +64,4 @@ IF (INTERNAL_ADD_POSTFIX_EXECUTABLE_NAMES) SET_TARGET_PROPERTIES(App_Bullet3_OpenCL_Demos PROPERTIES DEBUG_POSTFIX "_Debug") SET_TARGET_PROPERTIES(App_Bullet3_OpenCL_Demos PROPERTIES MINSIZEREL_POSTFIX "_MinsizeRel") SET_TARGET_PROPERTIES(App_Bullet3_OpenCL_Demos PROPERTIES RELWITHDEBINFO_POSTFIX "_RelWithDebugInfo") -ENDIF(INTERNAL_ADD_POSTFIX_EXECUTABLE_NAMES) \ No newline at end of file +ENDIF(INTERNAL_ADD_POSTFIX_EXECUTABLE_NAMES) diff --git a/Demos3/SimpleOpenGL3/CMakeLists.txt b/Demos3/SimpleOpenGL3/CMakeLists.txt index 1181dd8e2..7cae8b701 100644 --- a/Demos3/SimpleOpenGL3/CMakeLists.txt +++ b/Demos3/SimpleOpenGL3/CMakeLists.txt @@ -22,9 +22,13 @@ IF (WIN32) ) ADD_DEFINITIONS(-DGLEW_STATIC) ELSE(WIN32) - IF(NOT APPLE) + IF(APPLE) + find_library(COCOA NAMES Cocoa) + MESSAGE(${COCOA}) + link_libraries(${COCOA}) + ELSE(APPLE) LINK_LIBRARIES( GLEW X11 dl Xext) - ENDIF(NOT APPLE) + ENDIF(APPLE) ENDIF(WIN32) @@ -37,4 +41,4 @@ IF (INTERNAL_ADD_POSTFIX_EXECUTABLE_NAMES) SET_TARGET_PROPERTIES(AppSimpleOpenGL3 PROPERTIES DEBUG_POSTFIX "_Debug") SET_TARGET_PROPERTIES(AppSimpleOpenGL3 PROPERTIES MINSIZEREL_POSTFIX "_MinsizeRel") SET_TARGET_PROPERTIES(AppSimpleOpenGL3 PROPERTIES RELWITHDEBINFO_POSTFIX "_RelWithDebugInfo") -ENDIF(INTERNAL_ADD_POSTFIX_EXECUTABLE_NAMES) \ No newline at end of file +ENDIF(INTERNAL_ADD_POSTFIX_EXECUTABLE_NAMES) diff --git a/build3/premake4.lua b/build3/premake4.lua index 00c770f62..a5c308db5 100644 --- a/build3/premake4.lua +++ b/build3/premake4.lua @@ -32,7 +32,12 @@ trigger = "enet", description = "Enable enet NAT punchthrough test" } - + + newoption + { + trigger = "gtest", + description = "Enable unit tests using gtest" + } configurations {"Release", "Debug"} configuration "Release" flags { "Optimize", "EnableSSE2","StaticRuntime", "NoMinimalRebuild", "FloatFast"} @@ -88,11 +93,13 @@ dofile ("findOpenGLGlewGlut.lua") language "C++" + + if _OPTIONS["gtest"] then + include "../test/gtest-1.7.0" +-- include "../test/hello_gtest" - include "../test/gtest-1.7.0" --- include "../test/hello_gtest" - - include "../test/TestBullet3OpenCL" + include "../test/TestBullet3OpenCL" + end include "../Demos3/AllBullet2Demos" diff --git a/src/Bullet3Common/b3Vector3.cpp b/src/Bullet3Common/b3Vector3.cpp index 5da6a18ca..e43f13897 100644 --- a/src/Bullet3Common/b3Vector3.cpp +++ b/src/Bullet3Common/b3Vector3.cpp @@ -42,7 +42,7 @@ long b3_maxdot_large( const float *vv, const float *vec, unsigned long count, fl long b3_maxdot_large( const float *vv, const float *vec, unsigned long count, float *dotResult ) { const float4 *vertices = (const float4*) vv; - static const unsigned char indexTable[16] = {-1, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0 }; + static const unsigned char indexTable[16] = {(unsigned char)-1, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0 }; float4 dotMax = b3Assign128( -B3_INFINITY, -B3_INFINITY, -B3_INFINITY, -B3_INFINITY ); float4 vvec = _mm_loadu_ps( vec ); float4 vHi = b3CastiTo128f(_mm_shuffle_epi32( b3CastfTo128i( vvec), 0xaa )); /// zzzz @@ -427,7 +427,8 @@ long b3_mindot_large( const float *vv, const float *vec, unsigned long count, fl long b3_mindot_large( const float *vv, const float *vec, unsigned long count, float *dotResult ) { const float4 *vertices = (const float4*) vv; - static const unsigned char indexTable[16] = {-1, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0 }; + static const unsigned char indexTable[16] = {(unsigned char)-1, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0 }; + float4 dotmin = b3Assign128( B3_INFINITY, B3_INFINITY, B3_INFINITY, B3_INFINITY ); float4 vvec = _mm_loadu_ps( vec ); float4 vHi = b3CastiTo128f(_mm_shuffle_epi32( b3CastfTo128i( vvec), 0xaa )); /// zzzz diff --git a/test/TestBullet3OpenCL/main.cpp b/test/TestBullet3OpenCL/main.cpp index 4a18ce702..aee2434c2 100644 --- a/test/TestBullet3OpenCL/main.cpp +++ b/test/TestBullet3OpenCL/main.cpp @@ -6,7 +6,7 @@ void myerrorprintf(const char* msg) { - printf(msg); + printf("%s",msg); } static bool sVerboseWarning = true; @@ -16,7 +16,7 @@ void mywarningprintf(const char* msg) if (sVerboseWarning) { //OutputDebugStringA(msg); - printf(msg); + printf("%s",msg); } } @@ -27,7 +27,7 @@ void myprintf(const char* msg) if (sVerbosePrintf) { //OutputDebugStringA(msg); - printf(msg); + printf("%s",msg); } }