Merge pull request #276 from erwincoumans/master
Enable CMake support for Windows Phone (_WIN32+_M_ARM) and Windows Store...
This commit is contained in:
@@ -24,10 +24,15 @@ OPTION(USE_DOUBLE_PRECISION "Use double precision" OFF)
|
|||||||
OPTION(USE_GRAPHICAL_BENCHMARK "Use Graphical Benchmark" ON)
|
OPTION(USE_GRAPHICAL_BENCHMARK "Use Graphical Benchmark" ON)
|
||||||
OPTION(BUILD_SHARED_LIBS "Use shared libraries" OFF)
|
OPTION(BUILD_SHARED_LIBS "Use shared libraries" OFF)
|
||||||
|
|
||||||
OPTION(USE_MSVC_RUNTIME_LIBRARY_DLL "Use MSVC Runtime Library DLL (/MD or /MDd)" OFF)
|
|
||||||
OPTION(USE_MSVC_INCREMENTAL_LINKING "Use MSVC Incremental Linking" OFF)
|
OPTION(USE_MSVC_INCREMENTAL_LINKING "Use MSVC Incremental Linking" OFF)
|
||||||
OPTION(USE_CUSTOM_VECTOR_MATH "Use custom vectormath library" OFF)
|
OPTION(USE_CUSTOM_VECTOR_MATH "Use custom vectormath library" OFF)
|
||||||
|
|
||||||
|
#statically linking VC++ isn't supported for WindowsPhone/WindowsStore
|
||||||
|
IF (CMAKE_SYSTEM_NAME STREQUAL WindowsPhone OR CMAKE_SYSTEM_NAME STREQUAL WindowsStore)
|
||||||
|
OPTION(USE_MSVC_RUNTIME_LIBRARY_DLL "Use MSVC Runtime Library DLL (/MD or /MDd)" ON)
|
||||||
|
ELSE ()
|
||||||
|
OPTION(USE_MSVC_RUNTIME_LIBRARY_DLL "Use MSVC Runtime Library DLL (/MD or /MDd)" OFF)
|
||||||
|
ENDIF (CMAKE_SYSTEM_NAME STREQUAL WindowsPhone OR CMAKE_SYSTEM_NAME STREQUAL WindowsStore)
|
||||||
|
|
||||||
#SET(CMAKE_EXE_LINKER_FLAGS_INIT "/STACK:10000000 /INCREMENTAL:NO")
|
#SET(CMAKE_EXE_LINKER_FLAGS_INIT "/STACK:10000000 /INCREMENTAL:NO")
|
||||||
#SET(CMAKE_EXE_LINKER_FLAGS "/STACK:10000000 /INCREMENTAL:NO")
|
#SET(CMAKE_EXE_LINKER_FLAGS "/STACK:10000000 /INCREMENTAL:NO")
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ struct btClockData
|
|||||||
|
|
||||||
#ifdef BT_USE_WINDOWS_TIMERS
|
#ifdef BT_USE_WINDOWS_TIMERS
|
||||||
LARGE_INTEGER mClockFrequency;
|
LARGE_INTEGER mClockFrequency;
|
||||||
DWORD mStartTick;
|
LONGLONG mStartTick;
|
||||||
LONGLONG mPrevElapsedTime;
|
LONGLONG mPrevElapsedTime;
|
||||||
LARGE_INTEGER mStartTime;
|
LARGE_INTEGER mStartTime;
|
||||||
#else
|
#else
|
||||||
@@ -105,7 +105,7 @@ void btClock::reset()
|
|||||||
{
|
{
|
||||||
#ifdef BT_USE_WINDOWS_TIMERS
|
#ifdef BT_USE_WINDOWS_TIMERS
|
||||||
QueryPerformanceCounter(&m_data->mStartTime);
|
QueryPerformanceCounter(&m_data->mStartTime);
|
||||||
m_data->mStartTick = GetTickCount();
|
m_data->mStartTick = GetTickCount64();
|
||||||
m_data->mPrevElapsedTime = 0;
|
m_data->mPrevElapsedTime = 0;
|
||||||
#else
|
#else
|
||||||
#ifdef __CELLOS_LV2__
|
#ifdef __CELLOS_LV2__
|
||||||
@@ -134,9 +134,9 @@ unsigned long int btClock::getTimeMilliseconds()
|
|||||||
unsigned long msecTicks = (unsigned long)(1000 * elapsedTime /
|
unsigned long msecTicks = (unsigned long)(1000 * elapsedTime /
|
||||||
m_data->mClockFrequency.QuadPart);
|
m_data->mClockFrequency.QuadPart);
|
||||||
// Check for unexpected leaps in the Win32 performance counter.
|
// Check for unexpected leaps in the Win32 performance counter.
|
||||||
// (This is caused by unexpected data across the PCI to ISA
|
// (This is caused by unexpected data across the PCI to ISA
|
||||||
// bridge, aka south bridge. See Microsoft KB274323.)
|
// bridge, aka south bridge. See Microsoft KB274323.)
|
||||||
unsigned long elapsedTicks = GetTickCount() - m_data->mStartTick;
|
unsigned long elapsedTicks = (unsigned long)(GetTickCount64() - m_data->mStartTick);
|
||||||
signed long msecOff = (signed long)(msecTicks - elapsedTicks);
|
signed long msecOff = (signed long)(msecTicks - elapsedTicks);
|
||||||
if (msecOff < -100 || msecOff > 100)
|
if (msecOff < -100 || msecOff > 100)
|
||||||
{
|
{
|
||||||
@@ -194,7 +194,7 @@ unsigned long int btClock::getTimeMicroseconds()
|
|||||||
// Check for unexpected leaps in the Win32 performance counter.
|
// Check for unexpected leaps in the Win32 performance counter.
|
||||||
// (This is caused by unexpected data across the PCI to ISA
|
// (This is caused by unexpected data across the PCI to ISA
|
||||||
// bridge, aka south bridge. See Microsoft KB274323.)
|
// bridge, aka south bridge. See Microsoft KB274323.)
|
||||||
unsigned long elapsedTicks = GetTickCount() - m_data->mStartTick;
|
unsigned long elapsedTicks = (unsigned long)(GetTickCount64() - m_data->mStartTick);
|
||||||
signed long msecOff = (signed long)(msecTicks - elapsedTicks);
|
signed long msecOff = (signed long)(msecTicks - elapsedTicks);
|
||||||
if (msecOff < -100 || msecOff > 100)
|
if (msecOff < -100 || msecOff > 100)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -48,6 +48,11 @@ inline int btGetVersion()
|
|||||||
#define ATTRIBUTE_ALIGNED16(a) a
|
#define ATTRIBUTE_ALIGNED16(a) a
|
||||||
#define ATTRIBUTE_ALIGNED64(a) a
|
#define ATTRIBUTE_ALIGNED64(a) a
|
||||||
#define ATTRIBUTE_ALIGNED128(a) a
|
#define ATTRIBUTE_ALIGNED128(a) a
|
||||||
|
#elif (_M_ARM)
|
||||||
|
#define SIMD_FORCE_INLINE __forceinline
|
||||||
|
#define ATTRIBUTE_ALIGNED16(a) __declspec() a
|
||||||
|
#define ATTRIBUTE_ALIGNED64(a) __declspec() a
|
||||||
|
#define ATTRIBUTE_ALIGNED128(a) __declspec () a
|
||||||
#else
|
#else
|
||||||
//#define BT_HAS_ALIGNED_ALLOCATOR
|
//#define BT_HAS_ALIGNED_ALLOCATOR
|
||||||
#pragma warning(disable : 4324) // disable padding warning
|
#pragma warning(disable : 4324) // disable padding warning
|
||||||
@@ -67,6 +72,7 @@ inline int btGetVersion()
|
|||||||
#define btFsel(a,b,c) __fsel((a),(b),(c))
|
#define btFsel(a,b,c) __fsel((a),(b),(c))
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
#if (!defined (_M_ARM) && WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP)//Do not turn SSE on for Windows Phone Emulators
|
||||||
#if (defined (_WIN32) && (_MSC_VER) && _MSC_VER >= 1400) && (!defined (BT_USE_DOUBLE_PRECISION))
|
#if (defined (_WIN32) && (_MSC_VER) && _MSC_VER >= 1400) && (!defined (BT_USE_DOUBLE_PRECISION))
|
||||||
#if _MSC_VER>1400
|
#if _MSC_VER>1400
|
||||||
#define BT_USE_SIMD_VECTOR3
|
#define BT_USE_SIMD_VECTOR3
|
||||||
@@ -88,6 +94,7 @@ inline int btGetVersion()
|
|||||||
//#define BT_USE_SSE_IN_API
|
//#define BT_USE_SSE_IN_API
|
||||||
#endif //BT_USE_SSE
|
#endif //BT_USE_SSE
|
||||||
#include <emmintrin.h>
|
#include <emmintrin.h>
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif//_XBOX
|
#endif//_XBOX
|
||||||
|
|||||||
Reference in New Issue
Block a user