Thu, 29 Mar 2012 16:43:21 +0200
7163863: Updated projectcreator
Summary: Enable source browsing for all platform dependent code
Reviewed-by: brutisso, coleenp
sla@2675 | 1 | import java.io.File; |
sla@2675 | 2 | import java.io.FileNotFoundException; |
sla@2675 | 3 | import java.io.IOException; |
sla@2675 | 4 | import java.io.PrintWriter; |
sla@2675 | 5 | import java.io.UnsupportedEncodingException; |
neliasso@4112 | 6 | import java.nio.file.FileSystems; |
sla@2675 | 7 | import java.util.Iterator; |
neliasso@4112 | 8 | import java.util.LinkedList; |
sla@2675 | 9 | import java.util.UUID; |
sla@2675 | 10 | import java.util.Vector; |
sla@2675 | 11 | |
sla@2675 | 12 | public class WinGammaPlatformVC10 extends WinGammaPlatformVC7 { |
sla@2675 | 13 | |
neliasso@4112 | 14 | |
neliasso@4112 | 15 | LinkedList <String>filters = new LinkedList<String>(); |
neliasso@4112 | 16 | LinkedList <String[]>filterDeps = new LinkedList<String[]>(); |
neliasso@4112 | 17 | |
sla@2675 | 18 | @Override |
sla@2675 | 19 | protected String getProjectExt() { |
sla@2675 | 20 | return ".vcxproj"; |
sla@2675 | 21 | } |
sla@2675 | 22 | |
sla@2675 | 23 | @Override |
sla@2675 | 24 | public void writeProjectFile(String projectFileName, String projectName, |
sla@2675 | 25 | Vector<BuildConfig> allConfigs) throws IOException { |
sla@2675 | 26 | System.out.println(); |
sla@2675 | 27 | System.out.print(" Writing .vcxproj file: " + projectFileName); |
sla@2675 | 28 | |
sla@2675 | 29 | String projDir = Util.normalize(new File(projectFileName).getParent()); |
sla@2675 | 30 | |
sla@2675 | 31 | printWriter = new PrintWriter(projectFileName, "UTF-8"); |
sla@2675 | 32 | printWriter.println("<?xml version=\"1.0\" encoding=\"utf-8\"?>"); |
sla@2675 | 33 | startTag("Project", |
sla@2675 | 34 | "DefaultTargets", "Build", |
sla@2675 | 35 | "ToolsVersion", "4.0", |
sla@2675 | 36 | "xmlns", "http://schemas.microsoft.com/developer/msbuild/2003"); |
sla@2675 | 37 | startTag("ItemGroup", |
sla@2675 | 38 | "Label", "ProjectConfigurations"); |
sla@2675 | 39 | for (BuildConfig cfg : allConfigs) { |
sla@2675 | 40 | startTag("ProjectConfiguration", |
sla@2675 | 41 | "Include", cfg.get("Name")); |
sla@2675 | 42 | tagData("Configuration", cfg.get("Id")); |
sla@2675 | 43 | tagData("Platform", cfg.get("PlatformName")); |
neliasso@4112 | 44 | endTag(); |
sla@2675 | 45 | } |
neliasso@4112 | 46 | endTag(); |
sla@2675 | 47 | |
sla@2675 | 48 | startTag("PropertyGroup", "Label", "Globals"); |
sla@2675 | 49 | tagData("ProjectGuid", "{8822CB5C-1C41-41C2-8493-9F6E1994338B}"); |
sla@2675 | 50 | tag("SccProjectName"); |
sla@2675 | 51 | tag("SccLocalPath"); |
neliasso@4112 | 52 | endTag(); |
sla@2675 | 53 | |
sla@2675 | 54 | tag("Import", "Project", "$(VCTargetsPath)\\Microsoft.Cpp.Default.props"); |
sla@2675 | 55 | |
sla@2675 | 56 | for (BuildConfig cfg : allConfigs) { |
sla@2675 | 57 | startTag(cfg, "PropertyGroup", "Label", "Configuration"); |
sla@2675 | 58 | tagData("ConfigurationType", "DynamicLibrary"); |
sla@2675 | 59 | tagData("UseOfMfc", "false"); |
neliasso@4112 | 60 | endTag(); |
sla@2675 | 61 | } |
sla@2675 | 62 | |
sla@2675 | 63 | tag("Import", "Project", "$(VCTargetsPath)\\Microsoft.Cpp.props"); |
sla@2675 | 64 | startTag("ImportGroup", "Label", "ExtensionSettings"); |
neliasso@4112 | 65 | endTag(); |
sla@2675 | 66 | for (BuildConfig cfg : allConfigs) { |
sla@2675 | 67 | startTag(cfg, "ImportGroup", "Label", "PropertySheets"); |
sla@2675 | 68 | tag("Import", |
sla@2675 | 69 | "Project", "$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props", |
sla@2675 | 70 | "Condition", "exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')", |
sla@2675 | 71 | "Label", "LocalAppDataPlatform"); |
neliasso@4112 | 72 | endTag(); |
sla@2675 | 73 | } |
sla@2675 | 74 | |
sla@2675 | 75 | tag("PropertyGroup", "Label", "UserMacros"); |
sla@2675 | 76 | |
sla@2675 | 77 | startTag("PropertyGroup"); |
sla@2675 | 78 | tagData("_ProjectFileVersion", "10.0.30319.1"); |
sla@2675 | 79 | for (BuildConfig cfg : allConfigs) { |
sla@2675 | 80 | tagData(cfg, "OutDir", cfg.get("OutputDir") + Util.sep); |
sla@2675 | 81 | tagData(cfg, "IntDir", cfg.get("OutputDir") + Util.sep); |
sla@2675 | 82 | tagData(cfg, "LinkIncremental", "false"); |
sla@2675 | 83 | } |
sla@2675 | 84 | for (BuildConfig cfg : allConfigs) { |
sla@2675 | 85 | tagData(cfg, "CodeAnalysisRuleSet", "AllRules.ruleset"); |
sla@2675 | 86 | tag(cfg, "CodeAnalysisRules"); |
sla@2675 | 87 | tag(cfg, "CodeAnalysisRuleAssemblies"); |
sla@2675 | 88 | } |
neliasso@4112 | 89 | endTag(); |
sla@2675 | 90 | |
sla@2675 | 91 | for (BuildConfig cfg : allConfigs) { |
sla@2675 | 92 | startTag(cfg, "ItemDefinitionGroup"); |
sla@2675 | 93 | startTag("ClCompile"); |
sla@2675 | 94 | tagV(cfg.getV("CompilerFlags")); |
neliasso@4112 | 95 | endTag(); |
sla@2675 | 96 | |
sla@2675 | 97 | startTag("Link"); |
sla@2675 | 98 | tagV(cfg.getV("LinkerFlags")); |
neliasso@4112 | 99 | endTag(); |
sla@2675 | 100 | |
sla@2675 | 101 | startTag("PostBuildEvent"); |
sla@2675 | 102 | tagData("Message", BuildConfig.getFieldString(null, "PostbuildDescription")); |
sla@2675 | 103 | tagData("Command", cfg.expandFormat(BuildConfig.getFieldString(null, "PostbuildCommand").replace("\t", "\r\n"))); |
neliasso@4112 | 104 | endTag(); |
sla@2675 | 105 | |
sla@2675 | 106 | startTag("PreLinkEvent"); |
sla@2675 | 107 | tagData("Message", BuildConfig.getFieldString(null, "PrelinkDescription")); |
sla@2675 | 108 | tagData("Command", cfg.expandFormat(BuildConfig.getFieldString(null, "PrelinkCommand").replace("\t", "\r\n"))); |
neliasso@4112 | 109 | endTag(); |
sla@2675 | 110 | |
neliasso@4112 | 111 | endTag(); |
sla@2675 | 112 | } |
sla@2675 | 113 | |
sla@2675 | 114 | writeFiles(allConfigs, projDir); |
sla@2675 | 115 | |
sla@2675 | 116 | tag("Import", "Project", "$(VCTargetsPath)\\Microsoft.Cpp.targets"); |
sla@2675 | 117 | startTag("ImportGroup", "Label", "ExtensionTargets"); |
neliasso@4112 | 118 | endTag(); |
sla@2675 | 119 | |
neliasso@4112 | 120 | endTag(); |
sla@2675 | 121 | printWriter.close(); |
sla@2675 | 122 | System.out.println(" Done."); |
sla@2675 | 123 | |
sla@2675 | 124 | writeFilterFile(projectFileName, projectName, allConfigs, projDir); |
sla@2675 | 125 | writeUserFile(projectFileName, allConfigs); |
sla@2675 | 126 | } |
sla@2675 | 127 | |
sla@2675 | 128 | |
sla@2675 | 129 | private void writeUserFile(String projectFileName, Vector<BuildConfig> allConfigs) throws FileNotFoundException, UnsupportedEncodingException { |
sla@2675 | 130 | String userFileName = projectFileName + ".user"; |
sla@2675 | 131 | if (new File(userFileName).exists()) { |
sla@2675 | 132 | return; |
sla@2675 | 133 | } |
sla@2675 | 134 | System.out.print(" Writing .vcxproj.user file: " + userFileName); |
sla@2675 | 135 | printWriter = new PrintWriter(userFileName, "UTF-8"); |
sla@2675 | 136 | |
sla@2675 | 137 | printWriter.println("<?xml version=\"1.0\" encoding=\"utf-8\"?>"); |
sla@2675 | 138 | startTag("Project", |
sla@2675 | 139 | "ToolsVersion", "4.0", |
sla@2675 | 140 | "xmlns", "http://schemas.microsoft.com/developer/msbuild/2003"); |
sla@2675 | 141 | |
sla@2675 | 142 | for (BuildConfig cfg : allConfigs) { |
sla@2675 | 143 | startTag(cfg, "PropertyGroup"); |
sla@2675 | 144 | tagData("LocalDebuggerCommand", "$(TargetDir)/hotspot.exe"); |
neliasso@4112 | 145 | endTag(); |
sla@2675 | 146 | } |
sla@2675 | 147 | |
neliasso@4112 | 148 | endTag(); |
sla@2675 | 149 | printWriter.close(); |
sla@2675 | 150 | System.out.println(" Done."); |
sla@2675 | 151 | } |
sla@2675 | 152 | |
neliasso@4112 | 153 | public void addFilter(String rPath) { |
neliasso@4112 | 154 | filters.add(rPath); |
neliasso@4112 | 155 | } |
neliasso@4112 | 156 | |
neliasso@4112 | 157 | public void addFilterDependency(String fileLoc, String filter) { |
neliasso@4112 | 158 | filterDeps.add(new String[] {fileLoc, filter}); |
neliasso@4112 | 159 | } |
neliasso@4112 | 160 | |
sla@2675 | 161 | private void writeFilterFile(String projectFileName, String projectName, |
sla@2675 | 162 | Vector<BuildConfig> allConfigs, String base) throws FileNotFoundException, UnsupportedEncodingException { |
sla@2675 | 163 | String filterFileName = projectFileName + ".filters"; |
sla@2675 | 164 | System.out.print(" Writing .vcxproj.filters file: " + filterFileName); |
sla@2675 | 165 | printWriter = new PrintWriter(filterFileName, "UTF-8"); |
sla@2675 | 166 | |
sla@2675 | 167 | printWriter.println("<?xml version=\"1.0\" encoding=\"utf-8\"?>"); |
sla@2675 | 168 | startTag("Project", |
sla@2675 | 169 | "ToolsVersion", "4.0", |
sla@2675 | 170 | "xmlns", "http://schemas.microsoft.com/developer/msbuild/2003"); |
sla@2675 | 171 | |
sla@2675 | 172 | startTag("ItemGroup"); |
neliasso@4112 | 173 | for (String filter : filters) { |
neliasso@4112 | 174 | startTag("Filter", "Include",filter); |
neliasso@4112 | 175 | UUID uuid = UUID.randomUUID(); |
neliasso@4112 | 176 | tagData("UniqueIdentifier", "{" + uuid.toString() + "}"); |
neliasso@4112 | 177 | endTag(); |
sla@2675 | 178 | } |
sla@2675 | 179 | startTag("Filter", "Include", "Resource Files"); |
sla@2675 | 180 | UUID uuid = UUID.randomUUID(); |
sla@2675 | 181 | tagData("UniqueIdentifier", "{" + uuid.toString() + "}"); |
sla@2675 | 182 | tagData("Extensions", "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"); |
neliasso@4112 | 183 | endTag(); |
neliasso@4112 | 184 | endTag(); |
sla@2675 | 185 | |
neliasso@4112 | 186 | //TODO - do I need to split cpp and hpp files? |
neliasso@4112 | 187 | |
neliasso@4112 | 188 | // then all files |
sla@2675 | 189 | startTag("ItemGroup"); |
neliasso@4112 | 190 | for (String[] dep : filterDeps) { |
neliasso@4112 | 191 | String tagName = getFileTagFromSuffix(dep[0]); |
neliasso@4112 | 192 | |
neliasso@4112 | 193 | startTag(tagName, "Include", dep[0]); |
neliasso@4112 | 194 | tagData("Filter", dep[1]); |
neliasso@4112 | 195 | endTag(); |
sla@2675 | 196 | } |
neliasso@4112 | 197 | endTag(); |
sla@2675 | 198 | |
neliasso@4112 | 199 | endTag(); |
sla@2675 | 200 | printWriter.close(); |
sla@2675 | 201 | System.out.println(" Done."); |
sla@2675 | 202 | } |
sla@2675 | 203 | |
neliasso@4112 | 204 | public String getFileTagFromSuffix(String fileName) { |
neliasso@4112 | 205 | if (fileName.endsWith(".cpp")) { |
neliasso@4112 | 206 | return"ClCompile"; |
neliasso@4112 | 207 | } else if (fileName.endsWith(".c")) { |
neliasso@4112 | 208 | return "ClCompile"; |
neliasso@4112 | 209 | } else if (fileName.endsWith(".hpp")) { |
neliasso@4112 | 210 | return"ClInclude"; |
neliasso@4112 | 211 | } else if (fileName.endsWith(".h")) { |
neliasso@4112 | 212 | return "ClInclude"; |
neliasso@4112 | 213 | } else { |
neliasso@4112 | 214 | return"None"; |
neliasso@4112 | 215 | } |
sla@2675 | 216 | } |
sla@2675 | 217 | |
neliasso@4112 | 218 | void writeFiles(Vector<BuildConfig> allConfigs, String projDir) { |
neliasso@4112 | 219 | // This code assummes there are no config specific includes. |
neliasso@4112 | 220 | startTag("ItemGroup"); |
neliasso@4112 | 221 | |
neliasso@4112 | 222 | String sourceBase = BuildConfig.getFieldString(null, "SourceBase"); |
neliasso@4112 | 223 | |
neliasso@4112 | 224 | // Use first config for all global absolute includes. |
neliasso@4112 | 225 | BuildConfig baseConfig = allConfigs.firstElement(); |
neliasso@4112 | 226 | Vector<String> rv = new Vector<String>(); |
neliasso@4112 | 227 | |
neliasso@4112 | 228 | // Then use first config for all relative includes |
neliasso@4112 | 229 | Vector<String> ri = new Vector<String>(); |
neliasso@4112 | 230 | baseConfig.collectRelevantVectors(ri, "RelativeSrcInclude"); |
neliasso@4112 | 231 | for (String f : ri) { |
neliasso@4112 | 232 | rv.add(sourceBase + Util.sep + f); |
neliasso@4112 | 233 | } |
neliasso@4112 | 234 | |
neliasso@4112 | 235 | baseConfig.collectRelevantVectors(rv, "AbsoluteSrcInclude"); |
neliasso@4112 | 236 | |
neliasso@4112 | 237 | handleIncludes(rv, allConfigs); |
neliasso@4112 | 238 | |
neliasso@4112 | 239 | endTag(); |
sla@2675 | 240 | } |
sla@2675 | 241 | |
neliasso@4112 | 242 | // Will visit file tree for each include |
neliasso@4112 | 243 | private void handleIncludes(Vector<String> includes, Vector<BuildConfig> allConfigs) { |
neliasso@4112 | 244 | for (String path : includes) { |
neliasso@4112 | 245 | FileTreeCreatorVC10 ftc = new FileTreeCreatorVC10(FileSystems.getDefault().getPath(path) , allConfigs, this); |
neliasso@4112 | 246 | try { |
neliasso@4112 | 247 | ftc.writeFileTree(); |
neliasso@4112 | 248 | } catch (IOException e) { |
neliasso@4112 | 249 | e.printStackTrace(); |
neliasso@4112 | 250 | } |
neliasso@4112 | 251 | } |
sla@2675 | 252 | } |
sla@2675 | 253 | |
sla@2675 | 254 | String buildCond(BuildConfig cfg) { |
sla@2675 | 255 | return "'$(Configuration)|$(Platform)'=='"+cfg.get("Name")+"'"; |
sla@2675 | 256 | } |
sla@2675 | 257 | |
sla@2675 | 258 | void tagV(Vector<String> v) { |
sla@2675 | 259 | Iterator<String> i = v.iterator(); |
sla@2675 | 260 | while(i.hasNext()) { |
sla@2675 | 261 | String name = i.next(); |
sla@2675 | 262 | String data = i.next(); |
sla@2675 | 263 | tagData(name, data); |
sla@2675 | 264 | } |
sla@2675 | 265 | } |
sla@2675 | 266 | |
sla@2675 | 267 | void tagData(BuildConfig cfg, String name, String data) { |
sla@2675 | 268 | tagData(name, data, "Condition", buildCond(cfg)); |
sla@2675 | 269 | } |
sla@2675 | 270 | |
sla@2675 | 271 | void tag(BuildConfig cfg, String name, String... attrs) { |
sla@2675 | 272 | String[] ss = new String[attrs.length + 2]; |
sla@2675 | 273 | ss[0] = "Condition"; |
sla@2675 | 274 | ss[1] = buildCond(cfg); |
sla@2675 | 275 | System.arraycopy(attrs, 0, ss, 2, attrs.length); |
sla@2675 | 276 | |
sla@2675 | 277 | tag(name, ss); |
sla@2675 | 278 | } |
sla@2675 | 279 | |
sla@2675 | 280 | void startTag(BuildConfig cfg, String name, String... attrs) { |
sla@2675 | 281 | String[] ss = new String[attrs.length + 2]; |
sla@2675 | 282 | ss[0] = "Condition"; |
sla@2675 | 283 | ss[1] = buildCond(cfg); |
sla@2675 | 284 | System.arraycopy(attrs, 0, ss, 2, attrs.length); |
sla@2675 | 285 | |
sla@2675 | 286 | startTag(name, ss); |
sla@2675 | 287 | } |
neliasso@4112 | 288 | |
sla@2675 | 289 | } |
sla@2675 | 290 | |
sla@2675 | 291 | class CompilerInterfaceVC10 extends CompilerInterface { |
sla@2675 | 292 | |
sla@2675 | 293 | @Override |
sla@2675 | 294 | Vector getBaseCompilerFlags(Vector defines, Vector includes, String outDir) { |
sla@2675 | 295 | Vector rv = new Vector(); |
sla@2675 | 296 | |
sla@2675 | 297 | addAttr(rv, "AdditionalIncludeDirectories", Util.join(";", includes)); |
sla@2675 | 298 | addAttr(rv, "PreprocessorDefinitions", |
sla@2675 | 299 | Util.join(";", defines).replace("\\\"", "\"")); |
sla@2675 | 300 | addAttr(rv, "PrecompiledHeaderFile", "precompiled.hpp"); |
sla@2675 | 301 | addAttr(rv, "PrecompiledHeaderOutputFile", outDir+Util.sep+"vm.pch"); |
sla@2675 | 302 | addAttr(rv, "AssemblerListingLocation", outDir); |
sla@2675 | 303 | addAttr(rv, "ObjectFileName", outDir+Util.sep); |
sla@2675 | 304 | addAttr(rv, "ProgramDataBaseFileName", outDir+Util.sep+"jvm.pdb"); |
sla@2675 | 305 | // Set /nologo option |
sla@2675 | 306 | addAttr(rv, "SuppressStartupBanner", "true"); |
sla@2675 | 307 | // Surpass the default /Tc or /Tp. |
sla@2675 | 308 | addAttr(rv, "CompileAs", "Default"); |
sla@2675 | 309 | // Set /W3 option. |
sla@2675 | 310 | addAttr(rv, "WarningLevel", "Level3"); |
sla@2675 | 311 | // Set /WX option, |
sla@2675 | 312 | addAttr(rv, "TreatWarningAsError", "true"); |
sla@2675 | 313 | // Set /GS option |
sla@2675 | 314 | addAttr(rv, "BufferSecurityCheck", "false"); |
sla@2675 | 315 | // Set /Zi option. |
sla@2675 | 316 | addAttr(rv, "DebugInformationFormat", "ProgramDatabase"); |
sla@2675 | 317 | // Set /Yu option. |
sla@2675 | 318 | addAttr(rv, "PrecompiledHeader", "Use"); |
sla@2675 | 319 | // Set /EHsc- option |
sla@2675 | 320 | addAttr(rv, "ExceptionHandling", ""); |
sla@2675 | 321 | |
sla@2675 | 322 | addAttr(rv, "MultiProcessorCompilation", "true"); |
sla@2675 | 323 | |
sla@2675 | 324 | return rv; |
sla@2675 | 325 | } |
sla@2675 | 326 | |
sla@2675 | 327 | @Override |
sla@2675 | 328 | Vector getDebugCompilerFlags(String opt) { |
sla@2675 | 329 | Vector rv = new Vector(); |
sla@2675 | 330 | |
sla@2675 | 331 | // Set /On option |
sla@2675 | 332 | addAttr(rv, "Optimization", opt); |
sla@2675 | 333 | // Set /FR option. |
sla@2675 | 334 | addAttr(rv, "BrowseInformation", "true"); |
sla@2675 | 335 | addAttr(rv, "BrowseInformationFile", "$(IntDir)"); |
sla@2675 | 336 | // Set /MD option. |
sla@2675 | 337 | addAttr(rv, "RuntimeLibrary", "MultiThreadedDLL"); |
sla@2675 | 338 | // Set /Oy- option |
sla@2675 | 339 | addAttr(rv, "OmitFramePointers", "false"); |
sla@2675 | 340 | |
sla@2675 | 341 | return rv; |
sla@2675 | 342 | } |
sla@2675 | 343 | |
sla@2675 | 344 | @Override |
sla@2675 | 345 | Vector getProductCompilerFlags() { |
sla@2675 | 346 | Vector rv = new Vector(); |
sla@2675 | 347 | |
sla@2675 | 348 | // Set /O2 option. |
sla@2675 | 349 | addAttr(rv, "Optimization", "MaxSpeed"); |
sla@2675 | 350 | // Set /Oy- option |
sla@2675 | 351 | addAttr(rv, "OmitFramePointers", "false"); |
sla@2675 | 352 | // Set /Ob option. 1 is expandOnlyInline |
sla@2675 | 353 | addAttr(rv, "InlineFunctionExpansion", "OnlyExplicitInline"); |
sla@2675 | 354 | // Set /GF option. |
sla@2675 | 355 | addAttr(rv, "StringPooling", "true"); |
sla@2675 | 356 | // Set /MD option. 2 is rtMultiThreadedDLL |
sla@2675 | 357 | addAttr(rv, "RuntimeLibrary", "MultiThreadedDLL"); |
sla@2675 | 358 | // Set /Gy option |
sla@2675 | 359 | addAttr(rv, "FunctionLevelLinking", "true"); |
sla@2675 | 360 | |
sla@2675 | 361 | return rv; |
sla@2675 | 362 | } |
sla@2675 | 363 | |
sla@2675 | 364 | @Override |
sla@2675 | 365 | Vector getBaseLinkerFlags(String outDir, String outDll, String platformName) { |
sla@2675 | 366 | Vector rv = new Vector(); |
sla@2675 | 367 | |
sla@2675 | 368 | addAttr(rv, "AdditionalOptions", |
sla@2675 | 369 | "/export:JNI_GetDefaultJavaVMInitArgs " + |
sla@2675 | 370 | "/export:JNI_CreateJavaVM " + |
sla@2675 | 371 | "/export:JVM_FindClassFromBootLoader "+ |
sla@2675 | 372 | "/export:JNI_GetCreatedJavaVMs "+ |
sla@2675 | 373 | "/export:jio_snprintf /export:jio_printf "+ |
sla@2675 | 374 | "/export:jio_fprintf /export:jio_vfprintf "+ |
sla@2675 | 375 | "/export:jio_vsnprintf "+ |
sla@2675 | 376 | "/export:JVM_GetVersionInfo "+ |
sla@2675 | 377 | "/export:JVM_GetThreadStateNames "+ |
sla@2675 | 378 | "/export:JVM_GetThreadStateValues "+ |
sla@2675 | 379 | "/export:JVM_InitAgentProperties"); |
brutisso@3069 | 380 | addAttr(rv, "AdditionalDependencies", "kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;Wsock32.lib;winmm.lib;psapi.lib"); |
sla@2675 | 381 | addAttr(rv, "OutputFile", outDll); |
sla@2675 | 382 | addAttr(rv, "SuppressStartupBanner", "true"); |
sla@2675 | 383 | addAttr(rv, "ModuleDefinitionFile", outDir+Util.sep+"vm.def"); |
sla@2675 | 384 | addAttr(rv, "ProgramDatabaseFile", outDir+Util.sep+"jvm.pdb"); |
sla@2675 | 385 | addAttr(rv, "SubSystem", "Windows"); |
sla@2675 | 386 | addAttr(rv, "BaseAddress", "0x8000000"); |
sla@2675 | 387 | addAttr(rv, "ImportLibrary", outDir+Util.sep+"jvm.lib"); |
sla@2675 | 388 | |
sla@2675 | 389 | if(platformName.equals("Win32")) { |
sla@2675 | 390 | addAttr(rv, "TargetMachine", "MachineX86"); |
sla@2675 | 391 | } else { |
sla@2675 | 392 | addAttr(rv, "TargetMachine", "MachineX64"); |
sla@2675 | 393 | } |
sla@2675 | 394 | |
brutisso@2757 | 395 | // We always want the /DEBUG option to get full symbol information in the pdb files |
brutisso@2757 | 396 | addAttr(rv, "GenerateDebugInformation", "true"); |
brutisso@2757 | 397 | |
sla@2675 | 398 | return rv; |
sla@2675 | 399 | } |
sla@2675 | 400 | |
sla@2675 | 401 | @Override |
sla@2675 | 402 | Vector getDebugLinkerFlags() { |
sla@2675 | 403 | Vector rv = new Vector(); |
sla@2675 | 404 | |
brutisso@2757 | 405 | // Empty now that /DEBUG option is used by all configs |
sla@2675 | 406 | |
sla@2675 | 407 | return rv; |
sla@2675 | 408 | } |
sla@2675 | 409 | |
sla@2675 | 410 | @Override |
sla@2675 | 411 | Vector getProductLinkerFlags() { |
sla@2675 | 412 | Vector rv = new Vector(); |
sla@2675 | 413 | |
sla@2675 | 414 | // Set /OPT:REF option. |
sla@2675 | 415 | addAttr(rv, "OptimizeReferences", "true"); |
sla@2675 | 416 | // Set /OPT:ICF option. |
sla@2675 | 417 | addAttr(rv, "EnableCOMDATFolding", "true"); |
sla@2675 | 418 | |
sla@2675 | 419 | return rv; |
sla@2675 | 420 | } |
sla@2675 | 421 | |
sla@2675 | 422 | @Override |
sla@2675 | 423 | void getAdditionalNonKernelLinkerFlags(Vector rv) { |
sla@2675 | 424 | extAttr(rv, "AdditionalOptions", " /export:AsyncGetCallTrace"); |
sla@2675 | 425 | } |
sla@2675 | 426 | |
sla@2675 | 427 | @Override |
sla@2675 | 428 | String getOptFlag() { |
sla@2675 | 429 | return "MaxSpeed"; |
sla@2675 | 430 | } |
sla@2675 | 431 | |
sla@2675 | 432 | @Override |
sla@2675 | 433 | String getNoOptFlag() { |
sla@2675 | 434 | return "Disabled"; |
sla@2675 | 435 | } |
sla@2675 | 436 | |
sla@2675 | 437 | @Override |
sla@2675 | 438 | String makeCfgName(String flavourBuild, String platform) { |
sla@2675 | 439 | return flavourBuild + "|" + platform; |
sla@2675 | 440 | } |
sla@2675 | 441 | |
sla@2675 | 442 | } |