Browse Source

Merge branch 'master' into compatibility

Conflicts:
	src/Magnum/Platform/AndroidApplication.cpp
Vladimír Vondruš 12 years ago
parent
commit
20c8ab0329
  1. 9
      doc/building.dox
  2. 129
      package/ci/jenkins-mingw32.xml
  3. 36
      src/Magnum/Platform/AndroidApplication.cpp
  4. 2
      src/Magnum/Shaders/MeshVisualizer.cpp
  5. 14
      src/MagnumPlugins/ObjImporter/ObjImporter.cpp

9
doc/building.dox

@ -504,12 +504,11 @@ in `axes/hudson.matrix.TextAxis` or via the web interface later.
Magnum-Compatibility-GLTests depend on active X11 session, thus they should be Magnum-Compatibility-GLTests depend on active X11 session, thus they should be
run from Jenkins instance running on graphical user session. run from Jenkins instance running on graphical user session.
There is also MinGW32, MinGW-w64, Emscripten and NaCl configuration, add or There is also MinGW-w64, Emscripten and NaCl configuration, add or update them
update them with the commands below. See @ref building-crosscompiling for more with the commands below. See @ref building-crosscompiling for more information
information about setting up the crosscompilers and `toolchains/` submodule. about setting up the crosscompilers and `toolchains/` submodule. For Emscripten
For Emscripten you need also **Node.js** installed to run the tests. you need also **Node.js** installed to run the tests.
java -jar jenkins-cli.jar -s http://your-jenkins-server <command> Magnum-MinGW32 < jenkins-mingw32.xml
java -jar jenkins-cli.jar -s http://your-jenkins-server <command> Magnum-MinGW-w64 < jenkins-mingw-w64.xml java -jar jenkins-cli.jar -s http://your-jenkins-server <command> Magnum-MinGW-w64 < jenkins-mingw-w64.xml
java -jar jenkins-cli.jar -s http://your-jenkins-server <command> Magnum-Emscripten < jenkins-emscripten.xml java -jar jenkins-cli.jar -s http://your-jenkins-server <command> Magnum-Emscripten < jenkins-emscripten.xml
java -jar jenkins-cli.jar -s http://your-jenkins-server <command> Magnum-NaCl < jenkins-nacl.xml java -jar jenkins-cli.jar -s http://your-jenkins-server <command> Magnum-NaCl < jenkins-nacl.xml

129
package/ci/jenkins-mingw32.xml

@ -1,129 +0,0 @@
<?xml version='1.0' encoding='UTF-8'?>
<matrix-project>
<actions/>
<description></description>
<logRotator class="hudson.tasks.LogRotator">
<daysToKeep>-1</daysToKeep>
<numToKeep>10</numToKeep>
<artifactDaysToKeep>-1</artifactDaysToKeep>
<artifactNumToKeep>-1</artifactNumToKeep>
</logRotator>
<keepDependencies>false</keepDependencies>
<properties/>
<scm class="hudson.plugins.git.GitSCM" plugin="git@2.0">
<configVersion>2</configVersion>
<userRemoteConfigs>
<hudson.plugins.git.UserRemoteConfig>
<url>git://github.com/mosra/magnum.git</url>
</hudson.plugins.git.UserRemoteConfig>
</userRemoteConfigs>
<branches>
<hudson.plugins.git.BranchSpec>
<name>*/master</name>
</hudson.plugins.git.BranchSpec>
</branches>
<doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
<submoduleCfg class="list"/>
<extensions>
<hudson.plugins.git.extensions.impl.CloneOption>
<shallow>true</shallow>
<reference></reference>
</hudson.plugins.git.extensions.impl.CloneOption>
</extensions>
</scm>
<canRoam>true</canRoam>
<disabled>false</disabled>
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
<triggers/>
<concurrentBuild>false</concurrentBuild>
<customWorkspace>Magnum</customWorkspace>
<axes>
<hudson.matrix.TextAxis>
<name>libraries</name>
<values>
<string>static</string>
<string>dynamic</string>
</values>
</hudson.matrix.TextAxis>
<hudson.matrix.TextAxis>
<name>compatibility</name>
<values>
<string></string>
<string>deprecated</string>
</values>
</hudson.matrix.TextAxis>
</axes>
<builders>
<hudson.tasks.Shell>
<command>
<![CDATA[
git submodule init
git submodule update
if [ ${libraries} = "static" ] ; then
static_build_flag="-DBUILD_STATIC=ON -DBUILD_STATIC_PIC=ON"
fi
if [ "${compatibility}" = "deprecated" ] ; then
deprecated_build_flag=ON
else
deprecated_build_flag=OFF
fi
mkdir -p build-mingw32-${libraries}-${compatibility}
cd build-mingw32-${libraries}-${compatibility}
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE=../toolchains/archlinux/basic-mingw32.cmake \
-DCMAKE_FIND_ROOT_PATH=${JENKINS_HOME}/filesystem/mingw32-${libraries}-${compatibility} \
-DCMAKE_INSTALL_PREFIX=${JENKINS_HOME}/filesystem/mingw32-${libraries}-${compatibility} \
-DBUILD_TESTS=ON \
-DBUILD_DEPRECATED=${deprecated_build_flag} \
${static_build_flag} \
-DWITH_AUDIO=ON \
-DWITH_GLUTAPPLICATION=ON \
`#-DWITH_SDL2APPLICATION=ON` \
-DWITH_MAGNUMFONT=ON \
-DWITH_MAGNUMFONTCONVERTER=ON \
-DWITH_OBJIMPORTER=ON \
-DWITH_TGAIMAGECONVERTER=ON \
-DWITH_TGAIMPORTER=ON \
-DWITH_WAVAUDIOIMPORTER=ON \
`#-DWITH_DISTANCEFIELDCONVERTER=ON` \
`#-DWITH_FONTCONVERTER=ON` \
`#-DWITH_MAGNUMINFO=ON` \
-G Ninja
ninja
ninja install/strip
]]>
</command>
</hudson.tasks.Shell>
</builders>
<publishers>
<hudson.plugins.textfinder.TextFinderPublisher plugin="text-finder@1.9">
<regexp>Errors while running CTest</regexp>
<succeedIfFound>false</succeedIfFound>
<unstableIfFound>true</unstableIfFound>
<alsoCheckConsoleOutput>true</alsoCheckConsoleOutput>
</hudson.plugins.textfinder.TextFinderPublisher>
</publishers>
<buildWrappers/>
<executionStrategy class="hudson.matrix.DefaultMatrixExecutionStrategyImpl">
<runSequentially>true</runSequentially>
<touchStoneCombinationFilter>
<![CDATA[
libraries == "dynamic" && compatibility == "deprecated"
]]>
</touchStoneCombinationFilter>
<touchStoneResultCondition>
<name>UNSTABLE</name>
<ordinal>1</ordinal>
<color>YELLOW</color>
<completeBuild>true</completeBuild>
</touchStoneResultCondition>
</executionStrategy>
<childCustomWorkspace>.</childCustomWorkspace>
</matrix-project>

36
src/Magnum/Platform/AndroidApplication.cpp

@ -34,7 +34,23 @@
namespace Magnum { namespace Platform { namespace Magnum { namespace Platform {
/** @todo Delegating constructors when support for GCC 4.6 can be dropped */ struct AndroidApplication::LogOutput {
LogOutput();
Utility::AndroidLogStreamBuffer debugBuffer, warningBuffer, errorBuffer;
std::ostream debugStream, warningStream, errorStream;
};
AndroidApplication::LogOutput::LogOutput():
debugBuffer(Utility::AndroidLogStreamBuffer::LogPriority::Info, "magnum"),
warningBuffer(Utility::AndroidLogStreamBuffer::LogPriority::Warning, "magnum"),
errorBuffer(Utility::AndroidLogStreamBuffer::LogPriority::Error, "magnum"),
debugStream(&debugBuffer), warningStream(&warningBuffer), errorStream(&errorBuffer)
{
Debug::setOutput(&debugStream);
Warning::setOutput(&warningStream);
Error::setOutput(&errorStream);
}
AndroidApplication::AndroidApplication(const Arguments& arguments, const Configuration& configuration): _state(arguments) { AndroidApplication::AndroidApplication(const Arguments& arguments, const Configuration& configuration): _state(arguments) {
initialize(); initialize();
@ -59,24 +75,6 @@ AndroidApplication::~AndroidApplication() {
eglTerminate(_display); eglTerminate(_display);
} }
struct AndroidApplication::LogOutput {
LogOutput();
Utility::AndroidLogStreamBuffer debugBuffer, warningBuffer, errorBuffer;
std::ostream debugStream, warningStream, errorStream;
};
AndroidApplication::LogOutput::LogOutput():
debugBuffer(Utility::AndroidLogStreamBuffer::LogPriority::Info, "magnum"),
warningBuffer(Utility::AndroidLogStreamBuffer::LogPriority::Warning, "magnum"),
errorBuffer(Utility::AndroidLogStreamBuffer::LogPriority::Error, "magnum"),
debugStream(&debugBuffer), warningStream(&warningBuffer), errorStream(&errorBuffer)
{
Debug::setOutput(&debugStream);
Warning::setOutput(&warningStream);
Error::setOutput(&errorStream);
}
void AndroidApplication::initialize() { void AndroidApplication::initialize() {
/* Redirect debug output to Android log */ /* Redirect debug output to Android log */
_logOutput.reset(new LogOutput); _logOutput.reset(new LogOutput);

2
src/Magnum/Shaders/MeshVisualizer.cpp

@ -63,7 +63,7 @@ MeshVisualizer::MeshVisualizer(const Flags flags): flags(flags), transformationP
.addSource(flags & Flag::NoGeometryShader ? "#define NO_GEOMETRY_SHADER\n" : "") .addSource(flags & Flag::NoGeometryShader ? "#define NO_GEOMETRY_SHADER\n" : "")
#ifdef MAGNUM_TARGET_WEBGL #ifdef MAGNUM_TARGET_WEBGL
.addSource("#define SUBSCRIPTING_WORKAROUND\n") .addSource("#define SUBSCRIPTING_WORKAROUND\n")
#elif defined(MAGNUM_TARGET_GLES) #elif defined(MAGNUM_TARGET_GLES2)
.addSource(Context::current()->detectedDriver() & Context::DetectedDriver::ProbablyAngle ? .addSource(Context::current()->detectedDriver() & Context::DetectedDriver::ProbablyAngle ?
"#define SUBSCRIPTING_WORKAROUND\n" : "") "#define SUBSCRIPTING_WORKAROUND\n" : "")
#endif #endif

14
src/MagnumPlugins/ObjImporter/ObjImporter.cpp

@ -38,7 +38,7 @@
#include "Magnum/Math/Vector3.h" #include "Magnum/Math/Vector3.h"
#include "Magnum/Trade/MeshData3D.h" #include "Magnum/Trade/MeshData3D.h"
#ifdef CORRADE_TARGET_NACL_NEWLIB #if defined(CORRADE_TARGET_NACL_NEWLIB) || defined(CORRADE_TARGET_ANDROID)
#include <sstream> #include <sstream>
#endif #endif
@ -66,12 +66,12 @@ template<std::size_t size> Math::Vector<size, Float> extractFloatData(std::strin
Math::Vector<size, Float> output; Math::Vector<size, Float> output;
#ifdef CORRADE_TARGET_NACL_NEWLIB #if defined(CORRADE_TARGET_NACL_NEWLIB) || defined(CORRADE_TARGET_ANDROID)
std::istringstream in; std::istringstream in;
#endif #endif
for(std::size_t i = 0; i != size; ++i) { for(std::size_t i = 0; i != size; ++i) {
#ifndef CORRADE_TARGET_NACL_NEWLIB #if !defined(CORRADE_TARGET_NACL_NEWLIB) && !defined(CORRADE_TARGET_ANDROID)
output[i] = std::stof(data[i]); output[i] = std::stof(data[i]);
#else #else
in.str(data[i]); in.str(data[i]);
@ -80,7 +80,7 @@ template<std::size_t size> Math::Vector<size, Float> extractFloatData(std::strin
} }
if(data.size() == size+1) { if(data.size() == size+1) {
#ifndef CORRADE_TARGET_NACL_NEWLIB #if !defined(CORRADE_TARGET_NACL_NEWLIB) && !defined(CORRADE_TARGET_ANDROID)
*extra = std::stof(data.back()); *extra = std::stof(data.back());
#else #else
in.str(data.back()); in.str(data.back());
@ -381,7 +381,7 @@ std::optional<MeshData3D> ObjImporter::doMesh3D(UnsignedInt id) {
} }
/* Position indices */ /* Position indices */
#ifndef CORRADE_TARGET_NACL_NEWLIB #if !defined(CORRADE_TARGET_NACL_NEWLIB) && !defined(CORRADE_TARGET_ANDROID)
positionIndices.push_back(std::stoul(indices[0]) - positionIndexOffset); positionIndices.push_back(std::stoul(indices[0]) - positionIndexOffset);
#else #else
std::istringstream in(indices[0]); std::istringstream in(indices[0]);
@ -392,7 +392,7 @@ std::optional<MeshData3D> ObjImporter::doMesh3D(UnsignedInt id) {
/* Texture coordinates */ /* Texture coordinates */
if(indices.size() == 2 || (indices.size() == 3 && !indices[1].empty())) { if(indices.size() == 2 || (indices.size() == 3 && !indices[1].empty())) {
#ifndef CORRADE_TARGET_NACL_NEWLIB #if !defined(CORRADE_TARGET_NACL_NEWLIB) && !defined(CORRADE_TARGET_ANDROID)
textureCoordinateIndices.push_back(std::stoul(indices[1]) - textureCoordinateIndexOffset); textureCoordinateIndices.push_back(std::stoul(indices[1]) - textureCoordinateIndexOffset);
#else #else
in.str(indices[1]); in.str(indices[1]);
@ -403,7 +403,7 @@ std::optional<MeshData3D> ObjImporter::doMesh3D(UnsignedInt id) {
/* Normal indices */ /* Normal indices */
if(indices.size() == 3) { if(indices.size() == 3) {
#ifndef CORRADE_TARGET_NACL_NEWLIB #if !defined(CORRADE_TARGET_NACL_NEWLIB) && !defined(CORRADE_TARGET_ANDROID)
normalIndices.push_back(std::stoul(indices[2]) - normalIndexOffset); normalIndices.push_back(std::stoul(indices[2]) - normalIndexOffset);
#else #else
in.str(indices[2]); in.str(indices[2]);

Loading…
Cancel
Save