Added a new enabled-by-default BUILD_AL_TESTS CMake option. The test
cases that actually require OpenAL context were split to new tests with
`*ALTest` suffix so they can be executed selectively.
Enabled by default, makes the current Magnum context a thread-local
variable instead of a global one, so it's possible to have multiple
thread-local contexts. Might have some performance implications, that's
why it's possible to disable it (but enabled by default is the safer
option).
GCC 4.7 and Apple platforms don't support thread_local, but __thread
does the job too (though on iOS not until Xcode 7.3). Also had to move
it to file-local because MSVC doesn't like having thread local variables
as part of DLL interface. (And there is *of course* no way to disable
exporting one particular member. F' that.)
Toggles between using CGL/GLX/WGL (requiring running graphical desktop
environment) or EGL (without display attachment) for command-line
utilities and GL tests. Also exposed to the user through
MAGNUM_TARGET_HEADLESS CMake and preprocessor variables.
Uses just EGL and no other platform toolkit, meaning that the same code
can be used on all platforms if the drivers support it. Should be
working for OpenGL ES for most drivers, however desktop OpenGL is
supported only on NVidia since version 355.
As with Corrade, this is not exactly backwards compatible, but for
common use case without OBJECT libraries this should not be a problem.
In any case, recreate the build dir and update your copy of all
Find*.cmake modules to avoid weird things happening.
User-facing changes:
* Documentation of all Find*.cmake modules converted to
reStructuredText to follow official CMake guidelines.
* The newfangled way to use the libraries is to link to Magnum::Shaders
instead of adding ${MAGNUM_SHADERS_INCLUDE_DIRS} to include path and
linking to ${MAGNUM_SHADERS_LIBRARIES}.
* The old ${MAGNUM_*_LIBRARIES} are deprecated and now just expand to
Magnum::* target. Use the target directly. These are also enabled
only when building with MAGNUM_BUILD_DEPRECATED.
* The old ${MAGNUM_*_INCLUDE_DIRS} are removed as the Magnum::* targets
cover these too.
Internal changes:
* Global state such as include_directories() was replaced with
target-specific settings.
I wanted to preserve the parameter-less constructor of tests, but WINAPI
requires fairly ugly entagled set of functions, passing HWND around,
which required storing it in a global var and hoping it is properly
initialized when querying it for it to be passed to application
constructor.
When this was done, it was now fairly easy to support passing also
argv/argc to application constructor, which in the future will enable
selective disabling of extensions for even better test coverage.
This however needed slightly different main() function and thus we now
have MAGNUM_GL_TEST_MAIN() instead of CORRADE_TEST_MAIN(). Using the
latter will result in an assert inside std::optional.
The actual WebGL 2 distinction was done as a part of previous WebGL
cleanup. It compiles, but is completely broken, as Emscripten has some
missing bits to go through at least Context class creation.
Currently it was visible only if BUILD_STATIC was set, but it affects
both BUILD_STATIC and BUILD_PLUGINS_STATIC. And because
CMakeDependentOption doesn't support logic OR, I can't make it visible
if either of these two is set, so I'm just making it visible all the
time.