summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/scripts/bgfx.lua
diff options
context:
space:
mode:
author Branimir Karadžić <branimirkaradzic@gmail.com>2016-10-29 09:11:50 +0200
committer Miodrag Milanovic <mmicko@gmail.com>2016-10-29 09:11:50 +0200
commita3b4058bf7266f1291cf38c30425d9948250fcd9 (patch)
tree46116c48b60368ac9c782c1d5e6e8ae16e558987 /3rdparty/bgfx/scripts/bgfx.lua
parentb99be73f2db5d3f81edc96a92ac4839e7f1cc3ab (diff)
Updated BGFX and BX and recompiled shaders (nw)
Diffstat (limited to '3rdparty/bgfx/scripts/bgfx.lua')
-rw-r--r--3rdparty/bgfx/scripts/bgfx.lua79
1 files changed, 58 insertions, 21 deletions
diff --git a/3rdparty/bgfx/scripts/bgfx.lua b/3rdparty/bgfx/scripts/bgfx.lua
index 76d6b70258a..a3716b976f3 100644
--- a/3rdparty/bgfx/scripts/bgfx.lua
+++ b/3rdparty/bgfx/scripts/bgfx.lua
@@ -3,6 +3,38 @@
-- License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
--
+function filesexist(_srcPath, _dstPath, _files)
+ for _, file in ipairs(_files) do
+ file = path.getrelative(_srcPath, file)
+ local filePath = path.join(_dstPath, file)
+ if not os.isfile(filePath) then return false end
+ end
+
+ return true
+end
+
+function overridefiles(_srcPath, _dstPath, _files)
+
+ local remove = {}
+ local add = {}
+ for _, file in ipairs(_files) do
+ file = path.getrelative(_srcPath, file)
+ local filePath = path.join(_dstPath, file)
+ if not os.isfile(filePath) then return end
+
+ table.insert(remove, path.join(_srcPath, file))
+ table.insert(add, filePath)
+ end
+
+ removefiles {
+ remove,
+ }
+
+ files {
+ add,
+ }
+end
+
function bgfxProject(_name, _kind, _defines)
project ("bgfx" .. _name)
@@ -98,6 +130,7 @@ function bgfxProject(_name, _kind, _defines)
"-framework QuartzCore",
"-framework OpenGL",
"-weak_framework Metal",
+ "-weak_framework MetalKit",
}
configuration { "not nacl", "not linux-steamlink" }
@@ -128,25 +161,26 @@ function bgfxProject(_name, _kind, _defines)
path.join(BGFX_DIR, "src/**.bin.h"),
}
+ overridefiles(BGFX_DIR, path.join(BGFX_DIR, "../bgfx-ext"), {
+ path.join(BGFX_DIR, "src/renderer_vk.cpp"),
+ path.join(BGFX_DIR, "src/renderer_vk.h"),
+ })
+
+ overridefiles(BGFX_DIR, path.join(BGFX_DIR, "../bgfx-ext"), {
+ path.join(BGFX_DIR, "src/renderer_gnm.cpp"),
+ path.join(BGFX_DIR, "src/renderer_gnm.h"),
+ })
+
if _OPTIONS["with-amalgamated"] then
excludes {
path.join(BGFX_DIR, "src/bgfx.cpp"),
- path.join(BGFX_DIR, "src/glcontext_egl.cpp"),
- path.join(BGFX_DIR, "src/glcontext_glx.cpp"),
- path.join(BGFX_DIR, "src/glcontext_ppapi.cpp"),
- path.join(BGFX_DIR, "src/glcontext_wgl.cpp"),
+ path.join(BGFX_DIR, "src/debug_**.cpp"),
+ path.join(BGFX_DIR, "src/glcontext_**.cpp"),
path.join(BGFX_DIR, "src/image.cpp"),
- path.join(BGFX_DIR, "src/ovr.cpp"),
- path.join(BGFX_DIR, "src/renderdoc.cpp"),
- 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_null.cpp"),
- path.join(BGFX_DIR, "src/renderer_gl.cpp"),
- path.join(BGFX_DIR, "src/renderer_vk.cpp"),
- path.join(BGFX_DIR, "src/shader_dx9bc.cpp"),
- path.join(BGFX_DIR, "src/shader_dxbc.cpp"),
- path.join(BGFX_DIR, "src/shader_spirv.cpp"),
+ path.join(BGFX_DIR, "src/hmd**.cpp"),
+ path.join(BGFX_DIR, "src/renderer_**.cpp"),
+ path.join(BGFX_DIR, "src/shader**.cpp"),
+ path.join(BGFX_DIR, "src/topology.cpp"),
path.join(BGFX_DIR, "src/vertexdecl.cpp"),
}
@@ -156,20 +190,23 @@ function bgfxProject(_name, _kind, _defines)
}
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/glcontext_**.mm"),
+ path.join(BGFX_DIR, "src/renderer_**.mm"),
path.join(BGFX_DIR, "src/amalgamated.cpp"),
}
+ configuration { "not (xcode* or osx or ios*)" }
+ excludes {
+ path.join(BGFX_DIR, "src/**.mm"),
+ }
+
configuration {}
else
configuration { "xcode* 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"),
+ path.join(BGFX_DIR, "src/glcontext_**.mm"),
+ path.join(BGFX_DIR, "src/renderer_**.mm"),
}
configuration {}