bkaradzic / bgfx

Cross-platform, graphics API agnostic, "Bring Your Own Engine/Framework" style rendering library.
https://bkaradzic.github.io/bgfx/overview.html
BSD 2-Clause "Simplified" License
14.94k stars 1.94k forks source link

Build error using amalgamated and BGFX_CONFIG_PROFILER_REMOTERY_BUILD_LIB=1 #682

Open ryan-c-scott opened 8 years ago

ryan-c-scott commented 8 years ago

Compilation fails (at least on VS2012) when doing an amalgamated build with BGFX_CONFIG_PROFILER_REMOTERY_BUILD_LIB set.

Tested in a project including only those two things.

Many compile errors in glimports.h and renderer_d3d11.cpp/h

ryan-c-scott commented 8 years ago

Verified that this happens in my own test project as well as in the latest using the provided genie setup (i.e. with genie --with-amalgamated --with-profiler vs2012)

ryan-c-scott commented 8 years ago

It seems to be caused specifically by including those files via the preprocessor into amalgamated.cpp.

Explicitly including these files in the project instead of amalgamated.cpp works.

bgfx.cpp glcontext_egl.cpp glcontext_glx.cpp glcontext_ppapi.cpp glcontext_wgl.cpp image.cpp ovr.cpp renderdoc.cpp renderer_d3d11.cpp renderer_d3d12.cpp renderer_d3d9.cpp renderer_gl.cpp renderer_null.cpp renderer_vk.cpp shader_dx9bc.cpp shader_dxbc.cpp shader_spirv.cpp vertexdecl.cpp

(note this is exactly the order that they are built when using the default genie setup, however slightly different than the order specified in amalgamated.cpp. I doubt this is all that relevant, but it's something I looked at)

bkaradzic commented 8 years ago

If you add them into project it's not amalgamated then. I reproduced the problem, and for now the best is to avoid using profiler with amalgamated build.

ryan-c-scott commented 8 years ago

Yeah I don't specifically need an amalgamated build personally; just to integrate with my own build setup.

There shouldn't be any issue with using the profiler setup with non-almagamated builds though, right?

bkaradzic commented 8 years ago

Yeah that works.