forked from qt-creator/qt-creator
		
	CompilationDatabase: Asjust the sysroot and target handling
If the sysroot option is found - set it as a kit sysroot (only in CompilationDatabase project where we have a cloned kit which does not affect the other existing kits). In other cases use the backup for the sysroot from the toolchain (can exist for clang toolchains based on mingw). Provide target when searching builtin include paths for clang. Fixes: QTCREATORBUG-22339 Change-Id: Ibe07c2e490ba4f7e0d259e6df698d641dbfd0298 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
		
				
					committed by
					
						
						Ivan Donchevskii
					
				
			
			
				
	
			
			
			
						parent
						
							a5148b5363
						
					
				
				
					commit
					cc9d246b02
				
			@@ -98,7 +98,8 @@ void filteredFlags(const QString &fileName,
 | 
			
		||||
                   QStringList &flags,
 | 
			
		||||
                   HeaderPaths &headerPaths,
 | 
			
		||||
                   Macros ¯os,
 | 
			
		||||
                   CppTools::ProjectFile::Kind &fileKind)
 | 
			
		||||
                   CppTools::ProjectFile::Kind &fileKind,
 | 
			
		||||
                   QString &sysRoot)
 | 
			
		||||
{
 | 
			
		||||
    if (flags.empty())
 | 
			
		||||
        return;
 | 
			
		||||
@@ -182,6 +183,12 @@ void filteredFlags(const QString &fileName,
 | 
			
		||||
            continue;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (flag.startsWith("--sysroot=")) {
 | 
			
		||||
            if (sysRoot.isEmpty())
 | 
			
		||||
                sysRoot = flag.mid(10);
 | 
			
		||||
            continue;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if ((flag.startsWith("-std=") || flag.startsWith("/std:"))
 | 
			
		||||
                && fileKind == CppTools::ProjectFile::Unclassified) {
 | 
			
		||||
            const bool cpp = (flag.contains("c++") || flag.contains("gnu++"));
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user