From 1fcbf012881e87f529d80c4037b96981af75449c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 13 Nov 2013 13:39:58 +0100 Subject: [PATCH 1/3] Enable everything possible in development PKGBUILDs. --- PKGBUILD | 7 ++++++- PKGBUILD-gcc46 | 7 ++++++- PKGBUILD-gcc47 | 7 ++++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index 9e1cdf500..8ea54a4b0 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -27,6 +27,7 @@ build() { cmake .. \ -DCMAKE_BUILD_TYPE=Debug \ -DCMAKE_INSTALL_PREFIX=/usr \ + -DWITH_AUDIO=ON \ -DWITH_GLUTAPPLICATION=ON \ -DWITH_GLXAPPLICATION=ON \ -DWITH_SDL2APPLICATION=ON \ @@ -35,7 +36,11 @@ build() { -DWITH_TGAIMAGECONVERTER=ON \ -DWITH_TGAIMPORTER=ON \ -DWITH_WAVAUDIOIMPORTER=ON \ - -DBUILD_TESTS=TRUE \ + -DWITH_DISTANCEFIELDCONVERTER=ON \ + -DWITH_FONTCONVERTER=ON \ + -DWITH_MAGNUMINFO=ON \ + -DBUILD_TESTS=ON \ + -DBUILD_GL_TESTS=ON \ -G Ninja ninja } diff --git a/PKGBUILD-gcc46 b/PKGBUILD-gcc46 index 4912b65e7..2f64c0717 100644 --- a/PKGBUILD-gcc46 +++ b/PKGBUILD-gcc46 @@ -26,6 +26,7 @@ build() { cmake .. \ -DCMAKE_BUILD_TYPE=Debug \ -DCMAKE_INSTALL_PREFIX=/usr \ + -DWITH_AUDIO=ON \ -DWITH_GLUTAPPLICATION=ON \ -DWITH_GLXAPPLICATION=ON \ -DWITH_SDL2APPLICATION=ON \ @@ -34,7 +35,11 @@ build() { -DWITH_TGAIMAGECONVERTER=ON \ -DWITH_TGAIMPORTER=ON \ -DWITH_WAVAUDIOIMPORTER=ON \ - -DBUILD_TESTS=TRUE + -DWITH_DISTANCEFIELDCONVERTER=ON \ + -DWITH_FONTCONVERTER=ON \ + -DWITH_MAGNUMINFO=ON \ + -DBUILD_TESTS=ON \ + -DBUILD_GL_TESTS=ON ninja } diff --git a/PKGBUILD-gcc47 b/PKGBUILD-gcc47 index 64b6b4d7b..ec8a8bc5f 100644 --- a/PKGBUILD-gcc47 +++ b/PKGBUILD-gcc47 @@ -26,6 +26,7 @@ build() { cmake .. \ -DCMAKE_BUILD_TYPE=Debug \ -DCMAKE_INSTALL_PREFIX=/usr \ + -DWITH_AUDIO=ON \ -DWITH_GLUTAPPLICATION=ON \ -DWITH_GLXAPPLICATION=ON \ -DWITH_SDL2APPLICATION=ON \ @@ -34,7 +35,11 @@ build() { -DWITH_TGAIMAGECONVERTER=ON \ -DWITH_TGAIMPORTER=ON \ -DWITH_WAVAUDIOIMPORTER=ON \ - -DBUILD_TESTS=TRUE + -DWITH_DISTANCEFIELDCONVERTER=ON \ + -DWITH_FONTCONVERTER=ON \ + -DWITH_MAGNUMINFO=ON \ + -DBUILD_TESTS=ON \ + -DBUILD_GL_TESTS=ON ninja } From 4048071895190572af2d813abf691dcfc562b22a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 13 Nov 2013 13:40:22 +0100 Subject: [PATCH 2/3] GCC 4.6 compatibility: no std::unordered_map::emplace(). --- src/Plugins/MagnumFont/MagnumFont.cpp | 4 ++++ src/Plugins/MagnumFontConverter/MagnumFontConverter.cpp | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/src/Plugins/MagnumFont/MagnumFont.cpp b/src/Plugins/MagnumFont/MagnumFont.cpp index aca408387..811f2a2cd 100644 --- a/src/Plugins/MagnumFont/MagnumFont.cpp +++ b/src/Plugins/MagnumFont/MagnumFont.cpp @@ -157,7 +157,11 @@ std::pair MagnumFont::openInternal(Utility::Configuration&& conf, for(const Utility::ConfigurationGroup* const c: chars) { const UnsignedInt glyphId = c->value("glyph"); CORRADE_INTERNAL_ASSERT(glyphId < _opened->glyphAdvance.size()); + #ifndef CORRADE_GCC46_COMPATIBILITY _opened->glyphId.emplace(c->value("unicode"), glyphId); + #else + _opened->glyphId.insert({c->value("unicode"), glyphId}); + #endif } return {_opened->conf.value("fontSize"), _opened->conf.value("lineHeight")}; diff --git a/src/Plugins/MagnumFontConverter/MagnumFontConverter.cpp b/src/Plugins/MagnumFontConverter/MagnumFontConverter.cpp index 1e6f381b2..8bea885a8 100644 --- a/src/Plugins/MagnumFontConverter/MagnumFontConverter.cpp +++ b/src/Plugins/MagnumFontConverter/MagnumFontConverter.cpp @@ -63,9 +63,17 @@ std::vector>> MagnumFont should stay at position 0 */ std::unordered_map glyphIdMap; glyphIdMap.reserve(cache.glyphCount()); + #ifndef CORRADE_GCC46_COMPATIBILITY glyphIdMap.emplace(0, 0); + #else + glyphIdMap.insert({0, 0}); + #endif for(const std::pair>& glyph: cache) + #ifndef CORRADE_GCC46_COMPATIBILITY glyphIdMap.emplace(glyph.first, glyphIdMap.size()); + #else + glyphIdMap.insert({glyph.first, glyphIdMap.size()}); + #endif /** @todo Save only glyphs contained in @p characters */ From 77fbed450e775449287c1800df27dcb00a7bef81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 13 Nov 2013 13:40:53 +0100 Subject: [PATCH 3/3] GCC 4.6 compatibility: apparently can't list-initialize a structure. --- src/Plugins/MagnumFont/MagnumFont.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Plugins/MagnumFont/MagnumFont.cpp b/src/Plugins/MagnumFont/MagnumFont.cpp index 811f2a2cd..4bfd97c61 100644 --- a/src/Plugins/MagnumFont/MagnumFont.cpp +++ b/src/Plugins/MagnumFont/MagnumFont.cpp @@ -36,6 +36,10 @@ namespace Magnum { namespace Text { struct MagnumFont::Data { + #ifdef CORRADE_GCC46_COMPATIBILITY + explicit Data(Utility::Configuration&& conf, Trade::ImageData2D&& image, std::unordered_map&& glyphId, std::vector&& glyphAdvance): conf(std::move(conf)), image(std::move(image)), glyphId(std::move(glyphId)), glyphAdvance(std::move(glyphAdvance)) {} + #endif + Utility::Configuration conf; Trade::ImageData2D image; std::unordered_map glyphId;