diff --git a/scripts/bgfx.lua b/scripts/bgfx.lua index 644f9c4e..aead2c17 100644 --- a/scripts/bgfx.lua +++ b/scripts/bgfx.lua @@ -113,10 +113,34 @@ function bgfxProject(_name, _kind, _defines) path.join(BGFX_DIR, "src/**.h"), } - excludes { + removefiles { path.join(BGFX_DIR, "src/**.bin.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/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 + configuration {} copyLib() diff --git a/scripts/genie.lua b/scripts/genie.lua index 9f7888a2..540b2281 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -4,13 +4,13 @@ -- newoption { - trigger = "with-tools", - description = "Enable building tools.", + trigger = "with-amalgamated", + description = "Enable amalgamated build.", } newoption { - trigger = "with-shared-lib", - description = "Enable building shared library.", + trigger = "with-ovr", + description = "Enable OculusVR integration.", } newoption { @@ -19,8 +19,13 @@ newoption { } newoption { - trigger = "with-ovr", - description = "Enable OculusVR integration.", + trigger = "with-shared-lib", + description = "Enable building shared library.", +} + +newoption { + trigger = "with-tools", + description = "Enable building tools.", } solution "bgfx" @@ -32,14 +37,14 @@ solution "bgfx" if _ACTION == "xcode4" then platforms { "Universal", - } + } else platforms { "x32", "x64", -- "Xbox360", "Native", -- for targets where bitness is not specified - } + } end language "C++" @@ -96,6 +101,10 @@ function exampleProject(_name) path.join(BGFX_DIR, "examples", _name, "**.h"), } + removefiles { + path.join(BGFX_DIR, "examples", _name, "**.bin.h"), + } + links { "bgfx", "example-common", diff --git a/src/amalgamated.cpp b/src/amalgamated.cpp new file mode 100644 index 00000000..ecf65a05 --- /dev/null +++ b/src/amalgamated.cpp @@ -0,0 +1,20 @@ +/* + * Copyright 2011-2015 Branimir Karadzic. All rights reserved. + * License: http://www.opensource.org/licenses/BSD-2-Clause + */ + +#include "bgfx.cpp" +#include "glcontext_egl.cpp" +#include "glcontext_glx.cpp" +#include "glcontext_ppapi.cpp" +#include "glcontext_wgl.cpp" +#include "image.cpp" +#include "ovr.cpp" +#include "renderdoc.cpp" +#include "renderer_d3d9.cpp" +#include "renderer_d3d11.cpp" +#include "renderer_d3d11.cpp" +#include "renderer_null.cpp" +#include "renderer_gl.cpp" +#include "renderer_vk.cpp" +#include "vertexdecl.cpp" diff --git a/src/renderer.h b/src/renderer.h index 95e0762a..738f5988 100644 --- a/src/renderer.h +++ b/src/renderer.h @@ -3,6 +3,9 @@ * License: http://www.opensource.org/licenses/BSD-2-Clause */ +#ifndef BGFX_RENDERER_H_HEADER_GUARD +#define BGFX_RENDERER_H_HEADER_GUARD + #include "bgfx_p.h" namespace bgfx @@ -262,3 +265,5 @@ namespace bgfx }; } // namespace bgfx + +#endif // BGFX_RENDERER_H_HEADER_GUARD