diff options
author | Daniel Teske <[email protected]> | 2011-10-10 13:31:54 +0200 |
---|---|---|
committer | Daniel Teske <[email protected]> | 2011-10-10 13:35:22 +0200 |
commit | 42b56788ea347f1e4f4508db6737e69e37047235 (patch) | |
tree | 7dc8d57da7a37580faa6a7879ce9c5c18da3c651 /src/plugins/cmakeprojectmanager/cmakeproject.cpp | |
parent | dbf48009cc9ac78b99f9c0f01210f38f9ca41f77 (diff) |
Fix a crash with cmake and no toolchains configured
Task-number: QTCREATORBUG-6252
Change-Id: I8b7237c23cd70fe8dd20724ffb3ebdef18f5bf13
Reviewed-on: http://codereview.qt-project.org/6320
Reviewed-by: Daniel Teske <[email protected]>
Sanity-Review: Qt Sanity Bot <[email protected]>
Diffstat (limited to 'src/plugins/cmakeprojectmanager/cmakeproject.cpp')
-rw-r--r-- | src/plugins/cmakeprojectmanager/cmakeproject.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.cpp b/src/plugins/cmakeprojectmanager/cmakeproject.cpp index f63849d7227..ae7fc11f34b 100644 --- a/src/plugins/cmakeprojectmanager/cmakeproject.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeproject.cpp @@ -288,7 +288,9 @@ bool CMakeProject::parseCMakeLists() allIncludePaths.append(cbpparser.includeFiles()); QStringList allFrameworkPaths; - QList<ProjectExplorer::HeaderPath> allHeaderPaths = activeBC->toolChain()->systemHeaderPaths(); + QList<ProjectExplorer::HeaderPath> allHeaderPaths; + if (activeBC->toolChain()) + allHeaderPaths = activeBC->toolChain()->systemHeaderPaths(); foreach (const ProjectExplorer::HeaderPath &headerPath, allHeaderPaths) { if (headerPath.kind() == ProjectExplorer::HeaderPath::FrameworkHeaderPath) allFrameworkPaths.append(headerPath.path()); @@ -302,12 +304,12 @@ bool CMakeProject::parseCMakeLists() CPlusPlus::CppModelManagerInterface::ProjectInfo pinfo = modelmanager->projectInfo(this); if (pinfo.includePaths != allIncludePaths || pinfo.sourceFiles != m_files - || pinfo.defines != activeBC->toolChain()->predefinedMacros() + || pinfo.defines != (activeBC->toolChain() ? activeBC->toolChain()->predefinedMacros() : QByteArray()) || pinfo.frameworkPaths != allFrameworkPaths) { pinfo.includePaths = allIncludePaths; // TODO we only want C++ files, not all other stuff that might be in the project pinfo.sourceFiles = m_files; - pinfo.defines = activeBC->toolChain()->predefinedMacros(); // TODO this is to simplistic + pinfo.defines = (activeBC->toolChain() ? activeBC->toolChain()->predefinedMacros() : QByteArray()); // TODO this is to simplistic pinfo.frameworkPaths = allFrameworkPaths; modelmanager->updateProjectInfo(pinfo); m_codeModelFuture.cancel(); |