Просмотр исходного кода

Fixed compilation for MacOS with Xcode 5 (edited premake files only).

Ivan Goremykin 11 лет назад
Родитель
Сommit
90b8b41d95
4 измененных файлов с 29 добавлено и 2 удалено
  1. 9 0
      README.md
  2. 2 2
      premake/bgfx.lua
  3. 5 0
      premake/example-common.lua
  4. 13 0
      premake/premake4.lua

+ 9 - 0
README.md

@@ -329,6 +329,15 @@ Visual Studio 2008 IDE:
 
 	start .build/projects/vs2008/bgfx.sln
 
+Xcode 5 IDE:
+
+	open .build/projects/xcode4/bgfx.xcworkspace
+Due to [inability](http://industriousone.com/debugdir) to set working directory for an Xcode project from premake configuration file, it has to be set manually for each example project:
+
+1. Open *"Edit scheme..."* dialog for a given project.
+2. Select *"Run"* settings.
+3. Check *"Use custom working directory"* and enter following path: `${PROJECT_DIR}/../../../examples/runtime`.
+
 Linux 64-bit:
 
 	make linux-release64

+ 2 - 2
premake/bgfx.lua

@@ -43,7 +43,7 @@ function bgfxProject(_name, _uuid, _kind, _defines)
 				"gdi32",
 			}
 
-		configuration { "osx or ios*" }
+		configuration { "xcode4 or osx or ios*" }
 			files {
 				BGFX_DIR .. "src/**.mm",
 			}
@@ -53,7 +53,7 @@ function bgfxProject(_name, _uuid, _kind, _defines)
 				"Cocoa.framework",
 			}
 
-		configuration { "vs* or linux or mingw or osx or ios*" }
+		configuration { "vs* or linux or mingw or osx or xcode4 or ios*" }
 			includedirs {
 				--nacl has GLES2 headers modified...
 				BGFX_DIR .. "3rdparty/khronos",

+ 5 - 0
premake/example-common.lua

@@ -21,3 +21,8 @@ project ("example-common")
 		BGFX_DIR .. "examples/common/**.cpp",
 		BGFX_DIR .. "examples/common/**.h",
 	}
+
+	configuration { "xcode4" }
+		includedirs {
+			BX_DIR .. "include/compat/osx",
+		}

+ 13 - 0
premake/premake4.lua

@@ -134,6 +134,19 @@ function exampleProject(_name, _uuid)
 --			"SDL2",
 		}
 
+	configuration { "xcode4" }
+		platforms {
+			"Universal"
+		}
+		files {
+			BGFX_DIR .. "examples/common/**.mm",
+		}
+		links {
+			"Cocoa.framework",
+			"Foundation.framework",
+			"OpenGL.framework",
+		}
+
 	configuration { "ios*" }
 		kind "ConsoleApp"
 		files {