protected function writePropertyGroupConfigurationElements(DOMElement $parent, Configuration $configuration) { XmlDom::createElement($parent, 'ConfigurationType', $this->convertConfigurationType($this->project->getType())); XmlDom::createElement($parent, 'UseDebugLibraries', $configuration->getDebug() ? 'true' : 'false'); if (!$configuration->getDebug()) { XmlDom::createElement($parent, 'WholeProgramOptimization', 'true'); } XmlDom::createElement($parent, 'CharacterSet', $this->convertCharacterSet($configuration->getCharacterSet())); }
private function buildLinkExeCommand(Project $project, Configuration $configuration, $isDLL) { $outputPath = sprintf('%s\\%s.%s', getcwd(), $this->variableParser->parse($configuration->getOutputPath()), $configuration->getParsedExtension()); $outputDir = dirname($configuration->getOutputPath()); FileSystem::createDirectory($outputDir); $cmd = ['link', '/nologo', '"/OUT:' . $outputPath . '"']; if ($configuration->getDebug()) { $cmd[] = '/INCREMENTAL'; } else { $cmd[] = '/INCREMENTAL:NO'; } $cmd[] = 'kernel32.lib'; $cmd[] = 'user32.lib'; $cmd[] = 'gdi32.lib'; $cmd[] = 'winspool.lib'; $cmd[] = 'comdlg32.lib'; $cmd[] = 'advapi32.lib'; $cmd[] = 'shell32.lib'; $cmd[] = 'ole32.lib'; $cmd[] = 'oleaut32.lib'; $cmd[] = 'uuid.lib'; $cmd[] = 'odbc32.lib'; $cmd[] = 'odbccp32.lib'; $intDir = getcwd() . '\\' . $this->variableParser->parse($configuration->getIntermediateDirectory()); FileSystem::createDirectory($intDir); $vendorDir = $this->configLoader->getConfig()->getVendorDirectory(); foreach ($configuration->getDependencies() as $dependency) { $dependencyDir = $vendorDir . '/' . $dependency->getName(); $dependencyConf = $this->configLoader->getConfig($dependency->getName()); if (!$dependencyConf) { continue; } foreach ($dependencyConf->getProjects() as $project) { if ($project->getType() === ProjectType::APPLICATION) { continue; } $this->getVariableParser()->push('ide.project', $project); $cfgName = $dependency->getConfig() ? $dependency->getConfig() : $configuration->getName(); foreach ($project->getConfigurations() as $projConf) { if ($projConf->getName() !== $cfgName) { continue; } $this->setDefaultConfigurationValues($projConf); $depOutputPath = sprintf('%s/%s.%s', $dependencyDir, $this->getVariableParser()->parse($projConf->getOutputPath()), $projConf->getParsedExtension()); $cmd[] = realpath($depOutputPath); } $this->getVariableParser()->pop('ide.project'); } } $cmd = array_merge($cmd, $this->buildLinkManifest($configuration)); $cmd[] = '/DEBUG'; $cmd[] = '"/PDB:' . $intDir . '/' . $project->getName() . '.pdb"'; $cmd[] = $this->buildLinkSubsystem($project); if (!$configuration->getDebug()) { $cmd[] = '/OPT:REF'; $cmd[] = '/OPT:ICF'; $cmd[] = '/LTCG'; } if ($isDLL) { $cmd[] = '/DLL'; } $cmd[] = '/TLBID:1'; $cmd[] = '/DYNAMICBASE'; $cmd[] = '/NXCOMPAT'; $cmd[] = '"/IMPLIB:' . $intDir . '/' . $project->getName() . '.lib"'; $cmd[] = $this->buildLinkPlatform($configuration); return $cmd; }