Pārlūkot izejas kodu

Manually integrated @gtbass OSX changes.

bkaradzic 13 gadi atpakaļ
vecāks
revīzija
5dc22d90e1
4 mainītis faili ar 16 papildinājumiem un 2 dzēšanām
  1. 2 0
      .gitignore
  2. 2 2
      include/bx/sem.h
  3. 1 0
      include/compat/osx/unordered_map
  4. 11 0
      premake/toolchain.lua

+ 2 - 0
.gitignore

@@ -1,3 +1,5 @@
 .build/
 .build/
 .debug/
 .debug/
 .svn/
 .svn/
+tags
+.DS_Store

+ 2 - 2
include/bx/sem.h

@@ -42,8 +42,8 @@ namespace bx
 
 
 		bool wait(int32_t _msecs = -1)
 		bool wait(int32_t _msecs = -1)
 		{
 		{
-#if BX_PLATFORM_NACL
-			BX_CHECK(-1 == _msecs, "NaCl doesn't support sem_timedwait at this moment.");
+#if BX_PLATFORM_NACL || BX_PLATFORM_OSX
+			BX_CHECK(-1 == _msecs, "NaCl and OSX don't support sem_timedwait at this moment.");
 			return 0 == sem_wait(&m_handle);
 			return 0 == sem_wait(&m_handle);
 #else
 #else
 			if (0 > _msecs)
 			if (0 > _msecs)

+ 1 - 0
include/compat/osx/unordered_map

@@ -0,0 +1 @@
+#include <tr1/unordered_map>

+ 11 - 0
premake/toolchain.lua

@@ -283,5 +283,16 @@ function toolchain(_buildDir, _libDir)
 			"_XBOX",
 			"_XBOX",
 		}
 		}
 
 
+	configuration { "macosx" }
+		buildoptions {
+			"-U__STRICT_ANSI__",
+			"-Wunused-value",
+			"-msse2",
+		}
+		includedirs { bxDir .. "include/compat/osx" }
+		targetdir (_buildDir .. "osx" .. "/bin")
+		objdir (_buildDir .. "osx" .. "/obj")
+		libdirs { _libDir .. "lib/osx" }
+
 	configuration {} -- reset configuration
 	configuration {} -- reset configuration
 end
 end