Mercurial > hg > truffle
annotate src/share/tools/ProjectCreator/WinGammaPlatformVC7.java @ 2233:15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
Summary: Updated create.bat and ProjectCreator
Reviewed-by: brutisso, stefank, ohair
author | sla |
---|---|
date | Thu, 10 Feb 2011 13:03:22 +0100 |
parents | aa6e219afbf1 |
children | 2ab52cda08e5 74e790c48cd4 |
rev | line source |
---|---|
0 | 1 /* |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
2 * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. |
0 | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | |
5 * This code is free software; you can redistribute it and/or modify it | |
6 * under the terms of the GNU General Public License version 2 only, as | |
7 * published by the Free Software Foundation. | |
8 * | |
9 * This code is distributed in the hope that it will be useful, but WITHOUT | |
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
12 * version 2 for more details (a copy is included in the LICENSE file that | |
13 * accompanied this code). | |
14 * | |
15 * You should have received a copy of the GNU General Public License version | |
16 * 2 along with this work; if not, write to the Free Software Foundation, | |
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
18 * | |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
844
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
844
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
844
diff
changeset
|
21 * questions. |
0 | 22 * |
23 */ | |
24 | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
25 import java.io.FileWriter; |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
26 import java.io.IOException; |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
27 import java.io.PrintWriter; |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
28 import java.util.Hashtable; |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
29 import java.util.Iterator; |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
30 import java.util.TreeSet; |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
31 import java.util.Vector; |
0 | 32 |
33 public class WinGammaPlatformVC7 extends WinGammaPlatform { | |
34 | |
659
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
35 String projectVersion() {return "7.10";}; |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
36 |
0 | 37 public void writeProjectFile(String projectFileName, String projectName, |
38 Vector allConfigs) throws IOException { | |
39 System.out.println(); | |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
40 System.out.println(" Writing .vcproj file: "+projectFileName); |
0 | 41 // If we got this far without an error, we're safe to actually |
42 // write the .vcproj file | |
43 printWriter = new PrintWriter(new FileWriter(projectFileName)); | |
44 | |
45 printWriter.println("<?xml version=\"1.0\" encoding=\"windows-1251\"?>"); | |
46 startTag( | |
47 "VisualStudioProject", | |
48 new String[] { | |
49 "ProjectType", "Visual C++", | |
659
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
50 "Version", projectVersion(), |
0 | 51 "Name", projectName, |
52 "ProjectGUID", "{8822CB5C-1C41-41C2-8493-9F6E1994338B}", | |
53 "SccProjectName", "", | |
54 "SccLocalPath", "" | |
55 } | |
56 ); | |
57 startTag("Platforms", null); | |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
58 tag("Platform", new String[] {"Name", (String) BuildConfig.getField(null, "PlatformName")}); |
0 | 59 endTag("Platforms"); |
60 | |
61 startTag("Configurations", null); | |
62 | |
63 for (Iterator i = allConfigs.iterator(); i.hasNext(); ) { | |
64 writeConfiguration((BuildConfig)i.next()); | |
65 } | |
66 | |
67 endTag("Configurations"); | |
68 | |
69 tag("References", null); | |
70 | |
71 writeFiles(allConfigs); | |
72 | |
73 tag("Globals", null); | |
74 | |
75 endTag("VisualStudioProject"); | |
76 printWriter.close(); | |
77 | |
78 System.out.println(" Done."); | |
79 } | |
80 | |
81 | |
82 abstract class NameFilter { | |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
83 protected String fname; |
0 | 84 |
85 abstract boolean match(FileInfo fi); | |
86 | |
87 String filterString() { return ""; } | |
88 String name() { return this.fname;} | |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
89 |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
90 @Override |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
91 // eclipse auto-generated |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
92 public int hashCode() { |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
93 final int prime = 31; |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
94 int result = 1; |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
95 result = prime * result + getOuterType().hashCode(); |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
96 result = prime * result + ((fname == null) ? 0 : fname.hashCode()); |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
97 return result; |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
98 } |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
99 |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
100 @Override |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
101 // eclipse auto-generated |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
102 public boolean equals(Object obj) { |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
103 if (this == obj) |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
104 return true; |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
105 if (obj == null) |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
106 return false; |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
107 if (getClass() != obj.getClass()) |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
108 return false; |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
109 NameFilter other = (NameFilter) obj; |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
110 if (!getOuterType().equals(other.getOuterType())) |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
111 return false; |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
112 if (fname == null) { |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
113 if (other.fname != null) |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
114 return false; |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
115 } else if (!fname.equals(other.fname)) |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
116 return false; |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
117 return true; |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
118 } |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
119 |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
120 // eclipse auto-generated |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
121 private WinGammaPlatformVC7 getOuterType() { |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
122 return WinGammaPlatformVC7.this; |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
123 } |
0 | 124 } |
125 | |
126 class DirectoryFilter extends NameFilter { | |
127 String dir; | |
128 int baseLen, dirLen; | |
129 | |
130 DirectoryFilter(String dir, String sbase) { | |
131 this.dir = dir; | |
132 this.baseLen = sbase.length(); | |
133 this.dirLen = dir.length(); | |
134 this.fname = dir; | |
135 } | |
136 | |
137 DirectoryFilter(String fname, String dir, String sbase) { | |
138 this.dir = dir; | |
139 this.baseLen = sbase.length(); | |
140 this.dirLen = dir.length(); | |
141 this.fname = fname; | |
142 } | |
143 | |
144 | |
145 boolean match(FileInfo fi) { | |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
146 int lastSlashIndex = fi.full.lastIndexOf('/'); |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
147 String fullDir = fi.full.substring(0, lastSlashIndex); |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
148 return fullDir.endsWith(dir); |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
149 } |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
150 |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
151 @Override |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
152 // eclipse auto-generated |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
153 public int hashCode() { |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
154 final int prime = 31; |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
155 int result = super.hashCode(); |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
156 result = prime * result + getOuterType().hashCode(); |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
157 result = prime * result + baseLen; |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
158 result = prime * result + ((dir == null) ? 0 : dir.hashCode()); |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
159 result = prime * result + dirLen; |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
160 return result; |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
161 } |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
162 |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
163 @Override |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
164 // eclipse auto-generated |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
165 public boolean equals(Object obj) { |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
166 if (this == obj) |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
167 return true; |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
168 if (!super.equals(obj)) |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
169 return false; |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
170 if (getClass() != obj.getClass()) |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
171 return false; |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
172 DirectoryFilter other = (DirectoryFilter) obj; |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
173 if (!getOuterType().equals(other.getOuterType())) |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
174 return false; |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
175 if (baseLen != other.baseLen) |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
176 return false; |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
177 if (dir == null) { |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
178 if (other.dir != null) |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
179 return false; |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
180 } else if (!dir.equals(other.dir)) |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
181 return false; |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
182 if (dirLen != other.dirLen) |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
183 return false; |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
184 return true; |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
185 } |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
186 |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
187 // eclipse auto-generated |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
188 private WinGammaPlatformVC7 getOuterType() { |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
189 return WinGammaPlatformVC7.this; |
0 | 190 } |
191 } | |
192 | |
193 class TypeFilter extends NameFilter { | |
194 String[] exts; | |
195 | |
196 TypeFilter(String fname, String[] exts) { | |
197 this.fname = fname; | |
198 this.exts = exts; | |
199 } | |
200 | |
201 boolean match(FileInfo fi) { | |
202 for (int i=0; i<exts.length; i++) { | |
203 if (fi.full.endsWith(exts[i])) { | |
204 return true; | |
205 } | |
206 } | |
207 return false; | |
208 } | |
209 | |
210 String filterString() { | |
211 return Util.join(";", exts); | |
212 } | |
213 } | |
214 | |
215 class TerminatorFilter extends NameFilter { | |
216 TerminatorFilter(String fname) { | |
217 this.fname = fname; | |
218 | |
219 } | |
220 boolean match(FileInfo fi) { | |
221 return true; | |
222 } | |
223 | |
224 } | |
225 | |
226 class SpecificNameFilter extends NameFilter { | |
227 String pats[]; | |
228 | |
229 SpecificNameFilter(String fname, String[] pats) { | |
230 this.fname = fname; | |
231 this.pats = pats; | |
232 } | |
233 | |
234 boolean match(FileInfo fi) { | |
235 for (int i=0; i<pats.length; i++) { | |
236 if (fi.attr.shortName.matches(pats[i])) { | |
237 return true; | |
238 } | |
239 } | |
240 return false; | |
241 } | |
242 | |
243 } | |
244 | |
1972 | 245 class SpecificPathFilter extends NameFilter { |
246 String pats[]; | |
247 | |
248 SpecificPathFilter(String fname, String[] pats) { | |
249 this.fname = fname; | |
250 this.pats = pats; | |
251 } | |
252 | |
253 boolean match(FileInfo fi) { | |
254 for (int i=0; i<pats.length; i++) { | |
255 if (fi.full.matches(pats[i])) { | |
256 return true; | |
257 } | |
258 } | |
259 return false; | |
260 } | |
261 | |
262 } | |
263 | |
0 | 264 class ContainerFilter extends NameFilter { |
265 Vector children; | |
266 | |
267 ContainerFilter(String fname) { | |
268 this.fname = fname; | |
269 children = new Vector(); | |
270 | |
271 } | |
272 boolean match(FileInfo fi) { | |
273 return false; | |
274 } | |
275 | |
276 Iterator babies() { return children.iterator(); } | |
277 | |
278 void add(NameFilter f) { | |
279 children.add(f); | |
280 } | |
281 } | |
282 | |
283 | |
284 void writeCustomToolConfig(Vector configs, String[] customToolAttrs) { | |
285 for (Iterator i = configs.iterator(); i.hasNext(); ) { | |
286 startTag("FileConfiguration", | |
287 new String[] { | |
288 "Name", (String)i.next() | |
289 } | |
290 ); | |
291 tag("Tool", customToolAttrs); | |
292 | |
293 endTag("FileConfiguration"); | |
294 } | |
295 } | |
296 | |
297 // here we define filters, which define layout of what can be seen in 'Solution View' of MSVC | |
298 // Basically there are two types of entities - container filters and real filters | |
299 // - container filter just provides a container to group together real filters | |
300 // - real filter can select elements from the set according to some rule, put it into XML | |
301 // and remove from the list | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
302 Vector makeFilters(TreeSet<FileInfo> files) { |
0 | 303 Vector rv = new Vector(); |
304 String sbase = Util.normalize(BuildConfig.getFieldString(null, "SourceBase")+"/src/"); | |
305 | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
306 String currentDir = ""; |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
307 DirectoryFilter container = null; |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
308 for(FileInfo fileInfo : files) { |
0 | 309 |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
310 if (!fileInfo.full.startsWith(sbase)) { |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
311 continue; |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
312 } |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
313 |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
314 int lastSlash = fileInfo.full.lastIndexOf('/'); |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
315 String dir = fileInfo.full.substring(sbase.length(), lastSlash); |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
316 if(dir.equals("share/vm")) { |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
317 // skip files directly in share/vm - should only be precompiled.hpp which is handled below |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
318 continue; |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
319 } |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
320 if (!dir.equals(currentDir)) { |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
321 currentDir = dir; |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
322 if (container != null && !rv.contains(container)) { |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
323 rv.add(container); |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
324 } |
0 | 325 |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
326 // remove "share/vm/" from names |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
327 String name = dir; |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
328 if (dir.startsWith("share/vm/")) { |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
329 name = dir.substring("share/vm/".length(), dir.length()); |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
330 } |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
331 DirectoryFilter newfilter = new DirectoryFilter(name, dir, sbase); |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
332 int i = rv.indexOf(newfilter); |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
333 if(i == -1) { |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
334 container = newfilter; |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
335 } else { |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
336 // if the filter already exists, reuse it |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
337 container = (DirectoryFilter) rv.get(i); |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
338 } |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
339 } |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
340 } |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
341 if (container != null && !rv.contains(container)) { |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
342 rv.add(container); |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
343 } |
0 | 344 |
1972 | 345 ContainerFilter generated = new ContainerFilter("Generated"); |
346 ContainerFilter c1Generated = new ContainerFilter("C1"); | |
347 c1Generated.add(new SpecificPathFilter("C++ Interpreter Generated", new String[] {".*compiler1/generated/jvmtifiles/bytecodeInterpreterWithChecks.+"})); | |
348 c1Generated.add(new SpecificPathFilter("jvmtifiles", new String[] {".*compiler1/generated/jvmtifiles/.*"})); | |
349 generated.add(c1Generated); | |
350 ContainerFilter c2Generated = new ContainerFilter("C2"); | |
351 c2Generated.add(new SpecificPathFilter("C++ Interpreter Generated", new String[] {".*compiler2/generated/jvmtifiles/bytecodeInterpreterWithChecks.+"})); | |
352 c2Generated.add(new SpecificPathFilter("adfiles", new String[] {".*compiler2/generated/adfiles/.*"})); | |
353 c2Generated.add(new SpecificPathFilter("jvmtifiles", new String[] {".*compiler2/generated/jvmtifiles/.*"})); | |
354 generated.add(c2Generated); | |
355 ContainerFilter coreGenerated = new ContainerFilter("Core"); | |
356 coreGenerated.add(new SpecificPathFilter("C++ Interpreter Generated", new String[] {".*core/generated/jvmtifiles/bytecodeInterpreterWithChecks.+"})); | |
357 coreGenerated.add(new SpecificPathFilter("jvmtifiles", new String[] {".*core/generated/jvmtifiles/.*"})); | |
358 generated.add(coreGenerated); | |
359 ContainerFilter tieredGenerated = new ContainerFilter("Tiered"); | |
360 tieredGenerated.add(new SpecificPathFilter("C++ Interpreter Generated", new String[] {".*tiered/generated/jvmtifiles/bytecodeInterpreterWithChecks.+"})); | |
361 tieredGenerated.add(new SpecificPathFilter("adfiles", new String[] {".*tiered/generated/adfiles/.*"})); | |
362 tieredGenerated.add(new SpecificPathFilter("jvmtifiles", new String[] {".*tiered/generated/jvmtifiles/.*"})); | |
363 generated.add(tieredGenerated); | |
364 ContainerFilter kernelGenerated = new ContainerFilter("Kernel"); | |
365 kernelGenerated.add(new SpecificPathFilter("C++ Interpreter Generated", new String[] {".*kernel/generated/jvmtifiles/bytecodeInterpreterWithChecks.+"})); | |
366 kernelGenerated.add(new SpecificPathFilter("jvmtifiles", new String[] {".*kernel/generated/jvmtifiles/.*"})); | |
367 generated.add(kernelGenerated); | |
368 rv.add(generated); | |
0 | 369 |
1972 | 370 rv.add(new SpecificNameFilter("Precompiled Header", new String[] {"precompiled.hpp"})); |
0 | 371 |
372 // this one is to catch files not caught by other filters | |
373 //rv.add(new TypeFilter("Header Files", new String[] {"h", "hpp", "hxx", "hm", "inl", "fi", "fd"})); | |
374 rv.add(new TerminatorFilter("Source Files")); | |
375 | |
376 return rv; | |
377 } | |
378 | |
379 void writeFiles(Vector allConfigs) { | |
380 | |
381 Hashtable allFiles = computeAttributedFiles(allConfigs); | |
382 | |
383 Vector allConfigNames = new Vector(); | |
384 for (Iterator i = allConfigs.iterator(); i.hasNext(); ) { | |
385 allConfigNames.add(((BuildConfig)i.next()).get("Name")); | |
386 } | |
387 | |
388 TreeSet sortedFiles = sortFiles(allFiles); | |
389 | |
390 startTag("Files", null); | |
391 | |
392 for (Iterator i = makeFilters(sortedFiles).iterator(); i.hasNext(); ) { | |
393 doWriteFiles(sortedFiles, allConfigNames, (NameFilter)i.next()); | |
394 } | |
395 | |
396 | |
397 startTag("Filter", | |
398 new String[] { | |
399 "Name", "Resource Files", | |
400 "Filter", "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe" | |
401 } | |
402 ); | |
403 endTag("Filter"); | |
404 | |
405 endTag("Files"); | |
406 } | |
407 | |
408 void doWriteFiles(TreeSet allFiles, Vector allConfigNames, NameFilter filter) { | |
409 startTag("Filter", | |
410 new String[] { | |
411 "Name", filter.name(), | |
412 "Filter", filter.filterString() | |
413 } | |
414 ); | |
415 | |
416 if (filter instanceof ContainerFilter) { | |
417 | |
418 Iterator i = ((ContainerFilter)filter).babies(); | |
419 while (i.hasNext()) { | |
420 doWriteFiles(allFiles, allConfigNames, (NameFilter)i.next()); | |
421 } | |
422 | |
423 } else { | |
424 | |
425 Iterator i = allFiles.iterator(); | |
426 while (i.hasNext()) { | |
427 FileInfo fi = (FileInfo)i.next(); | |
428 | |
429 if (!filter.match(fi)) { | |
430 continue; | |
431 } | |
432 | |
433 startTag("File", | |
434 new String[] { | |
435 "RelativePath", fi.full.replace('/', '\\') | |
436 } | |
437 ); | |
438 | |
439 FileAttribute a = fi.attr; | |
440 if (a.pchRoot) { | |
441 writeCustomToolConfig(allConfigNames, | |
442 new String[] { | |
443 "Name", "VCCLCompilerTool", | |
444 "UsePrecompiledHeader", "1" | |
445 }); | |
446 } | |
447 | |
448 if (a.noPch) { | |
449 writeCustomToolConfig(allConfigNames, | |
450 new String[] { | |
451 "Name", "VCCLCompilerTool", | |
452 "UsePrecompiledHeader", "0" | |
453 }); | |
454 } | |
455 | |
456 if (a.configs != null) { | |
457 for (Iterator j=allConfigNames.iterator(); j.hasNext();) { | |
458 String cfg = (String)j.next(); | |
459 if (!a.configs.contains(cfg)) { | |
460 startTag("FileConfiguration", | |
461 new String[] { | |
462 "Name", cfg, | |
463 "ExcludedFromBuild", "TRUE" | |
464 }); | |
465 endTag("FileConfiguration"); | |
466 | |
467 } | |
468 } | |
469 } | |
470 | |
471 endTag("File"); | |
472 | |
473 // we not gonna look at this file anymore | |
474 i.remove(); | |
475 } | |
476 } | |
477 | |
478 endTag("Filter"); | |
479 } | |
480 | |
481 | |
482 void writeConfiguration(BuildConfig cfg) { | |
483 startTag("Configuration", | |
484 new String[] { | |
485 "Name", cfg.get("Name"), | |
486 "OutputDirectory", cfg.get("OutputDir"), | |
487 "IntermediateDirectory", cfg.get("OutputDir"), | |
488 "ConfigurationType", "2", | |
489 "UseOfMFC", "0", | |
490 "ATLMinimizesCRunTimeLibraryUsage", "FALSE" | |
491 } | |
492 ); | |
493 | |
494 | |
495 | |
496 tagV("Tool", cfg.getV("CompilerFlags")); | |
497 | |
498 tag("Tool", | |
499 new String[] { | |
500 "Name", "VCCustomBuildTool" | |
501 } | |
502 ); | |
503 | |
504 tagV("Tool", cfg.getV("LinkerFlags")); | |
505 | |
506 tag("Tool", | |
507 new String[] { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
508 "Name", "VCPostBuildEventTool", |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
509 "Description", BuildConfig.getFieldString(null, "PostbuildDescription"), |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
510 //Caution: String.replace(String,String) is available from JDK5 onwards only |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
511 "CommandLine", cfg.expandFormat(BuildConfig.getFieldString(null, "PostbuildCommand").replace |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
512 ("\t", "
")) |
0 | 513 } |
514 ); | |
515 | |
516 tag("Tool", | |
517 new String[] { | |
518 "Name", "VCPreBuildEventTool" | |
519 } | |
520 ); | |
521 | |
522 tag("Tool", | |
523 new String[] { | |
524 "Name", "VCPreLinkEventTool", | |
525 "Description", BuildConfig.getFieldString(null, "PrelinkDescription"), | |
659
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
526 //Caution: String.replace(String,String) is available from JDK5 onwards only |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
527 "CommandLine", cfg.expandFormat(BuildConfig.getFieldString(null, "PrelinkCommand").replace |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
528 ("\t", "
")) |
0 | 529 } |
530 ); | |
531 | |
532 tag("Tool", | |
533 new String[] { | |
534 "Name", "VCResourceCompilerTool", | |
535 // XXX??? | |
536 "PreprocessorDefinitions", "NDEBUG", | |
537 "Culture", "1033" | |
538 } | |
539 ); | |
540 | |
541 tag("Tool", | |
542 new String[] { | |
543 "Name", "VCMIDLTool", | |
544 "PreprocessorDefinitions", "NDEBUG", | |
545 "MkTypLibCompatible", "TRUE", | |
546 "SuppressStartupBanner", "TRUE", | |
547 "TargetEnvironment", "1", | |
548 "TypeLibraryName", cfg.get("OutputDir") + Util.sep + "vm.tlb", | |
549 "HeaderFileName", "" | |
550 } | |
551 ); | |
552 | |
553 endTag("Configuration"); | |
554 } | |
555 | |
556 int indent; | |
557 | |
558 private void startTagPrim(String name, | |
559 String[] attrs, | |
560 boolean close) { | |
561 doIndent(); | |
562 printWriter.print("<"+name); | |
563 indent++; | |
564 | |
565 if (attrs != null) { | |
566 printWriter.println(); | |
567 for (int i=0; i<attrs.length; i+=2) { | |
568 doIndent(); | |
1972 | 569 printWriter.print(" " + attrs[i]+"=\""+attrs[i+1]+"\""); |
570 if (i < attrs.length - 2) { | |
571 printWriter.println(); | |
572 } | |
0 | 573 } |
574 } | |
575 | |
576 if (close) { | |
577 indent--; | |
578 //doIndent(); | |
579 printWriter.println("/>"); | |
580 } else { | |
581 //doIndent(); | |
582 printWriter.println(">"); | |
583 } | |
584 } | |
585 | |
586 void startTag(String name, String[] attrs) { | |
587 startTagPrim(name, attrs, false); | |
588 } | |
589 | |
590 void startTagV(String name, Vector attrs) { | |
591 String s[] = new String [attrs.size()]; | |
592 for (int i=0; i<attrs.size(); i++) { | |
593 s[i] = (String)attrs.elementAt(i); | |
594 } | |
595 startTagPrim(name, s, false); | |
596 } | |
597 | |
598 void endTag(String name) { | |
599 indent--; | |
600 doIndent(); | |
601 printWriter.println("</"+name+">"); | |
602 } | |
603 | |
604 void tag(String name, String[] attrs) { | |
605 startTagPrim(name, attrs, true); | |
606 } | |
607 | |
608 void tagV(String name, Vector attrs) { | |
609 String s[] = new String [attrs.size()]; | |
610 for (int i=0; i<attrs.size(); i++) { | |
611 s[i] = (String)attrs.elementAt(i); | |
612 } | |
613 startTagPrim(name, s, true); | |
614 } | |
615 | |
616 | |
617 void doIndent() { | |
618 for (int i=0; i<indent; i++) { | |
619 printWriter.print(" "); | |
620 } | |
621 } | |
622 | |
623 protected String getProjectExt() { | |
624 return ".vcproj"; | |
625 } | |
626 } | |
627 | |
628 class CompilerInterfaceVC7 extends CompilerInterface { | |
659
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
629 void getBaseCompilerFlags_common(Vector defines, Vector includes, String outDir,Vector rv) { |
0 | 630 |
631 // advanced M$ IDE (2003) can only recognize name if it's first or | |
632 // second attribute in the tag - go guess | |
633 addAttr(rv, "Name", "VCCLCompilerTool"); | |
634 addAttr(rv, "AdditionalIncludeDirectories", Util.join(",", includes)); | |
659
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
635 addAttr(rv, "PreprocessorDefinitions", |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
636 Util.join(";", defines).replace("\"",""")); |
1972 | 637 addAttr(rv, "PrecompiledHeaderThrough", "precompiled.hpp"); |
0 | 638 addAttr(rv, "PrecompiledHeaderFile", outDir+Util.sep+"vm.pch"); |
639 addAttr(rv, "AssemblerListingLocation", outDir); | |
640 addAttr(rv, "ObjectFile", outDir+Util.sep); | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
641 addAttr(rv, "ProgramDataBaseFileName", outDir+Util.sep+"jvm.pdb"); |
659
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
642 // Set /nologo optin |
0 | 643 addAttr(rv, "SuppressStartupBanner", "TRUE"); |
659
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
644 // Surpass the default /Tc or /Tp. 0 is compileAsDefault |
0 | 645 addAttr(rv, "CompileAs", "0"); |
659
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
646 // Set /W3 option. 3 is warningLevel_3 |
0 | 647 addAttr(rv, "WarningLevel", "3"); |
659
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
648 // Set /WX option, |
0 | 649 addAttr(rv, "WarnAsError", "TRUE"); |
659
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
650 // Set /GS option |
0 | 651 addAttr(rv, "BufferSecurityCheck", "FALSE"); |
659
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
652 // Set /Zi option. 3 is debugEnabled |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
653 addAttr(rv, "DebugInformationFormat", "3"); |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
654 } |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
655 Vector getBaseCompilerFlags(Vector defines, Vector includes, String outDir) { |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
656 Vector rv = new Vector(); |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
657 |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
658 getBaseCompilerFlags_common(defines,includes, outDir, rv); |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
659 // Set /Yu option. 3 is pchUseUsingSpecific |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
660 // Note: Starting VC8 pchUseUsingSpecific is 2 !!! |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
661 addAttr(rv, "UsePrecompiledHeader", "3"); |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
662 // Set /EHsc- option |
0 | 663 addAttr(rv, "ExceptionHandling", "FALSE"); |
664 | |
665 return rv; | |
666 } | |
667 | |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
668 Vector getBaseLinkerFlags(String outDir, String outDll, String platformName) { |
0 | 669 Vector rv = new Vector(); |
670 | |
671 addAttr(rv, "Name", "VCLinkerTool"); | |
672 addAttr(rv, "AdditionalOptions", | |
673 "/export:JNI_GetDefaultJavaVMInitArgs " + | |
674 "/export:JNI_CreateJavaVM " + | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
675 "/export:JVM_FindClassFromBootLoader "+ |
0 | 676 "/export:JNI_GetCreatedJavaVMs "+ |
677 "/export:jio_snprintf /export:jio_printf "+ | |
678 "/export:jio_fprintf /export:jio_vfprintf "+ | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
679 "/export:jio_vsnprintf "+ |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
680 "/export:JVM_GetVersionInfo "+ |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
681 "/export:JVM_GetThreadStateNames "+ |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
682 "/export:JVM_GetThreadStateValues "+ |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
683 "/export:JVM_InitAgentProperties "); |
0 | 684 addAttr(rv, "AdditionalDependencies", "Wsock32.lib winmm.lib"); |
685 addAttr(rv, "OutputFile", outDll); | |
659
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
686 // Set /INCREMENTAL option. 1 is linkIncrementalNo |
0 | 687 addAttr(rv, "LinkIncremental", "1"); |
688 addAttr(rv, "SuppressStartupBanner", "TRUE"); | |
689 addAttr(rv, "ModuleDefinitionFile", outDir+Util.sep+"vm.def"); | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
690 addAttr(rv, "ProgramDatabaseFile", outDir+Util.sep+"jvm.pdb"); |
659
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
691 // Set /SUBSYSTEM option. 2 is subSystemWindows |
0 | 692 addAttr(rv, "SubSystem", "2"); |
693 addAttr(rv, "BaseAddress", "0x8000000"); | |
694 addAttr(rv, "ImportLibrary", outDir+Util.sep+"jvm.lib"); | |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
695 if(platformName.equals("Win32")) { |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
696 // Set /MACHINE option. 1 is X86 |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
697 addAttr(rv, "TargetMachine", "1"); |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
698 } else { |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
699 // Set /MACHINE option. 17 is X64 |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
700 addAttr(rv, "TargetMachine", "17"); |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
701 } |
0 | 702 |
703 return rv; | |
704 } | |
705 | |
659
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
706 void getDebugCompilerFlags_common(String opt,Vector rv) { |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
707 |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
708 // Set /On option |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
709 addAttr(rv, "Optimization", opt); |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
710 // Set /FR option. 1 is brAllInfo |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
711 addAttr(rv, "BrowseInformation", "1"); |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
712 addAttr(rv, "BrowseInformationFile", "$(IntDir)" + Util.sep); |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
713 // Set /MD option. 2 is rtMultiThreadedDLL |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
714 addAttr(rv, "RuntimeLibrary", "2"); |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
715 // Set /Oy- option |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
716 addAttr(rv, "OmitFramePointers", "FALSE"); |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
717 |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
718 } |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
719 |
0 | 720 Vector getDebugCompilerFlags(String opt) { |
721 Vector rv = new Vector(); | |
722 | |
659
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
723 getDebugCompilerFlags_common(opt,rv); |
0 | 724 |
725 return rv; | |
726 } | |
727 | |
728 Vector getDebugLinkerFlags() { | |
729 Vector rv = new Vector(); | |
730 | |
659
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
731 addAttr(rv, "GenerateDebugInformation", "TRUE"); // == /DEBUG option |
0 | 732 |
733 return rv; | |
734 } | |
735 | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
736 void getAdditionalNonKernelLinkerFlags(Vector rv) { |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
737 extAttr(rv, "AdditionalOptions", |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
738 "/export:AsyncGetCallTrace "); |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
739 } |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
740 |
659
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
741 void getProductCompilerFlags_common(Vector rv) { |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
742 // Set /O2 option. 2 is optimizeMaxSpeed |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
743 addAttr(rv, "Optimization", "2"); |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
744 // Set /Oy- option |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
745 addAttr(rv, "OmitFramePointers", "FALSE"); |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
746 // Set /Ob option. 1 is expandOnlyInline |
0 | 747 addAttr(rv, "InlineFunctionExpansion", "1"); |
659
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
748 // Set /GF option. |
0 | 749 addAttr(rv, "StringPooling", "TRUE"); |
659
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
750 // Set /MD option. 2 is rtMultiThreadedDLL |
0 | 751 addAttr(rv, "RuntimeLibrary", "2"); |
659
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
752 // Set /Gy option |
0 | 753 addAttr(rv, "EnableFunctionLevelLinking", "TRUE"); |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
754 } |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
755 |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
756 Vector getProductCompilerFlags() { |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
757 Vector rv = new Vector(); |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
758 |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
759 getProductCompilerFlags_common(rv); |
0 | 760 |
761 return rv; | |
762 } | |
763 | |
764 Vector getProductLinkerFlags() { | |
765 Vector rv = new Vector(); | |
766 | |
659
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
767 // Set /OPT:REF option. 2 is optReferences |
0 | 768 addAttr(rv, "OptimizeReferences", "2"); |
659
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
769 // Set /OPT:optFolding option. 2 is optFolding |
0 | 770 addAttr(rv, "EnableCOMDATFolding", "2"); |
771 | |
772 return rv; | |
773 } | |
774 | |
775 String getOptFlag() { | |
776 return "2"; | |
777 } | |
778 | |
779 String getNoOptFlag() { | |
780 return "0"; | |
781 } | |
782 | |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
783 String makeCfgName(String flavourBuild, String platform) { |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
784 return flavourBuild + "|" + platform; |
0 | 785 } |
786 } |