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