automatic multiprocessor builds, fix compilation when COLLADA is missing
parent
3d3048f7de
commit
debd09e75f
16
SConstruct
16
SConstruct
|
@ -3,6 +3,7 @@ import sys
|
|||
import glob
|
||||
import os
|
||||
import fnmatch
|
||||
import multiprocessing
|
||||
|
||||
if not os.path.exists('config.py'):
|
||||
print 'A configuration file must be selected! Have a look at \"README\"'
|
||||
|
@ -66,6 +67,10 @@ if env.has_key('BOOSTINCLUDE'):
|
|||
if env.has_key('BASELIBDIR'):
|
||||
env.Append(LIBPATH=env['BASELIBDIR'])
|
||||
|
||||
env.Decider('MD5-timestamp')
|
||||
|
||||
env.SetOption('num_jobs', multiprocessing.cpu_count())
|
||||
|
||||
AddOption("--dist", dest="dist", type="string", nargs=0, action='store', help='Make an official release')
|
||||
|
||||
# Check whether everything important is available
|
||||
|
@ -205,6 +210,9 @@ def osxlibinst_build_function(self, target, source, pkgname = None, use_own = No
|
|||
env.__class__.StripInst = stripinst_build_function
|
||||
env.__class__.OSXLibInst = osxlibinst_build_function
|
||||
|
||||
if hasCollada:
|
||||
env.Append(CPPDEFINES = [['MTS_HAS_COLLADA', 1]] )
|
||||
|
||||
env.SConsignFile()
|
||||
|
||||
# MSVC: Embed the manifest
|
||||
|
@ -240,7 +248,7 @@ if coreEnv.has_key('JPEGINCLUDE'):
|
|||
if coreEnv.has_key('JPEGLIB'):
|
||||
coreEnv.Append(LIBS=env['JPEGLIB'])
|
||||
|
||||
coreEnv.Append(CPPDEFINES = {'MTS_BUILD_MODULE' : 'MTS_MODULE_CORE'} )
|
||||
coreEnv.Append(CPPDEFINES = [['MTS_BUILD_MODULE', 'MTS_MODULE_CORE']])
|
||||
libcore_objects = [
|
||||
'src/libcore/class.cpp', 'src/libcore/object.cpp',
|
||||
'src/libcore/statistics.cpp', 'src/libcore/thread.cpp',
|
||||
|
@ -276,7 +284,7 @@ env.Append(LIBPATH=['src/libcore'])
|
|||
|
||||
# Rendering-specific library
|
||||
renderEnv = env.Clone()
|
||||
renderEnv.Append(CPPDEFINES = {'MTS_BUILD_MODULE' : 'MTS_MODULE_RENDER'} )
|
||||
renderEnv.Append(CPPDEFINES = [['MTS_BUILD_MODULE', 'MTS_MODULE_RENDER']] )
|
||||
if renderEnv.has_key('XERCESINCLUDE'):
|
||||
renderEnv.Append(CPPPATH=renderEnv['XERCESINCLUDE'])
|
||||
if renderEnv.has_key('XERCESLIBDIR'):
|
||||
|
@ -330,7 +338,7 @@ elif sys.platform == 'linux2':
|
|||
'src/libhw/glxrenderer.cpp']
|
||||
|
||||
glEnv = env.Clone()
|
||||
glEnv.Append(CPPDEFINES = {'MTS_BUILD_MODULE' : 'MTS_MODULE_HW'} )
|
||||
glEnv.Append(CPPDEFINES = [['MTS_BUILD_MODULE', 'MTS_MODULE_HW']] )
|
||||
if glEnv.has_key('GLLIB'):
|
||||
glEnv.Append(LIBS=glEnv['GLLIB'])
|
||||
if glEnv.has_key('GLLIBDIR'):
|
||||
|
@ -423,6 +431,7 @@ if hasQt:
|
|||
qtEnv = mainEnv.Clone()
|
||||
qtEnv.Append(CPPPATH=['src/qtgui'])
|
||||
qtEnv.EnableQt4Modules(['QtGui', 'QtCore', 'QtOpenGL', 'QtXml', 'QtNetwork'])
|
||||
print(qtEnv.Dump())
|
||||
if sys.platform == 'win32':
|
||||
index = qtEnv['CXXFLAGS'].index('_CONSOLE')
|
||||
del qtEnv['CXXFLAGS'][index-1]
|
||||
|
@ -449,6 +458,7 @@ if hasQt:
|
|||
|
||||
if sys.platform == 'darwin':
|
||||
qtEnv_osx = qtEnv.Clone();
|
||||
# Objective C++ does not permit the following optimization flags
|
||||
qtEnv_osx['CXXFLAGS'].remove('-fstrict-aliasing');
|
||||
qtEnv_osx['CXXFLAGS'].remove('-ftree-vectorize');
|
||||
qtEnv_osx['CXXFLAGS'].append('-fno-strict-aliasing');
|
||||
|
|
|
@ -443,6 +443,7 @@ void MainWindow::onBugReportSubmitted() {
|
|||
}
|
||||
|
||||
void MainWindow::on_actionImport_triggered() {
|
||||
#if defined(MTS_HAS_COLLADA)
|
||||
ref<FileResolver> resolver = FileResolver::getInstance();
|
||||
ref<FileResolver> newResolver = resolver->clone();
|
||||
for (int i=0; i<m_searchPaths.size(); ++i)
|
||||
|
@ -457,6 +458,13 @@ void MainWindow::on_actionImport_triggered() {
|
|||
dialog->show();
|
||||
qApp->processEvents();
|
||||
m_activeWindowHack = false;
|
||||
#else
|
||||
QMessageBox::critical(this, tr("Importer disabled"),
|
||||
tr("The importer is disabled in this build. To use it, you will need "
|
||||
"to install COLLADA-DOM and recompile Mitsuba -- please see the "
|
||||
"documentation for more details."),
|
||||
QMessageBox::Ok);
|
||||
#endif
|
||||
}
|
||||
|
||||
void MainWindow::onImportDialogClose(int reason) {
|
||||
|
|
|
@ -52,6 +52,7 @@ SceneImporter::~SceneImporter() {
|
|||
|
||||
void SceneImporter::run() {
|
||||
FileResolver::setInstance(m_resolver);
|
||||
#if defined(MTS_HAS_COLLADA)
|
||||
try {
|
||||
GUIGeometryConverter cvt(m_parent);
|
||||
cvt.setSRGB(m_srgb);
|
||||
|
@ -62,6 +63,9 @@ void SceneImporter::run() {
|
|||
} catch (...) {
|
||||
SLog(EWarn, "An unknown type of error occurred!");
|
||||
}
|
||||
#else
|
||||
SLog(EWarn, "The importer was disabled in this build!");
|
||||
#endif
|
||||
m_wait->set(true);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue