This repository has been archived on 2025-05-04. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
bgfx/scripts/bgfx.lua

154 lines
3.1 KiB
Lua
Raw Normal View History

2013-05-17 19:39:08 -07:00
--
2015-01-02 14:43:11 -08:00
-- Copyright 2010-2015 Branimir Karadzic. All rights reserved.
2013-05-17 19:39:08 -07:00
-- License: http://www.opensource.org/licenses/BSD-2-Clause
--
2014-09-10 23:01:22 -07:00
function bgfxProject(_name, _kind, _defines)
2013-02-21 21:13:56 -08:00
2014-07-31 22:00:36 -07:00
project ("bgfx" .. _name)
2014-09-10 23:01:22 -07:00
uuid (os.uuid("bgfx" .. _name))
2014-07-31 22:00:36 -07:00
kind (_kind)
2013-02-21 21:13:56 -08:00
2014-07-31 22:00:36 -07:00
if _kind == "SharedLib" then
defines {
"BGFX_SHARED_LIB_BUILD=1",
}
2014-12-25 14:51:11 -08:00
2015-02-11 22:19:49 -08:00
configuration { "vs20* or mingw*" }
links {
"gdi32",
"psapi",
}
configuration { "mingw*" }
linkoptions {
"-shared",
}
2014-12-25 14:51:11 -08:00
configuration { "linux-*" }
2015-03-24 23:21:32 -07:00
buildoptions {
"-fPIC",
}
2014-12-25 14:51:11 -08:00
configuration {}
2014-07-31 22:00:36 -07:00
end
2013-02-21 21:13:56 -08:00
includedirs {
path.join(BGFX_DIR, "3rdparty"),
path.join(BGFX_DIR, "../bx/include"),
2013-02-21 21:13:56 -08:00
}
2014-07-31 22:00:36 -07:00
defines {
2014-09-03 00:29:54 -07:00
_defines,
2013-02-21 21:13:56 -08:00
}
2015-03-24 23:21:32 -07:00
if _OPTIONS["with-glfw"] then
defines {
"BGFX_CONFIG_MULTITHREADED=0",
}
end
2014-10-19 21:29:27 -07:00
if _OPTIONS["with-ovr"] then
defines {
"BGFX_CONFIG_USE_OVR=1",
}
includedirs {
"$(OVR_DIR)/LibOVR/Include",
}
end
2015-03-09 10:58:18 -07:00
if (_OPTIONS["vs"] == "vs2012-xp")
or (_OPTIONS["vs"] == "vs2013-xp") then
configuration { "vs201*" }
includedirs {
"$(DXSDK_DIR)/include",
}
end
2014-07-31 22:00:36 -07:00
configuration { "Debug" }
defines {
"BGFX_CONFIG_DEBUG=1",
}
2013-02-21 21:13:56 -08:00
2014-07-31 22:00:36 -07:00
configuration { "android*" }
links {
"EGL",
"GLESv2",
}
2013-02-21 21:13:56 -08:00
configuration { "vs2008" }
2014-07-31 22:00:36 -07:00
includedirs {
"$(DXSDK_DIR)/include",
}
2014-08-27 21:04:15 -07:00
configuration { "winphone8* or winstore8*"}
linkoptions {
"/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*" }
2014-07-31 22:00:36 -07:00
files {
path.join(BGFX_DIR, "src/**.mm"),
2014-07-31 22:00:36 -07:00
}
2014-06-01 15:26:36 -07:00
2014-07-31 22:00:36 -07:00
configuration { "osx" }
links {
"Cocoa.framework",
}
2014-06-01 15:26:36 -07:00
2014-10-17 21:03:14 -07:00
configuration { "not nacl" }
2014-07-31 22:00:36 -07:00
includedirs {
--nacl has GLES2 headers modified...
path.join(BGFX_DIR, "3rdparty/khronos"),
2014-07-31 22:00:36 -07:00
}
2014-06-01 15:26:36 -07:00
2014-10-18 15:44:45 -07:00
configuration { "x64", "vs* or mingw*" }
defines {
"_WIN32_WINNT=0x601",
}
2014-07-31 22:00:36 -07:00
configuration {}
2014-06-01 15:26:36 -07:00
includedirs {
path.join(BGFX_DIR, "include"),
2014-06-01 15:26:36 -07:00
}
files {
path.join(BGFX_DIR, "include/**.h"),
path.join(BGFX_DIR, "src/**.cpp"),
path.join(BGFX_DIR, "src/**.h"),
2014-07-07 19:53:00 -07:00
}
removefiles {
path.join(BGFX_DIR, "src/**.bin.h"),
2014-06-01 15:26:36 -07:00
}
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/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/vertexdecl.cpp"),
}
else
excludes {
path.join(BGFX_DIR, "src/amalgamated.cpp"),
}
end
2014-07-31 22:00:36 -07:00
configuration {}
2014-06-01 15:26:36 -07:00
2014-07-31 22:00:36 -07:00
copyLib()
end