Added ObjC amalgamated file.

This commit is contained in:
Branimir Karadžić
2015-06-19 17:34:01 -07:00
parent c80cc04445
commit d7a9b56dc6
4 changed files with 26 additions and 8 deletions

View File

@@ -86,11 +86,6 @@ function bgfxProject(_name, _kind, _defines)
"/ignore:4264" -- LNK4264: archiving object file compiled with /ZW into a static library; note that when authoring Windows Runtime types it is not recommended to link with a static library that contains Windows Runtime metadata
}
configuration { "xcode4 or osx or ios*" }
files {
path.join(BGFX_DIR, "src/**.mm"),
}
configuration { "osx" }
links {
"Cocoa.framework",
@@ -136,14 +131,29 @@ function bgfxProject(_name, _kind, _defines)
path.join(BGFX_DIR, "src/renderer_d3d9.cpp"),
path.join(BGFX_DIR, "src/renderer_d3d11.cpp"),
path.join(BGFX_DIR, "src/renderer_d3d12.cpp"),
path.join(BGFX_DIR, "src/renderer_mtl.cpp"),
path.join(BGFX_DIR, "src/renderer_null.cpp"),
path.join(BGFX_DIR, "src/renderer_gl.cpp"),
path.join(BGFX_DIR, "src/renderer_vk.cpp"),
path.join(BGFX_DIR, "src/vertexdecl.cpp"),
}
configuration { "xcode4 or osx or ios*" }
excludes {
path.join(BGFX_DIR, "src/glcontext_eagl.mm"),
path.join(BGFX_DIR, "src/glcontext_nsgl.mm"),
path.join(BGFX_DIR, "src/renderer_mtl.mm"),
path.join(BGFX_DIR, "src/amalgamated.cpp"),
}
else
configuration { "xcode4 or osx or ios*" }
files {
path.join(BGFX_DIR, "src/glcontext_eagl.mm"),
path.join(BGFX_DIR, "src/glcontext_nsgl.mm"),
path.join(BGFX_DIR, "src/renderer_mtl.mm"),
}
excludes {
path.join(BGFX_DIR, "src/amalgamated.mm"),
path.join(BGFX_DIR, "src/amalgamated.cpp"),
}
end

View File

@@ -14,7 +14,6 @@
#include "renderer_d3d9.cpp"
#include "renderer_d3d11.cpp"
#include "renderer_d3d12.cpp"
#include "renderer_mtl.cpp"
#include "renderer_null.cpp"
#include "renderer_gl.cpp"
#include "renderer_vk.cpp"

9
src/amalgamated.mm Normal file
View File

@@ -0,0 +1,9 @@
/*
* Copyright 2011-2015 Branimir Karadzic. All rights reserved.
* License: http://www.opensource.org/licenses/BSD-2-Clause
*/
#include "amalgamated.cpp"
#include "glcontext_eagl.mm"
#include "glcontext_nsgl.mm"
#include "renderer_mtl.mm"

View File

@@ -5,7 +5,7 @@
#include "bgfx_p.h"
#if BGFX_CONFIG_RENDERER_METAL
# include "../../bgfx-ext/src/renderer_mtl.cpp"
# include "../../bgfx-ext/src/renderer_mtl.mm"
#else
namespace bgfx { namespace mtl