mirror of
				https://github.com/MaskRay/ccls.git
				synced 2025-11-03 22:04:24 +00:00 
			
		
		
		
	Add compileCommandsDirectory to config struct
This commit is contained in:
		
							parent
							
								
									dba27c3d34
								
							
						
					
					
						commit
						b7059e69d7
					
				@ -1462,6 +1462,12 @@ bool QueryDbMainLoop(Config* config,
 | 
			
		||||
            LOG_S(FATAL) << "Exiting; no cache directory";
 | 
			
		||||
            exit(1);
 | 
			
		||||
          }
 | 
			
		||||
          // Make sure compile commands directory is valid.
 | 
			
		||||
          if (config->compileCommandsDirectory.empty()) {
 | 
			
		||||
            LOG_S(ERROR) << "No compile commands directory";
 | 
			
		||||
            exit(1);
 | 
			
		||||
          }
 | 
			
		||||
 | 
			
		||||
          config->cacheDirectory = NormalizePath(config->cacheDirectory);
 | 
			
		||||
          EnsureEndsInSlash(config->cacheDirectory);
 | 
			
		||||
          MakeDirectoryRecursive(config->cacheDirectory);
 | 
			
		||||
@ -1566,7 +1572,7 @@ bool QueryDbMainLoop(Config* config,
 | 
			
		||||
          Timer time;
 | 
			
		||||
 | 
			
		||||
          // Open up / load the project.
 | 
			
		||||
          project->Load(config->extraClangArguments, project_path,
 | 
			
		||||
          project->Load(config->extraClangArguments, config->compileCommandsDirectory,
 | 
			
		||||
                        config->resourceDirectory);
 | 
			
		||||
          time.ResetAndPrint("[perf] Loaded compilation entries (" +
 | 
			
		||||
                             std::to_string(project->entries.size()) +
 | 
			
		||||
 | 
			
		||||
@ -7,6 +7,8 @@
 | 
			
		||||
struct Config {
 | 
			
		||||
  // Root directory of the project. **Not serialized**
 | 
			
		||||
  std::string projectRoot;
 | 
			
		||||
  // Location of compile_commands.json.
 | 
			
		||||
  std::string compileCommandsDirectory;
 | 
			
		||||
  // Cache directory for indexed files.
 | 
			
		||||
  std::string cacheDirectory;
 | 
			
		||||
  // Value to use for clang -resource-dir if not present in
 | 
			
		||||
@ -70,6 +72,7 @@ struct Config {
 | 
			
		||||
  bool enableSnippetInsertion = true;
 | 
			
		||||
};
 | 
			
		||||
MAKE_REFLECT_STRUCT(Config,
 | 
			
		||||
                    compileCommandsDirectory,
 | 
			
		||||
                    cacheDirectory,
 | 
			
		||||
                    resourceDirectory,
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user