diff --git a/premake4.lua b/premake4.lua index 9246723bc..62d3056b5 100644 --- a/premake4.lua +++ b/premake4.lua @@ -144,6 +144,7 @@ newoption { trigger = "with-static-eepp", description = "Force to build the demo newoption { trigger = "with-static-backend", description = "It will try to compile the library with a static backend (only for gcc and mingw).\n\t\t\t\tThe backend should be placed in libs/your_platform/libYourBackend.a" } newoption { trigger = "with-gles2", description = "Compile with GLES2 support" } newoption { trigger = "with-gles1", description = "Compile with GLES1 support" } +newoption { trigger = "use-frameworks", description = "In Mac OS X it will try to link the external libraries from its frameworks. For example, instead of linking against SDL2 it will link agains SDL2.framework." } newoption { trigger = "with-backend", description = "Select the backend to use for window and input handling.\n\t\t\tIf no backend is selected or if the selected is not installed the script will search for a backend present in the system, and will use it.\n\t\t\tIt's possible to build with more than one backend support.\n\t\t\t\tUse comma to separate the backends to build ( you can't mix SDL and SDL2, you'll get random crashes ).\n\t\t\t\tExample: --with-backend=SDL2,SFML", @@ -220,7 +221,7 @@ function get_ios_arch() end function os_findlib( name ) - if os.is_real("macosx") and is_xcode() then + if os.is_real("macosx") and ( is_xcode() or _OPTIONS["use-frameworks"] ) then local path = "/Library/Frameworks/" .. name if os.isdir( path ) then @@ -232,7 +233,7 @@ function os_findlib( name ) end function get_backend_link_name( name ) - if os.is_real("macosx") and is_xcode() then + if os.is_real("macosx") and ( is_xcode() or _OPTIONS["use-frameworks"] ) then local fname = name .. ".framework" if os_findlib( fname ) then -- Search for the framework diff --git a/projects/osx/make.sh b/projects/osx/make.sh new file mode 100755 index 000000000..17b5e201e --- /dev/null +++ b/projects/osx/make.sh @@ -0,0 +1,9 @@ +#!/bin/sh +cd $(dirname "$0") +/usr/local/bin/premake4 --file=../../premake4.lua --with-static-freetype --use-frameworks gmake +cd ../../make/macosx/ +make $@ + +cd ../../bin/ +ln -sf ../libs/macosx/libeepp.dylib . +ln -sf ../libs/macosx/libeepp-debug.dylib . diff --git a/src/eepp/system/platform/posix/cthreadimpl.cpp b/src/eepp/system/platform/posix/cthreadimpl.cpp index 935df1207..27e4fb16b 100644 --- a/src/eepp/system/platform/posix/cthreadimpl.cpp +++ b/src/eepp/system/platform/posix/cthreadimpl.cpp @@ -6,8 +6,8 @@ namespace EE { namespace System { namespace Platform { #if defined( EE_PLATFORM_POSIX ) -Uint32 cThreadImpl::GetCurrentThreadId() { - return (Uint32)pthread_self(); +UintPtr cThreadImpl::GetCurrentThreadId() { + return (UintPtr)pthread_self(); } cThreadImpl::cThreadImpl( cThread * owner ) : @@ -42,8 +42,8 @@ void cThreadImpl::Terminate() { } } -Uint32 cThreadImpl::Id() { - return (Uint32)mThread; +UintPtr cThreadImpl::Id() { + return (UintPtr)mThread; } void * cThreadImpl::EntryPoint( void * userData ) { diff --git a/src/eepp/system/platform/posix/cthreadimpl.hpp b/src/eepp/system/platform/posix/cthreadimpl.hpp index 3e174a79b..9b83f4441 100644 --- a/src/eepp/system/platform/posix/cthreadimpl.hpp +++ b/src/eepp/system/platform/posix/cthreadimpl.hpp @@ -15,7 +15,7 @@ namespace Platform { class cThreadImpl { public: - static Uint32 GetCurrentThreadId(); + static UintPtr GetCurrentThreadId(); cThreadImpl( cThread * owner ); @@ -23,7 +23,7 @@ class cThreadImpl { void Terminate(); - Uint32 Id(); + UintPtr Id(); protected: static void * EntryPoint( void* userData ); diff --git a/src/eepp/system/platform/win/cthreadimpl.cpp b/src/eepp/system/platform/win/cthreadimpl.cpp index b6f672425..6fd5af02a 100644 --- a/src/eepp/system/platform/win/cthreadimpl.cpp +++ b/src/eepp/system/platform/win/cthreadimpl.cpp @@ -6,8 +6,8 @@ namespace EE { namespace System { namespace Platform { #if EE_PLATFORM == EE_PLATFORM_WIN -Uint32 cThreadImpl::GetCurrentThreadId() { - return (Uint32)::GetCurrentThreadId(); +UintPtr cThreadImpl::GetCurrentThreadId() { + return (UintPtr)::GetCurrentThreadId(); } cThreadImpl::cThreadImpl( cThread * owner ) { @@ -32,8 +32,8 @@ void cThreadImpl::Terminate() { } } -Uint32 cThreadImpl::Id() { - return (Uint32)mThreadId; +UintPtr cThreadImpl::Id() { + return (UintPtr)mThreadId; } unsigned int __stdcall cThreadImpl::EntryPoint( void * userData ) { diff --git a/src/eepp/system/platform/win/cthreadimpl.hpp b/src/eepp/system/platform/win/cthreadimpl.hpp index 0d460c15e..a325a729c 100644 --- a/src/eepp/system/platform/win/cthreadimpl.hpp +++ b/src/eepp/system/platform/win/cthreadimpl.hpp @@ -18,7 +18,7 @@ namespace Platform { class cThreadImpl { public: - static Uint32 GetCurrentThreadId(); + static UintPtr GetCurrentThreadId(); cThreadImpl( cThread * owner ); @@ -26,7 +26,7 @@ class cThreadImpl { void Terminate(); - Uint32 Id(); + UintPtr Id(); protected: static unsigned int __stdcall EntryPoint(void* userData); diff --git a/src/test/eetest.hpp b/src/test/eetest.hpp index 0edb96fbf..c59592969 100644 --- a/src/test/eetest.hpp +++ b/src/test/eetest.hpp @@ -136,9 +136,6 @@ class cEETest : private cThread { cMap Map; - eeFloat H; - Int32 NH; - Uint8 Screen; SceneCb Scenes[6]; void Screen1();