mirror of
https://github.com/holub/mame
synced 2025-06-07 13:23:50 +03:00
updated bx (nw)
This commit is contained in:
parent
b900f66730
commit
a74a7a37ef
195
3rdparty/bx/include/bx/cpu.h
vendored
195
3rdparty/bx/include/bx/cpu.h
vendored
@ -25,8 +25,7 @@ extern "C" void _ReadWriteBarrier();
|
|||||||
# pragma intrinsic(_ReadBarrier)
|
# pragma intrinsic(_ReadBarrier)
|
||||||
# pragma intrinsic(_WriteBarrier)
|
# pragma intrinsic(_WriteBarrier)
|
||||||
# pragma intrinsic(_ReadWriteBarrier)
|
# pragma intrinsic(_ReadWriteBarrier)
|
||||||
# pragma intrinsic(_InterlockedIncrement)
|
# pragma intrinsic(_InterlockedExchangeAdd)
|
||||||
# pragma intrinsic(_InterlockedDecrement)
|
|
||||||
# pragma intrinsic(_InterlockedCompareExchange)
|
# pragma intrinsic(_InterlockedCompareExchange)
|
||||||
#endif // BX_COMPILER_MSVC
|
#endif // BX_COMPILER_MSVC
|
||||||
|
|
||||||
@ -77,27 +76,184 @@ namespace bx
|
|||||||
#endif // BX_COMPILER
|
#endif // BX_COMPILER
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the resulting incremented value.
|
template<typename Ty>
|
||||||
inline int32_t atomicInc(volatile void* _ptr)
|
inline Ty atomicFetchAndAdd(volatile Ty* _ptr, Ty _value);
|
||||||
|
|
||||||
|
template<typename Ty>
|
||||||
|
inline Ty atomicAddAndFetch(volatile Ty* _ptr, Ty _value);
|
||||||
|
|
||||||
|
template<typename Ty>
|
||||||
|
inline Ty atomicFetchAndSub(volatile Ty* _ptr, Ty _value);
|
||||||
|
|
||||||
|
template<typename Ty>
|
||||||
|
inline Ty atomicSubAndFetch(volatile Ty* _ptr, Ty _value);
|
||||||
|
|
||||||
|
template<typename Ty>
|
||||||
|
inline Ty atomicCompareAndSwap(volatile void* _ptr, Ty _old, Ty _new);
|
||||||
|
|
||||||
|
template<>
|
||||||
|
inline int32_t atomicCompareAndSwap(volatile void* _ptr, int32_t _old, int32_t _new);
|
||||||
|
|
||||||
|
template<>
|
||||||
|
inline int64_t atomicCompareAndSwap(volatile void* _ptr, int64_t _old, int64_t _new);
|
||||||
|
|
||||||
|
template<>
|
||||||
|
inline int32_t atomicFetchAndAdd<int32_t>(volatile int32_t* _ptr, int32_t _add)
|
||||||
{
|
{
|
||||||
#if BX_COMPILER_MSVC
|
#if BX_COMPILER_MSVC
|
||||||
return _InterlockedIncrement( (volatile LONG*)(_ptr) );
|
return _InterlockedExchangeAdd( (volatile long*)_ptr, _add);
|
||||||
#else
|
#else
|
||||||
return __sync_add_and_fetch( (volatile int32_t*)_ptr, 1);
|
return __sync_fetch_and_add(_ptr, _add);
|
||||||
#endif // BX_COMPILER
|
#endif // BX_COMPILER_
|
||||||
|
}
|
||||||
|
|
||||||
|
template<>
|
||||||
|
inline int64_t atomicFetchAndAdd<int64_t>(volatile int64_t* _ptr, int64_t _add)
|
||||||
|
{
|
||||||
|
#if BX_COMPILER_MSVC
|
||||||
|
# if _WIN32_WINNT >= 0x600
|
||||||
|
return _InterlockedExchangeAdd64( (volatile int64_t*)_ptr, _add);
|
||||||
|
# else
|
||||||
|
int64_t oldVal;
|
||||||
|
int64_t newVal = *(int64_t volatile*)_ptr;
|
||||||
|
do
|
||||||
|
{
|
||||||
|
oldVal = newVal;
|
||||||
|
newVal = atomicCompareAndSwap(_ptr, oldVal, newVal + _add);
|
||||||
|
|
||||||
|
} while (oldVal != newVal);
|
||||||
|
|
||||||
|
return oldVal;
|
||||||
|
# endif
|
||||||
|
#else
|
||||||
|
return __sync_fetch_and_add(_ptr, _add);
|
||||||
|
#endif // BX_COMPILER_
|
||||||
|
}
|
||||||
|
|
||||||
|
template<>
|
||||||
|
inline uint32_t atomicFetchAndAdd<uint32_t>(volatile uint32_t* _ptr, uint32_t _add)
|
||||||
|
{
|
||||||
|
return uint32_t(atomicFetchAndAdd<int32_t>( (volatile int32_t*)_ptr, int32_t(_add) ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
template<>
|
||||||
|
inline uint64_t atomicFetchAndAdd<uint64_t>(volatile uint64_t* _ptr, uint64_t _add)
|
||||||
|
{
|
||||||
|
return uint64_t(atomicFetchAndAdd<int64_t>( (volatile int64_t*)_ptr, int64_t(_add) ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
template<>
|
||||||
|
inline int32_t atomicAddAndFetch<int32_t>(volatile int32_t* _ptr, int32_t _add)
|
||||||
|
{
|
||||||
|
#if BX_COMPILER_MSVC
|
||||||
|
return atomicFetchAndAdd(_ptr, _add) + _add;
|
||||||
|
#else
|
||||||
|
return __sync_add_and_fetch(_ptr, _add);
|
||||||
|
#endif // BX_COMPILER_
|
||||||
|
}
|
||||||
|
|
||||||
|
template<>
|
||||||
|
inline int64_t atomicAddAndFetch<int64_t>(volatile int64_t* _ptr, int64_t _add)
|
||||||
|
{
|
||||||
|
#if BX_COMPILER_MSVC
|
||||||
|
return atomicFetchAndAdd(_ptr, _add) + _add;
|
||||||
|
#else
|
||||||
|
return __sync_add_and_fetch(_ptr, _add);
|
||||||
|
#endif // BX_COMPILER_
|
||||||
|
}
|
||||||
|
|
||||||
|
template<>
|
||||||
|
inline uint32_t atomicAddAndFetch<uint32_t>(volatile uint32_t* _ptr, uint32_t _add)
|
||||||
|
{
|
||||||
|
return uint32_t(atomicAddAndFetch<int32_t>( (volatile int32_t*)_ptr, int32_t(_add) ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
template<>
|
||||||
|
inline uint64_t atomicAddAndFetch<uint64_t>(volatile uint64_t* _ptr, uint64_t _add)
|
||||||
|
{
|
||||||
|
return uint64_t(atomicAddAndFetch<int64_t>( (volatile int64_t*)_ptr, int64_t(_add) ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
template<>
|
||||||
|
inline int32_t atomicFetchAndSub<int32_t>(volatile int32_t* _ptr, int32_t _sub)
|
||||||
|
{
|
||||||
|
#if BX_COMPILER_MSVC
|
||||||
|
return atomicFetchAndAdd(_ptr, -_sub);
|
||||||
|
#else
|
||||||
|
return __sync_fetch_and_sub(_ptr, _sub);
|
||||||
|
#endif // BX_COMPILER_
|
||||||
|
}
|
||||||
|
|
||||||
|
template<>
|
||||||
|
inline int64_t atomicFetchAndSub<int64_t>(volatile int64_t* _ptr, int64_t _sub)
|
||||||
|
{
|
||||||
|
#if BX_COMPILER_MSVC
|
||||||
|
return atomicFetchAndAdd(_ptr, -_sub);
|
||||||
|
#else
|
||||||
|
return __sync_fetch_and_sub(_ptr, _sub);
|
||||||
|
#endif // BX_COMPILER_
|
||||||
|
}
|
||||||
|
|
||||||
|
template<>
|
||||||
|
inline uint32_t atomicFetchAndSub<uint32_t>(volatile uint32_t* _ptr, uint32_t _add)
|
||||||
|
{
|
||||||
|
return uint32_t(atomicFetchAndSub<int32_t>( (volatile int32_t*)_ptr, int32_t(_add) ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
template<>
|
||||||
|
inline uint64_t atomicFetchAndSub<uint64_t>(volatile uint64_t* _ptr, uint64_t _add)
|
||||||
|
{
|
||||||
|
return uint64_t(atomicFetchAndSub<int64_t>( (volatile int64_t*)_ptr, int64_t(_add) ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
template<>
|
||||||
|
inline int32_t atomicSubAndFetch<int32_t>(volatile int32_t* _ptr, int32_t _sub)
|
||||||
|
{
|
||||||
|
#if BX_COMPILER_MSVC
|
||||||
|
return atomicFetchAndAdd(_ptr, -_sub) - _sub;
|
||||||
|
#else
|
||||||
|
return __sync_sub_and_fetch(_ptr, _sub);
|
||||||
|
#endif // BX_COMPILER_
|
||||||
|
}
|
||||||
|
|
||||||
|
template<>
|
||||||
|
inline int64_t atomicSubAndFetch<int64_t>(volatile int64_t* _ptr, int64_t _sub)
|
||||||
|
{
|
||||||
|
#if BX_COMPILER_MSVC
|
||||||
|
return atomicFetchAndAdd(_ptr, -_sub) - _sub;
|
||||||
|
#else
|
||||||
|
return __sync_sub_and_fetch(_ptr, _sub);
|
||||||
|
#endif // BX_COMPILER_
|
||||||
|
}
|
||||||
|
|
||||||
|
template<>
|
||||||
|
inline uint32_t atomicSubAndFetch<uint32_t>(volatile uint32_t* _ptr, uint32_t _add)
|
||||||
|
{
|
||||||
|
return uint32_t(atomicSubAndFetch<int32_t>( (volatile int32_t*)_ptr, int32_t(_add) ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
template<>
|
||||||
|
inline uint64_t atomicSubAndFetch<uint64_t>(volatile uint64_t* _ptr, uint64_t _add)
|
||||||
|
{
|
||||||
|
return uint64_t(atomicSubAndFetch<int64_t>( (volatile int64_t*)_ptr, int64_t(_add) ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Returns the resulting incremented value.
|
||||||
|
template<typename Ty>
|
||||||
|
inline Ty atomicInc(volatile Ty* _ptr)
|
||||||
|
{
|
||||||
|
return atomicAddAndFetch(_ptr, Ty(1) );
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the resulting decremented value.
|
/// Returns the resulting decremented value.
|
||||||
inline int32_t atomicDec(volatile void* _ptr)
|
template<typename Ty>
|
||||||
|
inline Ty atomicDec(volatile Ty* _ptr)
|
||||||
{
|
{
|
||||||
#if BX_COMPILER_MSVC
|
return atomicSubAndFetch(_ptr, Ty(1) );
|
||||||
return _InterlockedDecrement( (volatile LONG*)(_ptr) );
|
|
||||||
#else
|
|
||||||
return __sync_sub_and_fetch( (volatile int32_t*)_ptr, 1);
|
|
||||||
#endif // BX_COMPILER
|
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
|
template<>
|
||||||
inline int32_t atomicCompareAndSwap(volatile void* _ptr, int32_t _old, int32_t _new)
|
inline int32_t atomicCompareAndSwap(volatile void* _ptr, int32_t _old, int32_t _new)
|
||||||
{
|
{
|
||||||
#if BX_COMPILER_MSVC
|
#if BX_COMPILER_MSVC
|
||||||
@ -107,11 +263,22 @@ namespace bx
|
|||||||
#endif // BX_COMPILER
|
#endif // BX_COMPILER
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///
|
||||||
|
template<>
|
||||||
|
inline int64_t atomicCompareAndSwap(volatile void* _ptr, int64_t _old, int64_t _new)
|
||||||
|
{
|
||||||
|
#if BX_COMPILER_MSVC
|
||||||
|
return _InterlockedCompareExchange64( (volatile LONG64*)(_ptr), _new, _old);
|
||||||
|
#else
|
||||||
|
return __sync_val_compare_and_swap( (volatile int64_t*)_ptr, _old, _new);
|
||||||
|
#endif // BX_COMPILER
|
||||||
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
inline void* atomicExchangePtr(void** _ptr, void* _new)
|
inline void* atomicExchangePtr(void** _ptr, void* _new)
|
||||||
{
|
{
|
||||||
#if BX_COMPILER_MSVC
|
#if BX_COMPILER_MSVC
|
||||||
return InterlockedExchangePointer(_ptr, _new); /* VS2012 no intrinsics */
|
return InterlockedExchangePointer(_ptr, _new);
|
||||||
#else
|
#else
|
||||||
return __sync_lock_test_and_set(_ptr, _new);
|
return __sync_lock_test_and_set(_ptr, _new);
|
||||||
#endif // BX_COMPILER
|
#endif // BX_COMPILER
|
||||||
|
5
3rdparty/bx/include/bx/debug.h
vendored
5
3rdparty/bx/include/bx/debug.h
vendored
@ -51,7 +51,10 @@ namespace bx
|
|||||||
inline void debugOutput(const char* _out)
|
inline void debugOutput(const char* _out)
|
||||||
{
|
{
|
||||||
#if BX_PLATFORM_ANDROID
|
#if BX_PLATFORM_ANDROID
|
||||||
__android_log_write(ANDROID_LOG_DEBUG, "", _out);
|
# ifndef BX_ANDROID_LOG_TAG
|
||||||
|
# define BX_ANDROID_LOG_TAG ""
|
||||||
|
# endif // BX_ANDROID_LOG_TAG
|
||||||
|
__android_log_write(ANDROID_LOG_DEBUG, BX_ANDROID_LOG_TAG, _out);
|
||||||
#elif BX_PLATFORM_WINDOWS || BX_PLATFORM_WINRT || BX_PLATFORM_XBOX360
|
#elif BX_PLATFORM_WINDOWS || BX_PLATFORM_WINRT || BX_PLATFORM_XBOX360
|
||||||
OutputDebugStringA(_out);
|
OutputDebugStringA(_out);
|
||||||
#elif BX_PLATFORM_IOS || BX_PLATFORM_OSX
|
#elif BX_PLATFORM_IOS || BX_PLATFORM_OSX
|
||||||
|
29
3rdparty/bx/include/bx/macros.h
vendored
29
3rdparty/bx/include/bx/macros.h
vendored
@ -48,6 +48,18 @@
|
|||||||
|
|
||||||
#define BX_ALIGNOF(_type) __alignof(_type)
|
#define BX_ALIGNOF(_type) __alignof(_type)
|
||||||
|
|
||||||
|
#if defined(__has_feature)
|
||||||
|
# define BX_CLANG_HAS_FEATURE(_x) __has_feature(_x)
|
||||||
|
#else
|
||||||
|
# define BX_CLANG_HAS_FEATURE(_x) 0
|
||||||
|
#endif // defined(__has_feature)
|
||||||
|
|
||||||
|
#if defined(__has_extension)
|
||||||
|
# define BX_CLANG_HAS_EXTENSION(_x) __has_extension(_x)
|
||||||
|
#else
|
||||||
|
# define BX_CLANG_HAS_EXTENSION(_x) 0
|
||||||
|
#endif // defined(__has_extension)
|
||||||
|
|
||||||
#if BX_COMPILER_GCC || BX_COMPILER_CLANG
|
#if BX_COMPILER_GCC || BX_COMPILER_CLANG
|
||||||
# define BX_ALIGN_DECL(_align, _decl) _decl __attribute__( (aligned(_align) ) )
|
# define BX_ALIGN_DECL(_align, _decl) _decl __attribute__( (aligned(_align) ) )
|
||||||
# define BX_ALLOW_UNUSED __attribute__( (unused) )
|
# define BX_ALLOW_UNUSED __attribute__( (unused) )
|
||||||
@ -60,11 +72,12 @@
|
|||||||
# define BX_NO_VTABLE
|
# define BX_NO_VTABLE
|
||||||
# define BX_OVERRIDE
|
# define BX_OVERRIDE
|
||||||
# define BX_PRINTF_ARGS(_format, _args) __attribute__ ( (format(__printf__, _format, _args) ) )
|
# define BX_PRINTF_ARGS(_format, _args) __attribute__ ( (format(__printf__, _format, _args) ) )
|
||||||
# if BX_COMPILER_CLANG && (BX_PLATFORM_OSX || BX_PLATFORM_IOS)
|
# if BX_CLANG_HAS_FEATURE(cxx_thread_local)
|
||||||
# define BX_THREAD /* not supported right now */
|
# define BX_THREAD_LOCAL __thread
|
||||||
# else
|
|
||||||
# define BX_THREAD __thread
|
|
||||||
# endif // BX_COMPILER_CLANG
|
# endif // BX_COMPILER_CLANG
|
||||||
|
# if BX_COMPILER_GCC >= 40200
|
||||||
|
# define BX_THREAD_LOCAL __thread
|
||||||
|
# endif // BX_COMPILER_GCC
|
||||||
# define BX_ATTRIBUTE(_x) __attribute__( (_x) )
|
# define BX_ATTRIBUTE(_x) __attribute__( (_x) )
|
||||||
# if BX_COMPILER_MSVC_COMPATIBLE
|
# if BX_COMPILER_MSVC_COMPATIBLE
|
||||||
# define __stdcall
|
# define __stdcall
|
||||||
@ -81,18 +94,12 @@
|
|||||||
# define BX_NO_VTABLE __declspec(novtable)
|
# define BX_NO_VTABLE __declspec(novtable)
|
||||||
# define BX_OVERRIDE override
|
# define BX_OVERRIDE override
|
||||||
# define BX_PRINTF_ARGS(_format, _args)
|
# define BX_PRINTF_ARGS(_format, _args)
|
||||||
# define BX_THREAD __declspec(thread)
|
# define BX_THREAD_LOCAL __declspec(thread)
|
||||||
# define BX_ATTRIBUTE(_x)
|
# define BX_ATTRIBUTE(_x)
|
||||||
#else
|
#else
|
||||||
# error "Unknown BX_COMPILER_?"
|
# error "Unknown BX_COMPILER_?"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__has_extension)
|
|
||||||
# define BX_CLANG_HAS_EXTENSION(_x) __has_extension(_x)
|
|
||||||
#else
|
|
||||||
# define BX_CLANG_HAS_EXTENSION(_x) 0
|
|
||||||
#endif // defined(__has_extension)
|
|
||||||
|
|
||||||
// #define BX_STATIC_ASSERT(_condition, ...) static_assert(_condition, "" __VA_ARGS__)
|
// #define BX_STATIC_ASSERT(_condition, ...) static_assert(_condition, "" __VA_ARGS__)
|
||||||
#define BX_STATIC_ASSERT(_condition, ...) typedef char BX_CONCATENATE(BX_STATIC_ASSERT_, __LINE__)[1][(_condition)] BX_ATTRIBUTE(unused)
|
#define BX_STATIC_ASSERT(_condition, ...) typedef char BX_CONCATENATE(BX_STATIC_ASSERT_, __LINE__)[1][(_condition)] BX_ATTRIBUTE(unused)
|
||||||
|
|
||||||
|
37
3rdparty/bx/include/bx/mpscqueue.h
vendored
37
3rdparty/bx/include/bx/mpscqueue.h
vendored
@ -29,9 +29,8 @@ namespace bx
|
|||||||
|
|
||||||
void push(Ty* _ptr) // producer only
|
void push(Ty* _ptr) // producer only
|
||||||
{
|
{
|
||||||
m_write.lock();
|
LwMutexScope $(m_write);
|
||||||
m_queue.push(_ptr);
|
m_queue.push(_ptr);
|
||||||
m_write.unlock();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Ty* peek() // consumer only
|
Ty* peek() // consumer only
|
||||||
@ -49,6 +48,40 @@ namespace bx
|
|||||||
SpScUnboundedQueue<Ty> m_queue;
|
SpScUnboundedQueue<Ty> m_queue;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template <typename Ty>
|
||||||
|
class MpScUnboundedBlockingQueue
|
||||||
|
{
|
||||||
|
BX_CLASS(MpScUnboundedBlockingQueue
|
||||||
|
, NO_COPY
|
||||||
|
, NO_ASSIGNMENT
|
||||||
|
);
|
||||||
|
|
||||||
|
public:
|
||||||
|
MpScUnboundedBlockingQueue()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
~MpScUnboundedBlockingQueue()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void push(Ty* _ptr) // producer only
|
||||||
|
{
|
||||||
|
m_queue.push(_ptr);
|
||||||
|
m_sem.post();
|
||||||
|
}
|
||||||
|
|
||||||
|
Ty* pop() // consumer only
|
||||||
|
{
|
||||||
|
m_sem.wait();
|
||||||
|
return m_queue.pop();
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
MpScUnboundedQueue<Ty> m_queue;
|
||||||
|
Semaphore m_sem;
|
||||||
|
};
|
||||||
|
|
||||||
} // namespace bx
|
} // namespace bx
|
||||||
|
|
||||||
#endif // BX_MPSCQUEUE_H_HEADER_GUARD
|
#endif // BX_MPSCQUEUE_H_HEADER_GUARD
|
||||||
|
8
3rdparty/bx/include/bx/mutex.h
vendored
8
3rdparty/bx/include/bx/mutex.h
vendored
@ -69,7 +69,13 @@ namespace bx
|
|||||||
public:
|
public:
|
||||||
Mutex()
|
Mutex()
|
||||||
{
|
{
|
||||||
pthread_mutex_init(&m_handle, NULL);
|
pthread_mutexattr_t attr;
|
||||||
|
#if BX_PLATFORM_WINDOWS || BX_PLATFORM_XBOX360 || BX_PLATFORM_WINRT
|
||||||
|
#else
|
||||||
|
pthread_mutexattr_init(&attr);
|
||||||
|
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
|
||||||
|
#endif // BX_PLATFORM_WINDOWS || BX_PLATFORM_XBOX360 || BX_PLATFORM_WINRT
|
||||||
|
pthread_mutex_init(&m_handle, &attr);
|
||||||
}
|
}
|
||||||
|
|
||||||
~Mutex()
|
~Mutex()
|
||||||
|
6
3rdparty/bx/include/bx/os.h
vendored
6
3rdparty/bx/include/bx/os.h
vendored
@ -15,21 +15,17 @@
|
|||||||
#elif BX_PLATFORM_ANDROID \
|
#elif BX_PLATFORM_ANDROID \
|
||||||
|| BX_PLATFORM_EMSCRIPTEN \
|
|| BX_PLATFORM_EMSCRIPTEN \
|
||||||
|| BX_PLATFORM_FREEBSD \
|
|| BX_PLATFORM_FREEBSD \
|
||||||
|| BX_PLATFORM_NETBSD \
|
|
||||||
|| BX_PLATFORM_IOS \
|
|| BX_PLATFORM_IOS \
|
||||||
|| BX_PLATFORM_LINUX \
|
|| BX_PLATFORM_LINUX \
|
||||||
|| BX_PLATFORM_NACL \
|
|| BX_PLATFORM_NACL \
|
||||||
|| BX_PLATFORM_NETBSD \
|
|
||||||
|| BX_PLATFORM_OSX \
|
|| BX_PLATFORM_OSX \
|
||||||
|| BX_PLATFORM_PS4 \
|
|| BX_PLATFORM_PS4 \
|
||||||
|| BX_PLATFORM_RPI
|
|| BX_PLATFORM_RPI
|
||||||
|
|
||||||
# include <sched.h> // sched_yield
|
# include <sched.h> // sched_yield
|
||||||
# if BX_PLATFORM_FREEBSD \
|
# if BX_PLATFORM_FREEBSD \
|
||||||
|| BX_PLATFORM_NETBSD \
|
|
||||||
|| BX_PLATFORM_IOS \
|
|| BX_PLATFORM_IOS \
|
||||||
|| BX_PLATFORM_NACL \
|
|| BX_PLATFORM_NACL \
|
||||||
|| BX_PLATFORM_NETBSD \
|
|
||||||
|| BX_PLATFORM_OSX \
|
|| BX_PLATFORM_OSX \
|
||||||
|| BX_PLATFORM_PS4
|
|| BX_PLATFORM_PS4
|
||||||
# include <pthread.h> // mach_port_t
|
# include <pthread.h> // mach_port_t
|
||||||
@ -107,7 +103,7 @@ namespace bx
|
|||||||
return (pid_t)::syscall(SYS_gettid);
|
return (pid_t)::syscall(SYS_gettid);
|
||||||
#elif BX_PLATFORM_IOS || BX_PLATFORM_OSX
|
#elif BX_PLATFORM_IOS || BX_PLATFORM_OSX
|
||||||
return (mach_port_t)::pthread_mach_thread_np(pthread_self() );
|
return (mach_port_t)::pthread_mach_thread_np(pthread_self() );
|
||||||
#elif BX_PLATFORM_FREEBSD || BX_PLATFORM_NACL || BX_PLATFORM_NETBSD
|
#elif BX_PLATFORM_FREEBSD || BX_PLATFORM_NACL
|
||||||
// Casting __nc_basic_thread_data*... need better way to do this.
|
// Casting __nc_basic_thread_data*... need better way to do this.
|
||||||
return *(uint32_t*)::pthread_self();
|
return *(uint32_t*)::pthread_self();
|
||||||
#else
|
#else
|
||||||
|
13
3rdparty/bx/include/bx/platform.h
vendored
13
3rdparty/bx/include/bx/platform.h
vendored
@ -15,11 +15,9 @@
|
|||||||
#define BX_PLATFORM_ANDROID 0
|
#define BX_PLATFORM_ANDROID 0
|
||||||
#define BX_PLATFORM_EMSCRIPTEN 0
|
#define BX_PLATFORM_EMSCRIPTEN 0
|
||||||
#define BX_PLATFORM_FREEBSD 0
|
#define BX_PLATFORM_FREEBSD 0
|
||||||
#define BX_PLATFORM_NETBSD 0
|
|
||||||
#define BX_PLATFORM_IOS 0
|
#define BX_PLATFORM_IOS 0
|
||||||
#define BX_PLATFORM_LINUX 0
|
#define BX_PLATFORM_LINUX 0
|
||||||
#define BX_PLATFORM_NACL 0
|
#define BX_PLATFORM_NACL 0
|
||||||
#define BX_PLATFORM_NETBSD 0
|
|
||||||
#define BX_PLATFORM_OSX 0
|
#define BX_PLATFORM_OSX 0
|
||||||
#define BX_PLATFORM_PS4 0
|
#define BX_PLATFORM_PS4 0
|
||||||
#define BX_PLATFORM_QNX 0
|
#define BX_PLATFORM_QNX 0
|
||||||
@ -171,7 +169,7 @@
|
|||||||
#elif defined(__linux__)
|
#elif defined(__linux__)
|
||||||
# undef BX_PLATFORM_LINUX
|
# undef BX_PLATFORM_LINUX
|
||||||
# define BX_PLATFORM_LINUX 1
|
# define BX_PLATFORM_LINUX 1
|
||||||
#elif defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__)
|
#elif defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) || defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__)
|
||||||
# undef BX_PLATFORM_IOS
|
# undef BX_PLATFORM_IOS
|
||||||
# define BX_PLATFORM_IOS 1
|
# define BX_PLATFORM_IOS 1
|
||||||
#elif defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__)
|
#elif defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__)
|
||||||
@ -189,9 +187,6 @@
|
|||||||
#elif defined(__FreeBSD__)
|
#elif defined(__FreeBSD__)
|
||||||
# undef BX_PLATFORM_FREEBSD
|
# undef BX_PLATFORM_FREEBSD
|
||||||
# define BX_PLATFORM_FREEBSD 1
|
# define BX_PLATFORM_FREEBSD 1
|
||||||
#elif defined(__NetBSD__)
|
|
||||||
# undef BX_PLATFORM_NETBSD
|
|
||||||
# define BX_PLATFORM_NETBSD 1
|
|
||||||
#else
|
#else
|
||||||
# error "BX_PLATFORM_* is not defined!"
|
# error "BX_PLATFORM_* is not defined!"
|
||||||
#endif //
|
#endif //
|
||||||
@ -200,11 +195,9 @@
|
|||||||
|| BX_PLATFORM_ANDROID \
|
|| BX_PLATFORM_ANDROID \
|
||||||
|| BX_PLATFORM_EMSCRIPTEN \
|
|| BX_PLATFORM_EMSCRIPTEN \
|
||||||
|| BX_PLATFORM_FREEBSD \
|
|| BX_PLATFORM_FREEBSD \
|
||||||
|| BX_PLATFORM_NETBSD \
|
|
||||||
|| BX_PLATFORM_IOS \
|
|| BX_PLATFORM_IOS \
|
||||||
|| BX_PLATFORM_LINUX \
|
|| BX_PLATFORM_LINUX \
|
||||||
|| BX_PLATFORM_NACL \
|
|| BX_PLATFORM_NACL \
|
||||||
|| BX_PLATFORM_NETBSD \
|
|
||||||
|| BX_PLATFORM_OSX \
|
|| BX_PLATFORM_OSX \
|
||||||
|| BX_PLATFORM_QNX \
|
|| BX_PLATFORM_QNX \
|
||||||
|| BX_PLATFORM_PS4 \
|
|| BX_PLATFORM_PS4 \
|
||||||
@ -251,8 +244,6 @@
|
|||||||
BX_STRINGIZE(__EMSCRIPTEN_tiny__)
|
BX_STRINGIZE(__EMSCRIPTEN_tiny__)
|
||||||
#elif BX_PLATFORM_FREEBSD
|
#elif BX_PLATFORM_FREEBSD
|
||||||
# define BX_PLATFORM_NAME "FreeBSD"
|
# define BX_PLATFORM_NAME "FreeBSD"
|
||||||
#elif BX_PLATFORM_NETBSD
|
|
||||||
# define BX_PLATFORM_NAME "NetBSD"
|
|
||||||
#elif BX_PLATFORM_IOS
|
#elif BX_PLATFORM_IOS
|
||||||
# define BX_PLATFORM_NAME "iOS"
|
# define BX_PLATFORM_NAME "iOS"
|
||||||
#elif BX_PLATFORM_LINUX
|
#elif BX_PLATFORM_LINUX
|
||||||
@ -260,8 +251,6 @@
|
|||||||
#elif BX_PLATFORM_NACL
|
#elif BX_PLATFORM_NACL
|
||||||
# define BX_PLATFORM_NAME "NaCl " \
|
# define BX_PLATFORM_NAME "NaCl " \
|
||||||
BX_STRINGIZE(BX_PLATFORM_NACL)
|
BX_STRINGIZE(BX_PLATFORM_NACL)
|
||||||
#elif BX_PLATFORM_NETBSD
|
|
||||||
# define BX_PLATFORM_NAME "NetBSD"
|
|
||||||
#elif BX_PLATFORM_OSX
|
#elif BX_PLATFORM_OSX
|
||||||
# define BX_PLATFORM_NAME "OSX"
|
# define BX_PLATFORM_NAME "OSX"
|
||||||
#elif BX_PLATFORM_PS4
|
#elif BX_PLATFORM_PS4
|
||||||
|
4
3rdparty/bx/include/bx/thread.h
vendored
4
3rdparty/bx/include/bx/thread.h
vendored
@ -260,7 +260,7 @@ namespace bx
|
|||||||
uint32_t m_id;
|
uint32_t m_id;
|
||||||
};
|
};
|
||||||
|
|
||||||
#elif !(BX_PLATFORM_WINRT)
|
#elif !BX_PLATFORM_WINRT
|
||||||
|
|
||||||
class TlsData
|
class TlsData
|
||||||
{
|
{
|
||||||
@ -291,7 +291,7 @@ namespace bx
|
|||||||
private:
|
private:
|
||||||
pthread_key_t m_id;
|
pthread_key_t m_id;
|
||||||
};
|
};
|
||||||
#endif // BX_PLATFORM_WINDOWS
|
#endif // BX_PLATFORM_*
|
||||||
|
|
||||||
} // namespace bx
|
} // namespace bx
|
||||||
|
|
||||||
|
157
3rdparty/bx/scripts/toolchain.lua
vendored
157
3rdparty/bx/scripts/toolchain.lua
vendored
@ -21,8 +21,12 @@ function toolchain(_buildDir, _libDir)
|
|||||||
{ "linux-gcc", "Linux (GCC compiler)" },
|
{ "linux-gcc", "Linux (GCC compiler)" },
|
||||||
{ "linux-gcc-5", "Linux (GCC-5 compiler)" },
|
{ "linux-gcc-5", "Linux (GCC-5 compiler)" },
|
||||||
{ "linux-clang", "Linux (Clang compiler)" },
|
{ "linux-clang", "Linux (Clang compiler)" },
|
||||||
|
{ "linux-mips-gcc", "Linux (MIPS, GCC compiler)" },
|
||||||
|
{ "linux-arm-gcc", "Linux (ARM, GCC compiler)" },
|
||||||
{ "ios-arm", "iOS - ARM" },
|
{ "ios-arm", "iOS - ARM" },
|
||||||
{ "ios-simulator", "iOS - Simulator" },
|
{ "ios-simulator", "iOS - Simulator" },
|
||||||
|
{ "tvos-arm64", "tvOS - ARM64" },
|
||||||
|
{ "tvos-simulator", "tvOS - Simulator" },
|
||||||
{ "mingw-gcc", "MinGW" },
|
{ "mingw-gcc", "MinGW" },
|
||||||
{ "mingw-clang", "MinGW (clang compiler)" },
|
{ "mingw-clang", "MinGW (clang compiler)" },
|
||||||
{ "nacl", "Native Client" },
|
{ "nacl", "Native Client" },
|
||||||
@ -60,6 +64,7 @@ function toolchain(_buildDir, _libDir)
|
|||||||
allowed = {
|
allowed = {
|
||||||
{ "osx", "OSX" },
|
{ "osx", "OSX" },
|
||||||
{ "ios", "iOS" },
|
{ "ios", "iOS" },
|
||||||
|
{ "tvos", "tvOS" },
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -75,6 +80,12 @@ function toolchain(_buildDir, _libDir)
|
|||||||
description = "Set iOS target version (default: 8.0).",
|
description = "Set iOS target version (default: 8.0).",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
newoption {
|
||||||
|
trigger = "with-tvos",
|
||||||
|
value = "#",
|
||||||
|
description = "Set tvOS target version (default: 9.0).",
|
||||||
|
}
|
||||||
|
|
||||||
-- Avoid error when invoking genie --help.
|
-- Avoid error when invoking genie --help.
|
||||||
if (_ACTION == nil) then return false end
|
if (_ACTION == nil) then return false end
|
||||||
|
|
||||||
@ -94,6 +105,11 @@ function toolchain(_buildDir, _libDir)
|
|||||||
iosPlatform = _OPTIONS["with-ios"]
|
iosPlatform = _OPTIONS["with-ios"]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local tvosPlatform = ""
|
||||||
|
if _OPTIONS["with-tvos"] then
|
||||||
|
tvosPlatform = _OPTIONS["with-tvos"]
|
||||||
|
end
|
||||||
|
|
||||||
if _ACTION == "gmake" then
|
if _ACTION == "gmake" then
|
||||||
|
|
||||||
if nil == _OPTIONS["gcc"] then
|
if nil == _OPTIONS["gcc"] then
|
||||||
@ -154,17 +170,29 @@ function toolchain(_buildDir, _libDir)
|
|||||||
location (path.join(_buildDir, "projects", _ACTION .. "-freebsd"))
|
location (path.join(_buildDir, "projects", _ACTION .. "-freebsd"))
|
||||||
|
|
||||||
elseif "ios-arm" == _OPTIONS["gcc"] then
|
elseif "ios-arm" == _OPTIONS["gcc"] then
|
||||||
premake.gcc.cc = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"
|
premake.gcc.cc = "clang"
|
||||||
premake.gcc.cxx = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++"
|
premake.gcc.cxx = "clang++"
|
||||||
premake.gcc.ar = "ar"
|
premake.gcc.ar = "ar"
|
||||||
location (path.join(_buildDir, "projects", _ACTION .. "-ios-arm"))
|
location (path.join(_buildDir, "projects", _ACTION .. "-ios-arm"))
|
||||||
|
|
||||||
elseif "ios-simulator" == _OPTIONS["gcc"] then
|
elseif "ios-simulator" == _OPTIONS["gcc"] then
|
||||||
premake.gcc.cc = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"
|
premake.gcc.cc = "clang"
|
||||||
premake.gcc.cxx = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++"
|
premake.gcc.cxx = "clang++"
|
||||||
premake.gcc.ar = "ar"
|
premake.gcc.ar = "ar"
|
||||||
location (path.join(_buildDir, "projects", _ACTION .. "-ios-simulator"))
|
location (path.join(_buildDir, "projects", _ACTION .. "-ios-simulator"))
|
||||||
|
|
||||||
|
elseif "tvos-arm64" == _OPTIONS["gcc"] then
|
||||||
|
premake.gcc.cc = "clang"
|
||||||
|
premake.gcc.cxx = "clang++"
|
||||||
|
premake.gcc.ar = "ar"
|
||||||
|
location (path.join(_buildDir, "projects", _ACTION .. "-tvos-arm64"))
|
||||||
|
|
||||||
|
elseif "tvos-simulator" == _OPTIONS["gcc"] then
|
||||||
|
premake.gcc.cc = "clang"
|
||||||
|
premake.gcc.cxx = "clang++"
|
||||||
|
premake.gcc.ar = "ar"
|
||||||
|
location (path.join(_buildDir, "projects", _ACTION .. "-tvos-simulator"))
|
||||||
|
|
||||||
elseif "linux-gcc" == _OPTIONS["gcc"] then
|
elseif "linux-gcc" == _OPTIONS["gcc"] then
|
||||||
location (path.join(_buildDir, "projects", _ACTION .. "-linux"))
|
location (path.join(_buildDir, "projects", _ACTION .. "-linux"))
|
||||||
|
|
||||||
@ -180,6 +208,12 @@ function toolchain(_buildDir, _libDir)
|
|||||||
premake.gcc.ar = "ar"
|
premake.gcc.ar = "ar"
|
||||||
location (path.join(_buildDir, "projects", _ACTION .. "-linux-clang"))
|
location (path.join(_buildDir, "projects", _ACTION .. "-linux-clang"))
|
||||||
|
|
||||||
|
elseif "linux-mips-gcc" == _OPTIONS["gcc"] then
|
||||||
|
location (path.join(_buildDir, "projects", _ACTION .. "-linux-mips-gcc"))
|
||||||
|
|
||||||
|
elseif "linux-arm-gcc" == _OPTIONS["gcc"] then
|
||||||
|
location (path.join(_buildDir, "projects", _ACTION .. "-linux-arm-gcc"))
|
||||||
|
|
||||||
elseif "mingw-gcc" == _OPTIONS["gcc"] then
|
elseif "mingw-gcc" == _OPTIONS["gcc"] then
|
||||||
premake.gcc.cc = "$(MINGW)/bin/x86_64-w64-mingw32-gcc"
|
premake.gcc.cc = "$(MINGW)/bin/x86_64-w64-mingw32-gcc"
|
||||||
premake.gcc.cxx = "$(MINGW)/bin/x86_64-w64-mingw32-g++"
|
premake.gcc.cxx = "$(MINGW)/bin/x86_64-w64-mingw32-g++"
|
||||||
@ -335,6 +369,10 @@ function toolchain(_buildDir, _libDir)
|
|||||||
elseif "ios" == _OPTIONS["xcode"] then
|
elseif "ios" == _OPTIONS["xcode"] then
|
||||||
premake.xcode.toolset = "iphoneos"
|
premake.xcode.toolset = "iphoneos"
|
||||||
location (path.join(_buildDir, "projects", _ACTION .. "-ios"))
|
location (path.join(_buildDir, "projects", _ACTION .. "-ios"))
|
||||||
|
|
||||||
|
elseif "tvos" == _OPTIONS["xcode"] then
|
||||||
|
premake.xcode.toolset = "appletvos"
|
||||||
|
location (path.join(_buildDir, "projects", _ACTION .. "-tvos"))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -397,7 +435,6 @@ function toolchain(_buildDir, _libDir)
|
|||||||
objdir (path.join(_buildDir, "win32_" .. _ACTION, "obj"))
|
objdir (path.join(_buildDir, "win32_" .. _ACTION, "obj"))
|
||||||
libdirs {
|
libdirs {
|
||||||
path.join(_libDir, "lib/win32_" .. _ACTION),
|
path.join(_libDir, "lib/win32_" .. _ACTION),
|
||||||
"$(DXSDK_DIR)/lib/x86",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
configuration { "x64", "vs*" }
|
configuration { "x64", "vs*" }
|
||||||
@ -406,7 +443,6 @@ function toolchain(_buildDir, _libDir)
|
|||||||
objdir (path.join(_buildDir, "win64_" .. _ACTION, "obj"))
|
objdir (path.join(_buildDir, "win64_" .. _ACTION, "obj"))
|
||||||
libdirs {
|
libdirs {
|
||||||
path.join(_libDir, "lib/win64_" .. _ACTION),
|
path.join(_libDir, "lib/win64_" .. _ACTION),
|
||||||
"$(DXSDK_DIR)/lib/x64",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
configuration { "ARM", "vs*" }
|
configuration { "ARM", "vs*" }
|
||||||
@ -462,7 +498,6 @@ function toolchain(_buildDir, _libDir)
|
|||||||
objdir (path.join(_buildDir, "win32_mingw-gcc/obj"))
|
objdir (path.join(_buildDir, "win32_mingw-gcc/obj"))
|
||||||
libdirs {
|
libdirs {
|
||||||
path.join(_libDir, "lib/win32_mingw-gcc"),
|
path.join(_libDir, "lib/win32_mingw-gcc"),
|
||||||
"$(DXSDK_DIR)/lib/x86",
|
|
||||||
}
|
}
|
||||||
buildoptions { "-m32" }
|
buildoptions { "-m32" }
|
||||||
|
|
||||||
@ -471,8 +506,6 @@ function toolchain(_buildDir, _libDir)
|
|||||||
objdir (path.join(_buildDir, "win64_mingw-gcc/obj"))
|
objdir (path.join(_buildDir, "win64_mingw-gcc/obj"))
|
||||||
libdirs {
|
libdirs {
|
||||||
path.join(_libDir, "lib/win64_mingw-gcc"),
|
path.join(_libDir, "lib/win64_mingw-gcc"),
|
||||||
"$(DXSDK_DIR)/lib/x64",
|
|
||||||
"$(GLES_X64_DIR)",
|
|
||||||
}
|
}
|
||||||
buildoptions { "-m64" }
|
buildoptions { "-m64" }
|
||||||
|
|
||||||
@ -492,7 +525,6 @@ function toolchain(_buildDir, _libDir)
|
|||||||
objdir (path.join(_buildDir, "win32_mingw-clang/obj"))
|
objdir (path.join(_buildDir, "win32_mingw-clang/obj"))
|
||||||
libdirs {
|
libdirs {
|
||||||
path.join(_libDir, "lib/win32_mingw-clang"),
|
path.join(_libDir, "lib/win32_mingw-clang"),
|
||||||
"$(DXSDK_DIR)/lib/x86",
|
|
||||||
}
|
}
|
||||||
buildoptions { "-m32" }
|
buildoptions { "-m32" }
|
||||||
|
|
||||||
@ -501,8 +533,6 @@ function toolchain(_buildDir, _libDir)
|
|||||||
objdir (path.join(_buildDir, "win64_mingw-clang/obj"))
|
objdir (path.join(_buildDir, "win64_mingw-clang/obj"))
|
||||||
libdirs {
|
libdirs {
|
||||||
path.join(_libDir, "lib/win64_mingw-clang"),
|
path.join(_libDir, "lib/win64_mingw-clang"),
|
||||||
"$(DXSDK_DIR)/lib/x64",
|
|
||||||
"$(GLES_X64_DIR)",
|
|
||||||
}
|
}
|
||||||
buildoptions { "-m64" }
|
buildoptions { "-m64" }
|
||||||
|
|
||||||
@ -521,12 +551,12 @@ function toolchain(_buildDir, _libDir)
|
|||||||
-- "ubsan",
|
-- "ubsan",
|
||||||
}
|
}
|
||||||
|
|
||||||
configuration { "linux-g*" }
|
configuration { "linux-gcc" }
|
||||||
buildoptions {
|
buildoptions {
|
||||||
"-mfpmath=sse", -- force SSE to get 32-bit and 64-bit builds deterministic.
|
"-mfpmath=sse",
|
||||||
}
|
}
|
||||||
|
|
||||||
configuration { "linux-*" }
|
configuration { "linux-gcc or linux-clang" }
|
||||||
buildoptions {
|
buildoptions {
|
||||||
"-msse2",
|
"-msse2",
|
||||||
"-Wunused-value",
|
"-Wunused-value",
|
||||||
@ -543,7 +573,7 @@ function toolchain(_buildDir, _libDir)
|
|||||||
"-Wl,--gc-sections",
|
"-Wl,--gc-sections",
|
||||||
}
|
}
|
||||||
|
|
||||||
configuration { "linux-g*", "x32" }
|
configuration { "linux-gcc*", "x32" }
|
||||||
targetdir (path.join(_buildDir, "linux32_gcc/bin"))
|
targetdir (path.join(_buildDir, "linux32_gcc/bin"))
|
||||||
objdir (path.join(_buildDir, "linux32_gcc/obj"))
|
objdir (path.join(_buildDir, "linux32_gcc/obj"))
|
||||||
libdirs { path.join(_libDir, "lib/linux32_gcc") }
|
libdirs { path.join(_libDir, "lib/linux32_gcc") }
|
||||||
@ -551,7 +581,7 @@ function toolchain(_buildDir, _libDir)
|
|||||||
"-m32",
|
"-m32",
|
||||||
}
|
}
|
||||||
|
|
||||||
configuration { "linux-g*", "x64" }
|
configuration { "linux-gcc*", "x64" }
|
||||||
targetdir (path.join(_buildDir, "linux64_gcc/bin"))
|
targetdir (path.join(_buildDir, "linux64_gcc/bin"))
|
||||||
objdir (path.join(_buildDir, "linux64_gcc/obj"))
|
objdir (path.join(_buildDir, "linux64_gcc/obj"))
|
||||||
libdirs { path.join(_libDir, "lib/linux64_gcc") }
|
libdirs { path.join(_libDir, "lib/linux64_gcc") }
|
||||||
@ -575,6 +605,44 @@ function toolchain(_buildDir, _libDir)
|
|||||||
"-m64",
|
"-m64",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
configuration { "linux-mips-gcc" }
|
||||||
|
targetdir (path.join(_buildDir, "linux32_mips_gcc/bin"))
|
||||||
|
objdir (path.join(_buildDir, "linux32_mips_gcc/obj"))
|
||||||
|
libdirs { path.join(_libDir, "lib/linux32_mips_gcc") }
|
||||||
|
buildoptions {
|
||||||
|
"-Wunused-value",
|
||||||
|
"-Wundef",
|
||||||
|
}
|
||||||
|
buildoptions_cpp {
|
||||||
|
"-std=c++0x",
|
||||||
|
}
|
||||||
|
links {
|
||||||
|
"rt",
|
||||||
|
"dl",
|
||||||
|
}
|
||||||
|
linkoptions {
|
||||||
|
"-Wl,--gc-sections",
|
||||||
|
}
|
||||||
|
|
||||||
|
configuration { "linux-arm-gcc" }
|
||||||
|
targetdir (path.join(_buildDir, "linux32_arm_gcc/bin"))
|
||||||
|
objdir (path.join(_buildDir, "linux32_arm_gcc/obj"))
|
||||||
|
libdirs { path.join(_libDir, "lib/linux32_arm_gcc") }
|
||||||
|
buildoptions {
|
||||||
|
"-Wunused-value",
|
||||||
|
"-Wundef",
|
||||||
|
}
|
||||||
|
buildoptions_cpp {
|
||||||
|
"-std=c++0x",
|
||||||
|
}
|
||||||
|
links {
|
||||||
|
"rt",
|
||||||
|
"dl",
|
||||||
|
}
|
||||||
|
linkoptions {
|
||||||
|
"-Wl,--gc-sections",
|
||||||
|
}
|
||||||
|
|
||||||
configuration { "android-*" }
|
configuration { "android-*" }
|
||||||
flags {
|
flags {
|
||||||
"NoImportLib",
|
"NoImportLib",
|
||||||
@ -837,6 +905,10 @@ function toolchain(_buildDir, _libDir)
|
|||||||
}
|
}
|
||||||
includedirs { path.join(bxDir, "include/compat/ios") }
|
includedirs { path.join(bxDir, "include/compat/ios") }
|
||||||
|
|
||||||
|
configuration { "xcode4", "ios*" }
|
||||||
|
targetdir (path.join(_buildDir, "ios-arm/bin"))
|
||||||
|
objdir (path.join(_buildDir, "ios-arm/obj"))
|
||||||
|
|
||||||
configuration { "ios-arm" }
|
configuration { "ios-arm" }
|
||||||
targetdir (path.join(_buildDir, "ios-arm/bin"))
|
targetdir (path.join(_buildDir, "ios-arm/bin"))
|
||||||
objdir (path.join(_buildDir, "ios-arm/obj"))
|
objdir (path.join(_buildDir, "ios-arm/obj"))
|
||||||
@ -873,6 +945,57 @@ function toolchain(_buildDir, _libDir)
|
|||||||
"--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator" ..iosPlatform .. ".sdk",
|
"--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator" ..iosPlatform .. ".sdk",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
configuration { "tvos*" }
|
||||||
|
linkoptions {
|
||||||
|
"-lc++",
|
||||||
|
}
|
||||||
|
buildoptions {
|
||||||
|
"-Wfatal-errors",
|
||||||
|
"-Wunused-value",
|
||||||
|
"-Wundef",
|
||||||
|
}
|
||||||
|
includedirs { path.join(bxDir, "include/compat/ios") }
|
||||||
|
|
||||||
|
configuration { "xcode4", "tvos*" }
|
||||||
|
targetdir (path.join(_buildDir, "tvos-arm64/bin"))
|
||||||
|
objdir (path.join(_buildDir, "tvos-arm64/obj"))
|
||||||
|
|
||||||
|
configuration { "tvos-arm64" }
|
||||||
|
targetdir (path.join(_buildDir, "tvos-arm64/bin"))
|
||||||
|
objdir (path.join(_buildDir, "tvos-arm64/obj"))
|
||||||
|
libdirs { path.join(_libDir, "lib/tvos-arm64") }
|
||||||
|
linkoptions {
|
||||||
|
"-mtvos-version-min=9.0",
|
||||||
|
"-arch arm64",
|
||||||
|
"--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS" ..tvosPlatform .. ".sdk",
|
||||||
|
"-L/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS" ..tvosPlatform .. ".sdk/usr/lib/system",
|
||||||
|
"-F/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS" ..tvosPlatform .. ".sdk/System/Library/Frameworks",
|
||||||
|
"-F/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS" ..tvosPlatform .. ".sdk/System/Library/PrivateFrameworks",
|
||||||
|
}
|
||||||
|
buildoptions {
|
||||||
|
"-mtvos-version-min=9.0",
|
||||||
|
"-arch arm64",
|
||||||
|
"--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS" ..tvosPlatform .. ".sdk",
|
||||||
|
}
|
||||||
|
|
||||||
|
configuration { "tvos-simulator" }
|
||||||
|
targetdir (path.join(_buildDir, "tvos-simulator/bin"))
|
||||||
|
objdir (path.join(_buildDir, "tvos-simulator/obj"))
|
||||||
|
libdirs { path.join(_libDir, "lib/tvos-simulator") }
|
||||||
|
linkoptions {
|
||||||
|
"-mtvos-simulator-version-min=9.0",
|
||||||
|
"-arch i386",
|
||||||
|
"--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator" ..tvosPlatform .. ".sdk",
|
||||||
|
"-L/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator" ..tvosPlatform .. ".sdk/usr/lib/system",
|
||||||
|
"-F/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator" ..tvosPlatform .. ".sdk/System/Library/Frameworks",
|
||||||
|
"-F/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator" ..tvosPlatform .. ".sdk/System/Library/PrivateFrameworks",
|
||||||
|
}
|
||||||
|
buildoptions {
|
||||||
|
"-mtvos-simulator-version-min=9.0",
|
||||||
|
"-arch i386",
|
||||||
|
"--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator" ..tvosPlatform .. ".sdk",
|
||||||
|
}
|
||||||
|
|
||||||
configuration { "ps4" }
|
configuration { "ps4" }
|
||||||
targetdir (path.join(_buildDir, "ps4/bin"))
|
targetdir (path.join(_buildDir, "ps4/bin"))
|
||||||
objdir (path.join(_buildDir, "ps4/obj"))
|
objdir (path.join(_buildDir, "ps4/obj"))
|
||||||
|
BIN
3rdparty/bx/tools/bin/darwin/genie
vendored
BIN
3rdparty/bx/tools/bin/darwin/genie
vendored
Binary file not shown.
BIN
3rdparty/bx/tools/bin/linux/genie
vendored
BIN
3rdparty/bx/tools/bin/linux/genie
vendored
Binary file not shown.
BIN
3rdparty/bx/tools/bin/windows/genie.exe
vendored
BIN
3rdparty/bx/tools/bin/windows/genie.exe
vendored
Binary file not shown.
Loading…
Reference in New Issue
Block a user