OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 namespace NativeClientVSAddIn | 5 namespace NativeClientVSAddIn |
6 { | 6 { |
7 using System; | 7 using System; |
8 | 8 |
9 using EnvDTE; | 9 using EnvDTE; |
10 using EnvDTE80; | 10 using EnvDTE80; |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
178 if (string.IsNullOrEmpty(properties.NaClAddInVersion)) | 178 if (string.IsNullOrEmpty(properties.NaClAddInVersion)) |
179 { | 179 { |
180 // Set the NaCl add-in version so that it is stored in the project fil e. | 180 // Set the NaCl add-in version so that it is stored in the project fil e. |
181 properties.SetProperty("ConfigurationGeneral", "NaClAddInVersion", nac lAddInVersion); | 181 properties.SetProperty("ConfigurationGeneral", "NaClAddInVersion", nac lAddInVersion); |
182 | 182 |
183 // Expand the CHROME_PATH variable to its full path. | 183 // Expand the CHROME_PATH variable to its full path. |
184 string expandedChrome = properties.GetProperty( | 184 string expandedChrome = properties.GetProperty( |
185 "WindowsLocalDebugger", "LocalDebuggerCommand"); | 185 "WindowsLocalDebugger", "LocalDebuggerCommand"); |
186 properties.SetProperty("WindowsLocalDebugger", "LocalDebuggerCommand", expandedChrome); | 186 properties.SetProperty("WindowsLocalDebugger", "LocalDebuggerCommand", expandedChrome); |
187 | 187 |
188 // Change the library includes to have the appropriate extension. | |
189 string libs = properties.GetProperty("Link", "AdditionalDependencies") ; | |
190 if (properties.ProjectPlatform == PropertyManager.ProjectPlatformType. NaCl) | |
191 { | |
192 libs = libs.Replace(".lib", string.Empty); | |
193 } | |
194 else if (properties.ProjectPlatform == PropertyManager.ProjectPlatform Type.Pepper) | |
195 { | |
196 string[] libsList = libs.Split(';'); | |
noelallen1
2012/08/09 18:19:45
Doesn't '\n' also work as a delimiter when you ent
tysand
2012/08/09 18:23:38
Double checked, and Visual Studio will automatical
| |
197 libs = string.Empty; | |
198 foreach (string lib in libsList) | |
199 { | |
200 string baseLibName = lib.Replace(".lib", string.Empty); | |
201 if (!string.IsNullOrWhiteSpace(lib)) | |
202 { | |
203 libs = string.Concat(libs, baseLibName, ".lib;"); | |
noelallen1
2012/08/09 18:19:45
Trailing ;?
tysand
2012/08/09 18:23:38
Verified this is a non-issue.
On 2012/08/09 18:19:
| |
204 } | |
205 } | |
206 } | |
207 | |
208 properties.SetProperty("Link", "AdditionalDependencies", libs); | |
209 | |
188 // Work around for issue 140162. Forces some properties to save to the project file. | 210 // Work around for issue 140162. Forces some properties to save to the project file. |
189 PerformPropertyFixes(config); | 211 PerformPropertyFixes(config); |
190 } | 212 } |
191 } | 213 } |
192 } | 214 } |
193 | 215 |
194 /// <summary> | 216 /// <summary> |
195 /// Takes a project configuration and sets values in the project file to wor k around some | 217 /// Takes a project configuration and sets values in the project file to wor k around some |
196 /// problems in Visual Studio. This is a work around for issue 140162. | 218 /// problems in Visual Studio. This is a work around for issue 140162. |
197 /// </summary> | 219 /// </summary> |
198 /// <param name="config">A configuration that needs modification.</param> | 220 /// <param name="config">A configuration that needs modification.</param> |
199 private void PerformPropertyFixes(VCConfiguration config) | 221 private void PerformPropertyFixes(VCConfiguration config) |
200 { | 222 { |
201 IVCRulePropertyStorage debugger = config.Rules.Item("WindowsLocalDebugger" ); | 223 IVCRulePropertyStorage debugger = config.Rules.Item("WindowsLocalDebugger" ); |
202 string arguments = debugger.GetUnevaluatedPropertyValue("LocalDebuggerComm andArguments"); | 224 string arguments = debugger.GetUnevaluatedPropertyValue("LocalDebuggerComm andArguments"); |
203 debugger.SetPropertyValue("LocalDebuggerCommandArguments", arguments); | 225 debugger.SetPropertyValue("LocalDebuggerCommandArguments", arguments); |
226 | |
227 IVCRulePropertyStorage directories = config.Rules.Item("ConfigurationDirec tories"); | |
228 string includePath = directories.GetUnevaluatedPropertyValue("IncludePath" ); | |
229 string libraryPath = directories.GetUnevaluatedPropertyValue("LibraryPath" ); | |
230 directories.SetPropertyValue("IncludePath", includePath); | |
231 directories.SetPropertyValue("LibraryPath", libraryPath); | |
232 | |
233 // Pepper specific: | |
234 if (config.Platform.Name == Strings.PepperPlatformName) | |
235 { | |
236 string executablePath = directories.GetUnevaluatedPropertyValue("Executa blePath"); | |
237 directories.SetPropertyValue("ExecutablePath", executablePath); | |
238 } | |
239 | |
240 // NaCl Platform Specific: | |
241 if (config.Platform.Name == Strings.NaClPlatformName) | |
242 { | |
243 IVCRulePropertyStorage general = config.Rules.Item("ConfigurationGeneral "); | |
244 string outdir = general.GetUnevaluatedPropertyValue("OutDir"); | |
245 string intdir = general.GetUnevaluatedPropertyValue("IntDir"); | |
246 string irtPath = general.GetUnevaluatedPropertyValue("NaClIrtPath"); | |
247 general.SetPropertyValue("NaClIrtPath", irtPath); | |
248 general.SetPropertyValue("OutDir", outdir); | |
249 general.SetPropertyValue("IntDir", intdir); | |
250 } | |
204 } | 251 } |
205 | 252 |
206 /// <summary> | 253 /// <summary> |
207 /// During the build process we dynamically put the add-in version number in to the add-in | 254 /// During the build process we dynamically put the add-in version number in to the add-in |
208 /// description. This function extracts that version number. | 255 /// description. This function extracts that version number. |
209 /// </summary> | 256 /// </summary> |
210 /// <returns>The add-in version number.</returns> | 257 /// <returns>The add-in version number.</returns> |
211 private string GetAddInVersionFromDescription() | 258 private string GetAddInVersionFromDescription() |
212 { | 259 { |
213 string naclAddinVersion = "missing"; | 260 string naclAddinVersion = "missing"; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
269 } | 316 } |
270 else if (properties.ProjectPlatform == PropertyManager.ProjectPlatformTy pe.Pepper) | 317 else if (properties.ProjectPlatform == PropertyManager.ProjectPlatformTy pe.Pepper) |
271 { | 318 { |
272 debugger_ = new PluginDebuggerVS(dte_, properties); | 319 debugger_ = new PluginDebuggerVS(dte_, properties); |
273 webServer_ = new WebServer(webServerOutputPane_, properties); | 320 webServer_ = new WebServer(webServerOutputPane_, properties); |
274 } | 321 } |
275 } | 322 } |
276 } | 323 } |
277 } | 324 } |
278 } | 325 } |
OLD | NEW |