author | duke |
Wed, 05 Jul 2017 20:05:23 +0200 | |
changeset 27222 | 422e90d83a4e |
parent 27157 | 364276bc8d8b |
child 27467 | cdc1d5bc86cf |
permissions | -rw-r--r-- |
19270
607d97508c60
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
17382
diff
changeset
|
1 |
/* |
27157 | 2 |
* Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. |
19270
607d97508c60
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
17382
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
607d97508c60
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
17382
diff
changeset
|
4 |
* |
607d97508c60
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
17382
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
607d97508c60
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
17382
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
607d97508c60
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
17382
diff
changeset
|
7 |
* published by the Free Software Foundation. |
607d97508c60
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
17382
diff
changeset
|
8 |
* |
607d97508c60
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
17382
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
607d97508c60
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
17382
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
607d97508c60
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
17382
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
607d97508c60
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
17382
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
607d97508c60
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
17382
diff
changeset
|
13 |
* accompanied this code). |
607d97508c60
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
17382
diff
changeset
|
14 |
* |
607d97508c60
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
17382
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
607d97508c60
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
17382
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
607d97508c60
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
17382
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
607d97508c60
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
17382
diff
changeset
|
18 |
* |
607d97508c60
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
17382
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
607d97508c60
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
17382
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
607d97508c60
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
17382
diff
changeset
|
21 |
* questions. |
607d97508c60
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
17382
diff
changeset
|
22 |
* |
607d97508c60
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
17382
diff
changeset
|
23 |
*/ |
607d97508c60
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
17382
diff
changeset
|
24 |
|
8860 | 25 |
import java.io.File; |
26 |
import java.io.FileNotFoundException; |
|
27 |
import java.io.IOException; |
|
28 |
import java.io.PrintWriter; |
|
29 |
import java.io.UnsupportedEncodingException; |
|
13892 | 30 |
import java.nio.file.FileSystems; |
8860 | 31 |
import java.util.Iterator; |
13892 | 32 |
import java.util.LinkedList; |
8860 | 33 |
import java.util.UUID; |
34 |
import java.util.Vector; |
|
35 |
||
26681
d35d35fbbe43
8055719: Clean out support for old VC versions from ProjectCreator
ctornqvi
parents:
26293
diff
changeset
|
36 |
public class WinGammaPlatformVC10 extends WinGammaPlatform { |
8860 | 37 |
|
13892 | 38 |
|
39 |
LinkedList <String>filters = new LinkedList<String>(); |
|
40 |
LinkedList <String[]>filterDeps = new LinkedList<String[]>(); |
|
41 |
||
8860 | 42 |
@Override |
43 |
protected String getProjectExt() { |
|
44 |
return ".vcxproj"; |
|
45 |
} |
|
46 |
||
47 |
@Override |
|
48 |
public void writeProjectFile(String projectFileName, String projectName, |
|
49 |
Vector<BuildConfig> allConfigs) throws IOException { |
|
50 |
System.out.println(); |
|
19270
607d97508c60
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
17382
diff
changeset
|
51 |
System.out.println(" Writing .vcxproj file: " + projectFileName); |
8860 | 52 |
|
53 |
String projDir = Util.normalize(new File(projectFileName).getParent()); |
|
54 |
||
55 |
printWriter = new PrintWriter(projectFileName, "UTF-8"); |
|
56 |
printWriter.println("<?xml version=\"1.0\" encoding=\"utf-8\"?>"); |
|
57 |
startTag("Project", |
|
58 |
"DefaultTargets", "Build", |
|
59 |
"ToolsVersion", "4.0", |
|
60 |
"xmlns", "http://schemas.microsoft.com/developer/msbuild/2003"); |
|
61 |
startTag("ItemGroup", |
|
62 |
"Label", "ProjectConfigurations"); |
|
63 |
for (BuildConfig cfg : allConfigs) { |
|
64 |
startTag("ProjectConfiguration", |
|
65 |
"Include", cfg.get("Name")); |
|
66 |
tagData("Configuration", cfg.get("Id")); |
|
67 |
tagData("Platform", cfg.get("PlatformName")); |
|
13892 | 68 |
endTag(); |
8860 | 69 |
} |
13892 | 70 |
endTag(); |
8860 | 71 |
|
72 |
startTag("PropertyGroup", "Label", "Globals"); |
|
73 |
tagData("ProjectGuid", "{8822CB5C-1C41-41C2-8493-9F6E1994338B}"); |
|
74 |
tag("SccProjectName"); |
|
75 |
tag("SccLocalPath"); |
|
13892 | 76 |
endTag(); |
8860 | 77 |
|
78 |
tag("Import", "Project", "$(VCTargetsPath)\\Microsoft.Cpp.Default.props"); |
|
79 |
||
80 |
for (BuildConfig cfg : allConfigs) { |
|
81 |
startTag(cfg, "PropertyGroup", "Label", "Configuration"); |
|
82 |
tagData("ConfigurationType", "DynamicLibrary"); |
|
83 |
tagData("UseOfMfc", "false"); |
|
13892 | 84 |
endTag(); |
8860 | 85 |
} |
86 |
||
87 |
tag("Import", "Project", "$(VCTargetsPath)\\Microsoft.Cpp.props"); |
|
88 |
startTag("ImportGroup", "Label", "ExtensionSettings"); |
|
13892 | 89 |
endTag(); |
8860 | 90 |
for (BuildConfig cfg : allConfigs) { |
91 |
startTag(cfg, "ImportGroup", "Label", "PropertySheets"); |
|
92 |
tag("Import", |
|
93 |
"Project", "$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props", |
|
94 |
"Condition", "exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')", |
|
95 |
"Label", "LocalAppDataPlatform"); |
|
13892 | 96 |
endTag(); |
8860 | 97 |
} |
98 |
||
99 |
tag("PropertyGroup", "Label", "UserMacros"); |
|
100 |
||
101 |
startTag("PropertyGroup"); |
|
102 |
tagData("_ProjectFileVersion", "10.0.30319.1"); |
|
103 |
for (BuildConfig cfg : allConfigs) { |
|
104 |
tagData(cfg, "OutDir", cfg.get("OutputDir") + Util.sep); |
|
105 |
tagData(cfg, "IntDir", cfg.get("OutputDir") + Util.sep); |
|
106 |
tagData(cfg, "LinkIncremental", "false"); |
|
107 |
} |
|
108 |
for (BuildConfig cfg : allConfigs) { |
|
109 |
tagData(cfg, "CodeAnalysisRuleSet", "AllRules.ruleset"); |
|
110 |
tag(cfg, "CodeAnalysisRules"); |
|
111 |
tag(cfg, "CodeAnalysisRuleAssemblies"); |
|
112 |
} |
|
13892 | 113 |
endTag(); |
8860 | 114 |
|
115 |
for (BuildConfig cfg : allConfigs) { |
|
116 |
startTag(cfg, "ItemDefinitionGroup"); |
|
117 |
startTag("ClCompile"); |
|
118 |
tagV(cfg.getV("CompilerFlags")); |
|
13892 | 119 |
endTag(); |
8860 | 120 |
|
121 |
startTag("Link"); |
|
122 |
tagV(cfg.getV("LinkerFlags")); |
|
13892 | 123 |
endTag(); |
8860 | 124 |
|
125 |
startTag("PreLinkEvent"); |
|
126 |
tagData("Message", BuildConfig.getFieldString(null, "PrelinkDescription")); |
|
127 |
tagData("Command", cfg.expandFormat(BuildConfig.getFieldString(null, "PrelinkCommand").replace("\t", "\r\n"))); |
|
13892 | 128 |
endTag(); |
8860 | 129 |
|
13892 | 130 |
endTag(); |
8860 | 131 |
} |
132 |
||
133 |
writeFiles(allConfigs, projDir); |
|
134 |
||
135 |
tag("Import", "Project", "$(VCTargetsPath)\\Microsoft.Cpp.targets"); |
|
136 |
startTag("ImportGroup", "Label", "ExtensionTargets"); |
|
13892 | 137 |
endTag(); |
8860 | 138 |
|
13892 | 139 |
endTag(); |
8860 | 140 |
printWriter.close(); |
19270
607d97508c60
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
17382
diff
changeset
|
141 |
System.out.println(" Done writing .vcxproj file."); |
8860 | 142 |
|
143 |
writeFilterFile(projectFileName, projectName, allConfigs, projDir); |
|
144 |
writeUserFile(projectFileName, allConfigs); |
|
145 |
} |
|
146 |
||
147 |
||
148 |
private void writeUserFile(String projectFileName, Vector<BuildConfig> allConfigs) throws FileNotFoundException, UnsupportedEncodingException { |
|
149 |
String userFileName = projectFileName + ".user"; |
|
150 |
if (new File(userFileName).exists()) { |
|
151 |
return; |
|
152 |
} |
|
153 |
System.out.print(" Writing .vcxproj.user file: " + userFileName); |
|
154 |
printWriter = new PrintWriter(userFileName, "UTF-8"); |
|
155 |
||
156 |
printWriter.println("<?xml version=\"1.0\" encoding=\"utf-8\"?>"); |
|
157 |
startTag("Project", |
|
158 |
"ToolsVersion", "4.0", |
|
159 |
"xmlns", "http://schemas.microsoft.com/developer/msbuild/2003"); |
|
160 |
||
161 |
for (BuildConfig cfg : allConfigs) { |
|
162 |
startTag(cfg, "PropertyGroup"); |
|
17382 | 163 |
tagData("LocalDebuggerCommand", cfg.get("JdkTargetRoot") + "\\bin\\java.exe"); |
22734
41757c1f3946
8027113: decouple the '-XXaltjvm=<path>' option from the gamma launcher
rdurbin
parents:
19270
diff
changeset
|
164 |
// The JVM loads some libraries using a path relative to |
41757c1f3946
8027113: decouple the '-XXaltjvm=<path>' option from the gamma launcher
rdurbin
parents:
19270
diff
changeset
|
165 |
// itself because it expects to be in a JRE or a JDK. The java |
41757c1f3946
8027113: decouple the '-XXaltjvm=<path>' option from the gamma launcher
rdurbin
parents:
19270
diff
changeset
|
166 |
// launcher's '-XXaltjvm=' option allows the JVM to be outside |
41757c1f3946
8027113: decouple the '-XXaltjvm=<path>' option from the gamma launcher
rdurbin
parents:
19270
diff
changeset
|
167 |
// the JRE or JDK so '-Dsun.java.launcher.is_altjvm=true' |
41757c1f3946
8027113: decouple the '-XXaltjvm=<path>' option from the gamma launcher
rdurbin
parents:
19270
diff
changeset
|
168 |
// forces a fake JAVA_HOME relative path to be used to |
41757c1f3946
8027113: decouple the '-XXaltjvm=<path>' option from the gamma launcher
rdurbin
parents:
19270
diff
changeset
|
169 |
// find the other libraries. The '-XX:+PauseAtExit' option |
41757c1f3946
8027113: decouple the '-XXaltjvm=<path>' option from the gamma launcher
rdurbin
parents:
19270
diff
changeset
|
170 |
// causes the VM to wait for key press before exiting; this |
41757c1f3946
8027113: decouple the '-XXaltjvm=<path>' option from the gamma launcher
rdurbin
parents:
19270
diff
changeset
|
171 |
// allows any stdout or stderr messages to be seen before |
41757c1f3946
8027113: decouple the '-XXaltjvm=<path>' option from the gamma launcher
rdurbin
parents:
19270
diff
changeset
|
172 |
// the cmdtool exits. |
41757c1f3946
8027113: decouple the '-XXaltjvm=<path>' option from the gamma launcher
rdurbin
parents:
19270
diff
changeset
|
173 |
tagData("LocalDebuggerCommandArguments", "-XXaltjvm=$(TargetDir) " |
41757c1f3946
8027113: decouple the '-XXaltjvm=<path>' option from the gamma launcher
rdurbin
parents:
19270
diff
changeset
|
174 |
+ "-Dsun.java.launcher.is_altjvm=true " |
41757c1f3946
8027113: decouple the '-XXaltjvm=<path>' option from the gamma launcher
rdurbin
parents:
19270
diff
changeset
|
175 |
+ "-XX:+UnlockDiagnosticVMOptions -XX:+PauseAtExit"); |
17382 | 176 |
tagData("LocalDebuggerEnvironment", "JAVA_HOME=" + cfg.get("JdkTargetRoot")); |
13892 | 177 |
endTag(); |
8860 | 178 |
} |
179 |
||
13892 | 180 |
endTag(); |
8860 | 181 |
printWriter.close(); |
182 |
System.out.println(" Done."); |
|
183 |
} |
|
184 |
||
13892 | 185 |
public void addFilter(String rPath) { |
186 |
filters.add(rPath); |
|
187 |
} |
|
188 |
||
189 |
public void addFilterDependency(String fileLoc, String filter) { |
|
190 |
filterDeps.add(new String[] {fileLoc, filter}); |
|
191 |
} |
|
192 |
||
8860 | 193 |
private void writeFilterFile(String projectFileName, String projectName, |
194 |
Vector<BuildConfig> allConfigs, String base) throws FileNotFoundException, UnsupportedEncodingException { |
|
195 |
String filterFileName = projectFileName + ".filters"; |
|
196 |
System.out.print(" Writing .vcxproj.filters file: " + filterFileName); |
|
197 |
printWriter = new PrintWriter(filterFileName, "UTF-8"); |
|
198 |
||
199 |
printWriter.println("<?xml version=\"1.0\" encoding=\"utf-8\"?>"); |
|
200 |
startTag("Project", |
|
201 |
"ToolsVersion", "4.0", |
|
202 |
"xmlns", "http://schemas.microsoft.com/developer/msbuild/2003"); |
|
203 |
||
204 |
startTag("ItemGroup"); |
|
13892 | 205 |
for (String filter : filters) { |
206 |
startTag("Filter", "Include",filter); |
|
207 |
UUID uuid = UUID.randomUUID(); |
|
208 |
tagData("UniqueIdentifier", "{" + uuid.toString() + "}"); |
|
209 |
endTag(); |
|
8860 | 210 |
} |
211 |
startTag("Filter", "Include", "Resource Files"); |
|
212 |
UUID uuid = UUID.randomUUID(); |
|
213 |
tagData("UniqueIdentifier", "{" + uuid.toString() + "}"); |
|
214 |
tagData("Extensions", "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"); |
|
13892 | 215 |
endTag(); |
216 |
endTag(); |
|
8860 | 217 |
|
13892 | 218 |
//TODO - do I need to split cpp and hpp files? |
8860 | 219 |
|
13892 | 220 |
// then all files |
8860 | 221 |
startTag("ItemGroup"); |
13892 | 222 |
for (String[] dep : filterDeps) { |
223 |
String tagName = getFileTagFromSuffix(dep[0]); |
|
8860 | 224 |
|
13892 | 225 |
startTag(tagName, "Include", dep[0]); |
226 |
tagData("Filter", dep[1]); |
|
227 |
endTag(); |
|
8860 | 228 |
} |
13892 | 229 |
endTag(); |
8860 | 230 |
|
13892 | 231 |
endTag(); |
8860 | 232 |
printWriter.close(); |
233 |
System.out.println(" Done."); |
|
234 |
} |
|
235 |
||
13892 | 236 |
public String getFileTagFromSuffix(String fileName) { |
237 |
if (fileName.endsWith(".cpp")) { |
|
238 |
return"ClCompile"; |
|
239 |
} else if (fileName.endsWith(".c")) { |
|
240 |
return "ClCompile"; |
|
241 |
} else if (fileName.endsWith(".hpp")) { |
|
242 |
return"ClInclude"; |
|
243 |
} else if (fileName.endsWith(".h")) { |
|
244 |
return "ClInclude"; |
|
245 |
} else { |
|
246 |
return"None"; |
|
247 |
} |
|
8860 | 248 |
} |
249 |
||
250 |
void writeFiles(Vector<BuildConfig> allConfigs, String projDir) { |
|
13892 | 251 |
// This code assummes there are no config specific includes. |
252 |
startTag("ItemGroup"); |
|
8860 | 253 |
|
13892 | 254 |
String sourceBase = BuildConfig.getFieldString(null, "SourceBase"); |
255 |
||
256 |
// Use first config for all global absolute includes. |
|
257 |
BuildConfig baseConfig = allConfigs.firstElement(); |
|
258 |
Vector<String> rv = new Vector<String>(); |
|
8860 | 259 |
|
13892 | 260 |
// Then use first config for all relative includes |
261 |
Vector<String> ri = new Vector<String>(); |
|
262 |
baseConfig.collectRelevantVectors(ri, "RelativeSrcInclude"); |
|
263 |
for (String f : ri) { |
|
264 |
rv.add(sourceBase + Util.sep + f); |
|
265 |
} |
|
8860 | 266 |
|
13892 | 267 |
baseConfig.collectRelevantVectors(rv, "AbsoluteSrcInclude"); |
268 |
||
269 |
handleIncludes(rv, allConfigs); |
|
270 |
||
271 |
endTag(); |
|
8860 | 272 |
} |
273 |
||
13892 | 274 |
// Will visit file tree for each include |
275 |
private void handleIncludes(Vector<String> includes, Vector<BuildConfig> allConfigs) { |
|
276 |
for (String path : includes) { |
|
277 |
FileTreeCreatorVC10 ftc = new FileTreeCreatorVC10(FileSystems.getDefault().getPath(path) , allConfigs, this); |
|
278 |
try { |
|
279 |
ftc.writeFileTree(); |
|
280 |
} catch (IOException e) { |
|
281 |
e.printStackTrace(); |
|
282 |
} |
|
283 |
} |
|
8860 | 284 |
} |
285 |
||
286 |
String buildCond(BuildConfig cfg) { |
|
287 |
return "'$(Configuration)|$(Platform)'=='"+cfg.get("Name")+"'"; |
|
288 |
} |
|
289 |
||
290 |
void tagV(Vector<String> v) { |
|
291 |
Iterator<String> i = v.iterator(); |
|
292 |
while(i.hasNext()) { |
|
293 |
String name = i.next(); |
|
294 |
String data = i.next(); |
|
295 |
tagData(name, data); |
|
296 |
} |
|
297 |
} |
|
298 |
||
299 |
void tagData(BuildConfig cfg, String name, String data) { |
|
300 |
tagData(name, data, "Condition", buildCond(cfg)); |
|
301 |
} |
|
302 |
||
303 |
void tag(BuildConfig cfg, String name, String... attrs) { |
|
304 |
String[] ss = new String[attrs.length + 2]; |
|
305 |
ss[0] = "Condition"; |
|
306 |
ss[1] = buildCond(cfg); |
|
307 |
System.arraycopy(attrs, 0, ss, 2, attrs.length); |
|
308 |
||
309 |
tag(name, ss); |
|
310 |
} |
|
311 |
||
312 |
void startTag(BuildConfig cfg, String name, String... attrs) { |
|
313 |
String[] ss = new String[attrs.length + 2]; |
|
314 |
ss[0] = "Condition"; |
|
315 |
ss[1] = buildCond(cfg); |
|
316 |
System.arraycopy(attrs, 0, ss, 2, attrs.length); |
|
317 |
||
318 |
startTag(name, ss); |
|
319 |
} |
|
13892 | 320 |
|
8860 | 321 |
} |
322 |
||
323 |
class CompilerInterfaceVC10 extends CompilerInterface { |
|
324 |
||
325 |
@Override |
|
326 |
Vector getBaseCompilerFlags(Vector defines, Vector includes, String outDir) { |
|
327 |
Vector rv = new Vector(); |
|
328 |
||
329 |
addAttr(rv, "AdditionalIncludeDirectories", Util.join(";", includes)); |
|
330 |
addAttr(rv, "PreprocessorDefinitions", |
|
331 |
Util.join(";", defines).replace("\\\"", "\"")); |
|
332 |
addAttr(rv, "PrecompiledHeaderFile", "precompiled.hpp"); |
|
333 |
addAttr(rv, "PrecompiledHeaderOutputFile", outDir+Util.sep+"vm.pch"); |
|
334 |
addAttr(rv, "AssemblerListingLocation", outDir); |
|
335 |
addAttr(rv, "ObjectFileName", outDir+Util.sep); |
|
336 |
addAttr(rv, "ProgramDataBaseFileName", outDir+Util.sep+"jvm.pdb"); |
|
337 |
// Set /nologo option |
|
338 |
addAttr(rv, "SuppressStartupBanner", "true"); |
|
339 |
// Surpass the default /Tc or /Tp. |
|
340 |
addAttr(rv, "CompileAs", "Default"); |
|
341 |
// Set /W3 option. |
|
342 |
addAttr(rv, "WarningLevel", "Level3"); |
|
343 |
// Set /WX option, |
|
344 |
addAttr(rv, "TreatWarningAsError", "true"); |
|
345 |
// Set /GS option |
|
346 |
addAttr(rv, "BufferSecurityCheck", "false"); |
|
347 |
// Set /Zi option. |
|
348 |
addAttr(rv, "DebugInformationFormat", "ProgramDatabase"); |
|
349 |
// Set /Yu option. |
|
350 |
addAttr(rv, "PrecompiledHeader", "Use"); |
|
351 |
// Set /EHsc- option |
|
352 |
addAttr(rv, "ExceptionHandling", ""); |
|
353 |
||
354 |
addAttr(rv, "MultiProcessorCompilation", "true"); |
|
355 |
||
356 |
return rv; |
|
357 |
} |
|
358 |
||
359 |
@Override |
|
26293
5c7a054e59fe
8027480: Build Windows x64 fastdebug builds using /homeparams
ctornqvi
parents:
22734
diff
changeset
|
360 |
Vector getDebugCompilerFlags(String opt, String platformName) { |
8860 | 361 |
Vector rv = new Vector(); |
362 |
||
363 |
// Set /On option |
|
364 |
addAttr(rv, "Optimization", opt); |
|
365 |
// Set /FR option. |
|
366 |
addAttr(rv, "BrowseInformation", "true"); |
|
367 |
addAttr(rv, "BrowseInformationFile", "$(IntDir)"); |
|
368 |
// Set /MD option. |
|
369 |
addAttr(rv, "RuntimeLibrary", "MultiThreadedDLL"); |
|
370 |
// Set /Oy- option |
|
371 |
addAttr(rv, "OmitFramePointers", "false"); |
|
26293
5c7a054e59fe
8027480: Build Windows x64 fastdebug builds using /homeparams
ctornqvi
parents:
22734
diff
changeset
|
372 |
// Set /homeparams for x64 debug builds |
5c7a054e59fe
8027480: Build Windows x64 fastdebug builds using /homeparams
ctornqvi
parents:
22734
diff
changeset
|
373 |
if(platformName.equals("x64")) { |
5c7a054e59fe
8027480: Build Windows x64 fastdebug builds using /homeparams
ctornqvi
parents:
22734
diff
changeset
|
374 |
addAttr(rv, "AdditionalOptions", "/homeparams"); |
5c7a054e59fe
8027480: Build Windows x64 fastdebug builds using /homeparams
ctornqvi
parents:
22734
diff
changeset
|
375 |
} |
8860 | 376 |
|
377 |
return rv; |
|
378 |
} |
|
379 |
||
380 |
@Override |
|
381 |
Vector getProductCompilerFlags() { |
|
382 |
Vector rv = new Vector(); |
|
383 |
||
384 |
// Set /O2 option. |
|
385 |
addAttr(rv, "Optimization", "MaxSpeed"); |
|
386 |
// Set /Oy- option |
|
387 |
addAttr(rv, "OmitFramePointers", "false"); |
|
388 |
// Set /Ob option. 1 is expandOnlyInline |
|
389 |
addAttr(rv, "InlineFunctionExpansion", "OnlyExplicitInline"); |
|
390 |
// Set /GF option. |
|
391 |
addAttr(rv, "StringPooling", "true"); |
|
392 |
// Set /MD option. 2 is rtMultiThreadedDLL |
|
393 |
addAttr(rv, "RuntimeLibrary", "MultiThreadedDLL"); |
|
394 |
// Set /Gy option |
|
395 |
addAttr(rv, "FunctionLevelLinking", "true"); |
|
396 |
||
397 |
return rv; |
|
398 |
} |
|
399 |
||
400 |
@Override |
|
401 |
Vector getBaseLinkerFlags(String outDir, String outDll, String platformName) { |
|
402 |
Vector rv = new Vector(); |
|
403 |
||
404 |
addAttr(rv, "AdditionalOptions", |
|
405 |
"/export:JNI_GetDefaultJavaVMInitArgs " + |
|
406 |
"/export:JNI_CreateJavaVM " + |
|
407 |
"/export:JVM_FindClassFromBootLoader "+ |
|
408 |
"/export:JNI_GetCreatedJavaVMs "+ |
|
409 |
"/export:jio_snprintf /export:jio_printf "+ |
|
410 |
"/export:jio_fprintf /export:jio_vfprintf "+ |
|
411 |
"/export:jio_vsnprintf "+ |
|
412 |
"/export:JVM_GetVersionInfo "+ |
|
413 |
"/export:JVM_InitAgentProperties"); |
|
10284
17533dd1b807
7082220: Visual Studio projects broken after change 7016797: Hotspot: securely/restrictive load dlls and new
brutisso
parents:
9131
diff
changeset
|
414 |
addAttr(rv, "AdditionalDependencies", "kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;Wsock32.lib;winmm.lib;psapi.lib"); |
8860 | 415 |
addAttr(rv, "OutputFile", outDll); |
416 |
addAttr(rv, "SuppressStartupBanner", "true"); |
|
417 |
addAttr(rv, "ModuleDefinitionFile", outDir+Util.sep+"vm.def"); |
|
418 |
addAttr(rv, "ProgramDatabaseFile", outDir+Util.sep+"jvm.pdb"); |
|
419 |
addAttr(rv, "SubSystem", "Windows"); |
|
420 |
addAttr(rv, "BaseAddress", "0x8000000"); |
|
421 |
addAttr(rv, "ImportLibrary", outDir+Util.sep+"jvm.lib"); |
|
422 |
||
423 |
if(platformName.equals("Win32")) { |
|
424 |
addAttr(rv, "TargetMachine", "MachineX86"); |
|
425 |
} else { |
|
426 |
addAttr(rv, "TargetMachine", "MachineX64"); |
|
427 |
} |
|
428 |
||
9131
b41df1504406
7034625: Product builds in Visual Studio projects should produce full symbol information
brutisso
parents:
8860
diff
changeset
|
429 |
// We always want the /DEBUG option to get full symbol information in the pdb files |
b41df1504406
7034625: Product builds in Visual Studio projects should produce full symbol information
brutisso
parents:
8860
diff
changeset
|
430 |
addAttr(rv, "GenerateDebugInformation", "true"); |
b41df1504406
7034625: Product builds in Visual Studio projects should produce full symbol information
brutisso
parents:
8860
diff
changeset
|
431 |
|
8860 | 432 |
return rv; |
433 |
} |
|
434 |
||
435 |
@Override |
|
436 |
Vector getDebugLinkerFlags() { |
|
437 |
Vector rv = new Vector(); |
|
438 |
||
9131
b41df1504406
7034625: Product builds in Visual Studio projects should produce full symbol information
brutisso
parents:
8860
diff
changeset
|
439 |
// Empty now that /DEBUG option is used by all configs |
8860 | 440 |
|
441 |
return rv; |
|
442 |
} |
|
443 |
||
444 |
@Override |
|
445 |
Vector getProductLinkerFlags() { |
|
446 |
Vector rv = new Vector(); |
|
447 |
||
448 |
// Set /OPT:REF option. |
|
449 |
addAttr(rv, "OptimizeReferences", "true"); |
|
450 |
// Set /OPT:ICF option. |
|
451 |
addAttr(rv, "EnableCOMDATFolding", "true"); |
|
452 |
||
453 |
return rv; |
|
454 |
} |
|
455 |
||
456 |
@Override |
|
457 |
void getAdditionalNonKernelLinkerFlags(Vector rv) { |
|
458 |
extAttr(rv, "AdditionalOptions", " /export:AsyncGetCallTrace"); |
|
459 |
} |
|
460 |
||
461 |
@Override |
|
462 |
String getOptFlag() { |
|
463 |
return "MaxSpeed"; |
|
464 |
} |
|
465 |
||
466 |
@Override |
|
467 |
String getNoOptFlag() { |
|
468 |
return "Disabled"; |
|
469 |
} |
|
470 |
||
471 |
@Override |
|
472 |
String makeCfgName(String flavourBuild, String platform) { |
|
473 |
return flavourBuild + "|" + platform; |
|
474 |
} |
|
475 |
||
476 |
} |