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