diff --git a/CMakeLists.txt b/CMakeLists.txt index ffb2c7892..09035e936 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,6 +26,9 @@ cmake_minimum_required(VERSION 2.8) project(Magnum) +# Find Corrade first so we can check on the target +find_package(Corrade REQUIRED) + include(CMakeDependentOption) option(TARGET_GLES "Build for OpenGL ES instead of desktop OpenGL" OFF) @@ -46,6 +49,7 @@ option(WITH_MAGNUMINFO "Build magnum-info utility" OFF) # Application libraries if(CORRADE_TARGET_NACL) option(WITH_NACLAPPLICATION "Build NaClApplication library" OFF) + cmake_dependent_option(WITH_WINDOWLESSNACLAPPLICATION "Build WindowlessNaClApplication library" OFF "NOT WITH_MAGNUMINFO" ON) else() option(WITH_GLXAPPLICATION "Build GlxApplication library" OFF) cmake_dependent_option(WITH_WINDOWLESSGLXAPPLICATION "Build WindowlessGlxApplication library" OFF "NOT WITH_MAGNUMINFO" ON) @@ -71,8 +75,6 @@ if(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} VERSION_ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${Magnum_SOURCE_DIR}/modules-compatibility/") endif() -find_package(Corrade REQUIRED) - # If targeting NaCl or Emscripten, set explicit OpenGL ES 2.0 support if(CORRADE_TARGET_NACL OR CORRADE_TARGET_EMSCRIPTEN) set(TARGET_GLES 1) @@ -123,6 +125,7 @@ endif() include(CorradeLibSuffix) set(MAGNUM_BINARY_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/bin) set(MAGNUM_LIBRARY_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}) +set(MAGNUM_DATA_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/magnum) set(MAGNUM_CMAKE_MODULE_INSTALL_DIR ${CMAKE_ROOT}/Modules) set(MAGNUM_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include/Magnum) diff --git a/PKGBUILD-nacl-newlib b/PKGBUILD-nacl-newlib index 19d95f7c9..524572544 100644 --- a/PKGBUILD-nacl-newlib +++ b/PKGBUILD-nacl-newlib @@ -20,8 +20,9 @@ build() { -DCMAKE_TOOLCHAIN_FILE="$startdir/toolchains/generic/NaCl-newlib-x86-32.cmake" \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=/usr/nacl \ - -DWITH_MAGNUMINFO=OFF \ + -DWITH_MAGNUMINFO=ON \ -DWITH_NACLAPPLICATION=ON \ + -DWITH_WINDOWLESSNACLAPPLICATION=ON \ -DBUILD_STATIC=ON \ -DLIB_SUFFIX=/32 make @@ -35,8 +36,9 @@ build() { -DCMAKE_TOOLCHAIN_FILE="$startdir/toolchains/generic/NaCl-newlib-x86-64.cmake" \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=/usr/nacl \ - -DWITH_MAGNUMINFO=OFF \ + -DWITH_MAGNUMINFO=ON \ -DWITH_NACLAPPLICATION=ON \ + -DWITH_WINDOWLESSNACLAPPLICATION=ON \ -DBUILD_STATIC=ON make } @@ -46,8 +48,16 @@ package() { cd "$startdir/build-nacl-newlib-x86-32" make DESTDIR="$pkgdir/" install + # Strip 32bit binaries + /usr/nacl/toolchain/linux_x86_newlib/bin/i686-nacl-strip ${pkgdir}/usr/nacl/lib/32/*.a + /usr/nacl/toolchain/linux_x86_newlib/bin/i686-nacl-strip ${pkgdir}/usr/nacl/bin/*x86-32.nexe + # Install 64bit (the headers will be overwritten, but they are (and should # be) the same for both versions cd "$startdir/build-nacl-newlib-x86-64" make DESTDIR="$pkgdir/" install + + # Strip 64bit binaries + /usr/nacl/toolchain/linux_x86_newlib/bin/x86_64-nacl-strip ${pkgdir}/usr/nacl/lib/*.a + /usr/nacl/toolchain/linux_x86_newlib/bin/x86_64-nacl-strip ${pkgdir}/usr/nacl/bin/*x86-64.nexe } diff --git a/modules/FindMagnum.cmake b/modules/FindMagnum.cmake index 7c871037a..9b72c8fec 100644 --- a/modules/FindMagnum.cmake +++ b/modules/FindMagnum.cmake @@ -185,13 +185,13 @@ foreach(component ${Magnum_FIND_COMPONENTS}) endif() endif() - # NaCl application dependencies - if(${component} STREQUAL NaClApplication) + # (Windowless) NaCl application dependencies + if(${component} STREQUAL NaClApplication OR ${component} STREQUAL WindowlessNaClApplication) set(_MAGNUM_${_COMPONENT}_LIBRARIES ppapi_cpp ppapi ${_WINDOWCONTEXT_MAGNUM_LIBRARIES_DEPENDENCY}) endif() # GLX application dependencies - if(${component} STREQUAL GlxApplication) + if(${component} STREQUAL GlxApplication OR ${component} STREQUAL WindowlessGlxApplication) find_package(X11) if(X11_FOUND) set(_MAGNUM_${_COMPONENT}_LIBRARIES ${X11_LIBRARIES} ${_WINDOWCONTEXT_MAGNUM_LIBRARIES_DEPENDENCY}) @@ -210,16 +210,6 @@ foreach(component ${Magnum_FIND_COMPONENTS}) unset(MAGNUM_${_COMPONENT}_LIBRARY) endif() endif() - - # Windowless GLX application dependencies - if(${component} STREQUAL WindowlessGlxApplication) - find_package(X11) - if(X11_FOUND) - set(_MAGNUM_${_COMPONENT}_LIBRARIES ${X11_LIBRARIES} ${_WINDOWCONTEXT_MAGNUM_LIBRARIES_DEPENDENCY}) - else() - unset(MAGNUM_${_COMPONENT}_LIBRARY) - endif() - endif() endif() # DebugTools library diff --git a/src/Platform/CMakeLists.txt b/src/Platform/CMakeLists.txt index 6f7b75b18..634197a4a 100644 --- a/src/Platform/CMakeLists.txt +++ b/src/Platform/CMakeLists.txt @@ -72,6 +72,18 @@ if(WITH_NACLAPPLICATION) install(TARGETS MagnumNaClApplication DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}) endif() +# Windowless NaCl application +if(WITH_WINDOWLESSNACLAPPLICATION) + if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL NaCl) + message(FATAL_ERROR "WindowlessNaClApplication is available only when targeting Google Chrome Native Client. Set WITH_WINDOWLESSNACLAPPLICATION to OFF to skip building it.") + endif() + + add_library(MagnumWindowlessNaClApplication STATIC + WindowlessNaClApplication.cpp) + install(FILES WindowlessNaClApplication.h DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Platform) + install(TARGETS MagnumWindowlessNaClApplication DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}) +endif() + # GLX application if(WITH_GLXAPPLICATION) set(NEED_ABSTRACTXAPPLICATION 1) @@ -144,11 +156,20 @@ endif() # Magnum Info if(WITH_MAGNUMINFO) - if(UNIX) - add_executable(magnum-info magnum-info.cpp) + if(NOT UNIX AND NOT CORRADE_TARGET_NACL) + message(FATAL_ERROR "magnum-info is not available on this platform. Set WITH_MAGNUMINFO to OFF to suppress this warning.") + endif() + + add_executable(magnum-info magnum-info.cpp) + if(UNIX AND NOT CORRADE_TARGET_NACL) target_link_libraries(magnum-info Magnum MagnumWindowlessGlxApplication ${X11_LIBRARIES}) - install(TARGETS magnum-info DESTINATION ${MAGNUM_BINARY_INSTALL_DIR}) - else() - message(WARNING "magnum-info is currently available only on Unix. Set WITH_MAGNUMINFO to OFF to suppress this warning.") + elseif(CORRADE_TARGET_NACL) + target_link_libraries(magnum-info Magnum MagnumWindowlessNaClApplication ppapi_cpp ppapi) + endif() + + install(TARGETS magnum-info DESTINATION ${MAGNUM_BINARY_INSTALL_DIR}) + if(CORRADE_TARGET_NACL) + install(FILES magnum-info-nacl.html DESTINATION ${MAGNUM_DATA_INSTALL_DIR} RENAME magnum-info.html) + install(FILES magnum-info-nacl.nmf DESTINATION ${MAGNUM_DATA_INSTALL_DIR} RENAME magnum-info.nmf) endif() endif() diff --git a/src/Platform/NaClApplication.h b/src/Platform/NaClApplication.h index ed33f57b2..e1a04d654 100644 --- a/src/Platform/NaClApplication.h +++ b/src/Platform/NaClApplication.h @@ -80,9 +80,10 @@ file describing the application. @subsection NaClApplication-html-console Redirecting output to Chrome's JavaScript console -The application redirects @ref Debug, @ref Warning and @ref Error output to -JavaScript console. See also @ref Corrade::Utility::NaClConsoleStreamBuffer for -more information. +The application redirects @ref Corrade::Utility::Debug "Debug", +@ref Corrade::Utility::Warning "Warning" and @ref Corrade::Utility::Error "Error" +output to JavaScript console. See also @ref Corrade::Utility::NaClConsoleStreamBuffer +for more information. */ class NaClApplication: public pp::Instance, public pp::Graphics3DClient, public pp::MouseLock { public: diff --git a/src/Platform/WindowlessNaClApplication.cpp b/src/Platform/WindowlessNaClApplication.cpp new file mode 100644 index 000000000..84c695b55 --- /dev/null +++ b/src/Platform/WindowlessNaClApplication.cpp @@ -0,0 +1,109 @@ +/* + This file is part of Magnum. + + Copyright © 2010, 2011, 2012, 2013 Vladimír Vondruš + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +*/ + +#include "WindowlessNaClApplication.h" + +#include +#include +#include + +#include "Context.h" + +namespace Magnum { namespace Platform { + +struct WindowlessNaClApplication::ConsoleDebugOutput { + explicit ConsoleDebugOutput(pp::Instance* instance); + + Utility::NaClConsoleStreamBuffer debugBuffer, warningBuffer, errorBuffer; + std::ostream debugOutput, warningOutput, errorOutput; +}; + +WindowlessNaClApplication::ConsoleDebugOutput::ConsoleDebugOutput(pp::Instance* instance): debugBuffer(instance, Utility::NaClConsoleStreamBuffer::LogLevel::Log), warningBuffer(instance, Utility::NaClConsoleStreamBuffer::LogLevel::Warning), errorBuffer(instance, Utility::NaClConsoleStreamBuffer::LogLevel::Error), debugOutput(&debugBuffer), warningOutput(&warningBuffer), errorOutput(&errorBuffer) { + /* Inform about this change on standard output */ + Debug() << "Platform::NaClApplication: redirecting Debug, Warning and Error output to JavaScript console"; + + Debug::setOutput(&debugOutput); + Warning::setOutput(&warningOutput); + Error::setOutput(&errorOutput); +} + +WindowlessNaClApplication::WindowlessNaClApplication(const Arguments& arguments): Instance(arguments), Graphics3DClient(this), c(nullptr) { + debugOutput = new ConsoleDebugOutput(this); + createContext(new Configuration); +} + +WindowlessNaClApplication::WindowlessNaClApplication(const Arguments& arguments, Configuration* configuration): Instance(arguments), Graphics3DClient(this), graphics(nullptr), c(nullptr) { + debugOutput = new ConsoleDebugOutput(this); + if(configuration) createContext(configuration); +} + +void WindowlessNaClApplication::createContext(Configuration* configuration) { + if(!tryCreateContext(configuration)) { + Error() << "Platform::WindowlessNaClApplication::createContext(): cannot create context"; + delete configuration; + std::exit(1); + + } else delete configuration; +} + +bool WindowlessNaClApplication::tryCreateContext(Configuration* configuration) { + CORRADE_ASSERT(!c, "Platform::WindowlessNaClApplication::tryCreateContext(): context already created", false); + + const std::int32_t attributes[] = { + PP_GRAPHICS3DATTRIB_ALPHA_SIZE, 8, + PP_GRAPHICS3DATTRIB_DEPTH_SIZE, 24, + PP_GRAPHICS3DATTRIB_STENCIL_SIZE, 8, + PP_GRAPHICS3DATTRIB_WIDTH, 1, + PP_GRAPHICS3DATTRIB_HEIGHT, 1, + PP_GRAPHICS3DATTRIB_NONE + }; + + graphics = new pp::Graphics3D(this, attributes); + if(graphics->is_null()) { + delete graphics; + graphics = nullptr; + return false; + } + if(!BindGraphics(*graphics)) { + Error() << "Platform::WindowlessNaClApplication::tryCreateContext(): cannot bind graphics"; + std::exit(1); + } + + glSetCurrentContextPPAPI(graphics->pp_resource()); + + c = new Context; + return true; +} + +WindowlessNaClApplication::~WindowlessNaClApplication() { + delete c; + delete graphics; + delete debugOutput; +} + +bool WindowlessNaClApplication::Init(uint32_t , const char* , const char*) { + return exec() == 0; +} + +}} diff --git a/src/Platform/WindowlessNaClApplication.h b/src/Platform/WindowlessNaClApplication.h new file mode 100644 index 000000000..d0f4ebb19 --- /dev/null +++ b/src/Platform/WindowlessNaClApplication.h @@ -0,0 +1,201 @@ +#ifndef Magnum_Platform_WindowlessNaClApplication_h +#define Magnum_Platform_WindowlessNaClApplication_h +/* + This file is part of Magnum. + + Copyright © 2010, 2011, 2012, 2013 Vladimír Vondruš + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +*/ + +/** @file + * @brief Class Magnum::Platform::WindowlessNaClApplication + */ + +#include +#include +#include +#include +#include +#include + +#include "Math/Vector2.h" +#include "Magnum.h" + +#include "corradeCompatibility.h" + +namespace pp { + class Graphics3D; + class Fullscreen; +} + +namespace Magnum { namespace Platform { + +/** @nosubgrouping +@brief Windowless NaCl application + +Application running in [Google Chrome Native Client](https://developers.google.com/native-client/). +See @ref platform for brief introduction. + +@section WindowlessNaClApplication-usage Usage + +Place your code into exec(). The subclass must be then registered to NaCl API +using MAGNUM_WINDOWLESSNACLAPPLICATION_MAIN() macro. +@code +class MyApplication: public Magnum::Platform::WindowlessNaClApplication { + // implement required methods... +}; +MAGNUM_WINDOWLESSNACLAPPLICATION_MAIN(MyApplication) +@endcode + +If no other application header is included this class is also aliased to +`Platform::WindowlessApplication` and the macro is aliased to +`MAGNUM_WINDOWLESSAPPLICATION_MAIN()` to simplify porting. + +@section WindowlessNaClApplication-html HTML markup and NMF file + +You need to provide HTML markup containing `<embed>` pointing to `*.nmf` +file describing the application. + +@todoc Document this better, add "bootstrap" examples + +@subsection WindowlessNaClApplication-html-console Redirecting output to Chrome's JavaScript console + +The application redirects @ref Corrade::Utility::Debug "Debug", +@ref Corrade::Utility::Warning "Warning" and @ref Corrade::Utility::Error "Error" +output to JavaScript console. See also @ref Corrade::Utility::NaClConsoleStreamBuffer +for more information. +*/ +class WindowlessNaClApplication: public pp::Instance, public pp::Graphics3DClient { + public: + /** @brief Application arguments */ + typedef PP_Instance Arguments; + + class Configuration; + + /** + * @brief Default constructor + * @param arguments Application arguments + * + * Creates application with default configuration. See Configuration + * for more information. + */ + explicit WindowlessNaClApplication(const Arguments& arguments); + + /** + * @brief Constructor + * @param arguments Application arguments + * @param configuration Configuration + * + * The @p configuration is deleted afterwards. If `nullptr` is passed + * as @p configuration, the context is not created and must be created + * with createContext(). + */ + explicit WindowlessNaClApplication(const Arguments& arguments, Configuration* configuration); + + /** + * @brief Execute application + * @return Value for returning from `main()`. + */ + virtual int exec() = 0; + + protected: + /* Nobody will need to have (and delete) WindowlessNaClApplication*, + thus this is faster than public pure virtual destructor */ + ~WindowlessNaClApplication(); + + /** @copydoc GlutApplication::createContext() */ + void createContext(Configuration* configuration); + + /** @copydoc GlutApplication::tryCreateContext() */ + bool tryCreateContext(Configuration* configuration); + + private: + struct ConsoleDebugOutput; + + void Graphics3DContextLost() override { + CORRADE_ASSERT(false, "NaClApplication: context unexpectedly lost", ); + } + + bool Init(std::uint32_t, const char*, const char*) override; + + pp::Graphics3D* graphics; + Context* c; + ConsoleDebugOutput* debugOutput; +}; + +/** +@brief %Configuration + +@see WindowlessNaClApplication(), createContext(), tryCreateContext() +*/ +class WindowlessNaClApplication::Configuration { + Configuration(const Configuration&) = delete; + Configuration(Configuration&&) = delete; + Configuration& operator=(const Configuration&) = delete; + Configuration& operator=(Configuration&&) = delete; + + public: + constexpr explicit Configuration() {} +}; + +namespace Implementation { + template class WindowlessNaClModule: public pp::Module { + public: + ~WindowlessNaClModule() { glTerminatePPAPI(); } + + bool Init() override { + return glInitializePPAPI(get_browser_interface()); + } + + pp::Instance* CreateInstance(PP_Instance instance) { + return new Application(instance); + } + }; +} + +/** @hideinitializer +@brief Entry point for windowless NaCl application +@param application Application class name + +See WindowlessNaClApplication and @ref portability-applications for more +information. When no other windowless application header is included this macro +is also aliased to `MAGNUM_WINDOWLESSAPPLICATION_MAIN()`. +*/ +/* look at that insane placement of __attribute__. WTF. */ +#define MAGNUM_WINDOWLESSNACLAPPLICATION_MAIN(application) \ + namespace pp { \ + Module __attribute__ ((visibility ("default"))) * CreateModule(); \ + Module __attribute__ ((visibility ("default"))) * CreateModule() { \ + return new Magnum::Platform::Implementation::WindowlessNaClModule(); \ + } \ + } + +#ifndef DOXYGEN_GENERATING_OUTPUT +#ifndef MAGNUM_WINDOWLESSAPPLICATION_MAIN +typedef WindowlessNaClApplication WindowlessApplication; +#define MAGNUM_WINDOWLESSAPPLICATION_MAIN(className) MAGNUM_WINDOWLESSNACLAPPLICATION_MAIN(className) +#else +#undef MAGNUM_WINDOWLESSAPPLICATION_MAIN +#endif +#endif + +}} + +#endif diff --git a/src/Platform/magnum-info-nacl.html b/src/Platform/magnum-info-nacl.html new file mode 100644 index 000000000..f12bcf996 --- /dev/null +++ b/src/Platform/magnum-info-nacl.html @@ -0,0 +1,91 @@ + + + +Magnum Info + + + +

Magnum Info

+
+ + +
Initialization...
+
+
+ + diff --git a/src/Platform/magnum-info-nacl.nmf b/src/Platform/magnum-info-nacl.nmf new file mode 100644 index 000000000..c9de3d8c9 --- /dev/null +++ b/src/Platform/magnum-info-nacl.nmf @@ -0,0 +1,6 @@ +{ + "program": { + "x86-32": {"url": "magnum-info-x86-32.nexe"}, + "x86-64": {"url": "magnum-info-x86-64.nexe"} + } +} diff --git a/src/Platform/magnum-info.cpp b/src/Platform/magnum-info.cpp index e396ca1fd..80c538b68 100644 --- a/src/Platform/magnum-info.cpp +++ b/src/Platform/magnum-info.cpp @@ -24,22 +24,36 @@ #include #include +#ifdef CORRADE_TARGET_NACL +#include +#endif #include "Context.h" +#ifndef CORRADE_TARGET_NACL #include "Platform/WindowlessGlxApplication.h" +#else +#include "Platform/WindowlessNaClApplication.h" +#endif namespace Magnum { -class MagnumInfo: public Platform::WindowlessGlxApplication { +class MagnumInfo: public Platform::WindowlessApplication { public: explicit MagnumInfo(const Arguments& arguments); int exec() override { return 0; } }; -MagnumInfo::MagnumInfo(const Arguments& arguments): WindowlessGlxApplication(arguments) { +MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplication(arguments) { Context* c = Context::current(); + /* Pass debug output as messages to JavaScript */ + #ifdef CORRADE_TARGET_NACL + Utility::NaClMessageStreamBuffer buffer(this); + std::ostream out(&buffer); + Debug::setOutput(&out); + #endif + Debug() << ""; Debug() << " +---------------------------------------------------------+"; Debug() << " | Information about Magnum engine and OpenGL capabilities |"; @@ -47,43 +61,44 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): WindowlessGlxApplication(arg Debug() << ""; Debug() << "Used application: Platform::WindowlessGlxApplication"; - { - Debug d; - d << "Compilation flags:"; - #ifdef CORRADE_GCC44_COMPATIBILITY - d << "CORRADE_GCC44_COMPATIBILITY"; - #endif - #ifdef CORRADE_GCC45_COMPATIBILITY - d << "CORRADE_GCC45_COMPATIBILITY"; - #endif - #ifdef CORRADE_GCC46_COMPATIBILITY - d << "CORRADE_GCC46_COMPATIBILITY"; - #endif - #ifdef CORRADE_BUILD_STATIC - d << "CORRADE_BUILD_STATIC"; - #endif - #ifdef MAGNUM_BUILD_STATIC - d << "MAGNUM_BUILD_STATIC"; - #endif - #ifdef CORRADE_TARGET_NACL - d << "CORRADE_TARGET_NACL"; - #endif - #ifdef CORRADE_TARGET_NACL_NEWLIB - d << "CORRADE_TARGET_NACL_NEWLIB"; - #endif - #ifdef CORRADE_TARGET_NACL_GLIBC - d << "CORRADE_TARGET_NACL_GLIBC"; - #endif - #ifdef MAGNUM_TARGET_GLES - d << "MAGNUM_TARGET_GLES"; - #endif - #ifdef MAGNUM_TARGET_GLES2 - d << "MAGNUM_TARGET_GLES2"; - #endif - #ifdef MAGNUM_TARGET_DESKTOP_GLES - d << "MAGNUM_TARGET_DESKTOP_GLES"; - #endif - } + + Debug() << "Compilation flags:"; + #ifdef CORRADE_GCC44_COMPATIBILITY + Debug() << " CORRADE_GCC44_COMPATIBILITY"; + #endif + #ifdef CORRADE_GCC45_COMPATIBILITY + Debug() << " CORRADE_GCC45_COMPATIBILITY"; + #endif + #ifdef CORRADE_GCC46_COMPATIBILITY + Debug() << " CORRADE_GCC46_COMPATIBILITY"; + #endif + #ifdef CORRADE_GCC47_COMPATIBILITY + Debug() << " CORRADE_GCC47_COMPATIBILITY"; + #endif + #ifdef CORRADE_BUILD_STATIC + Debug() << " CORRADE_BUILD_STATIC"; + #endif + #ifdef MAGNUM_BUILD_STATIC + Debug() << " MAGNUM_BUILD_STATIC"; + #endif + #ifdef CORRADE_TARGET_NACL + Debug() << " CORRADE_TARGET_NACL"; + #endif + #ifdef CORRADE_TARGET_NACL_NEWLIB + Debug() << " CORRADE_TARGET_NACL_NEWLIB"; + #endif + #ifdef CORRADE_TARGET_NACL_GLIBC + Debug() << " CORRADE_TARGET_NACL_GLIBC"; + #endif + #ifdef MAGNUM_TARGET_GLES + Debug() << " MAGNUM_TARGET_GLES"; + #endif + #ifdef MAGNUM_TARGET_GLES2 + Debug() << " MAGNUM_TARGET_GLES2"; + #endif + #ifdef MAGNUM_TARGET_DESKTOP_GLES + Debug() << " MAGNUM_TARGET_DESKTOP_GLES"; + #endif Debug() << ""; Debug() << "Vendor:" << c->vendorString(); @@ -145,4 +160,4 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): WindowlessGlxApplication(arg } -MAGNUM_WINDOWLESSGLXAPPLICATION_MAIN(Magnum::MagnumInfo) +MAGNUM_WINDOWLESSAPPLICATION_MAIN(Magnum::MagnumInfo)