Пример #1
0
 private function buildWarningsArguments(Configuration $configuration)
 {
     $result = [];
     if ($configuration->getWarningsAsErrors()) {
         $result[] = '/WX-';
     }
     $configuration->setWarningLevel($configuration->getWarningLevel() || 'level3');
     switch ($configuration->getWarningLevel()) {
         case 'all':
             $result[] = '/Wall';
             break;
         case 'none':
             $result[] = '/W0';
             break;
         case 'level1':
             $result[] = '/W1';
             break;
         case 'level2':
             $result[] = '/W2';
             break;
         case 'level3':
             $result[] = '/W3';
             break;
         case 'level4':
             $result[] = '/W4';
             break;
     }
     return implode(' ', $result);
 }
Пример #2
0
 protected function parseProjectConfigurations(Project $project, $configs)
 {
     $configList = [];
     foreach ($configs as $data) {
         $config = new Configuration($project);
         if (array_key_exists('debug', $data)) {
             $config->setDebug($data['debug']);
         }
         if (array_key_exists('definitions', $data)) {
             $config->setDefinitions($data['definitions']);
         }
         if (array_key_exists('dependencies', $data)) {
             $dependencies = $this->parseConfigurationDependencies($data['dependencies']);
             $config->setDependencies($dependencies);
         }
         if (array_key_exists('intermediate-dir', $data)) {
             $config->setIntermediateDirectory($data['intermediate-dir']);
         }
         if (array_key_exists('name', $data)) {
             $config->setName($data['name']);
         }
         if (array_key_exists('output', $data)) {
             $config->setOutputPath($data['output']);
         }
         if (array_key_exists('paths', $data)) {
             $paths = $this->parsePaths($data['paths']);
             $config->setPaths($paths);
         }
         if (array_key_exists('pch', $data)) {
             $pch = $this->parsePrecompiledHeader($data['pch']);
             $config->setPrecompiledHeader($pch);
         }
         if (array_key_exists('platform', $data)) {
             $config->setPlatform($data['platform']);
         }
         if (array_key_exists('warning-level', $data)) {
             $config->setWarningLevel($data['warning-level']);
         }
         $configList[] = $config;
     }
     return $configList;
 }