Skip to content

Commit 8431c75

Browse files
committed
[SharpGen] Execute CastXML instead of gccxml
1 parent 4e415de commit 8431c75

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

Source/Tools/SharpGen/Parser/GccXml.cs

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -175,13 +175,10 @@ public void Preprocess(string headerFile, DataReceivedEventHandler handler)
175175
WorkingDirectory = Environment.CurrentDirectory
176176
};
177177

178-
File.WriteAllText(GccXmlGccOptionsFile, "-dDI -E");
178+
var arguments = "";
179+
arguments += " --castxml-gccxml";
180+
arguments += " -x c++ -std=c++11 -E -dD";
179181

180-
var arguments = ""; // "--gccxml-gcc-options " + GccXmlGccOptionsFile;
181-
// Overrides settings for gccxml for compiling Win8 version
182-
arguments += " --gccxml-config \"" + Path.Combine(Path.GetDirectoryName(ExecutablePath), @"..\share\gccxml-0.9\vc" + vsVersion + @"\gccxml_config") + "\"";
183-
184-
arguments += " -E --gccxml-gcc-options " + GccXmlGccOptionsFile;
185182
foreach (var directory in GetIncludePaths())
186183
arguments += " " + directory;
187184

@@ -260,7 +257,7 @@ private List<string> GetIncludePaths()
260257

261258
if (directory.IsOverride)
262259
{
263-
paths.Add("-iwrapper\"" + path.TrimEnd('\\') + "\"");
260+
paths.Add("-I\"" + path.TrimEnd('\\') + "\"");
264261
}
265262
else
266263
{
@@ -371,12 +368,11 @@ public StreamReader Process(string headerFile)
371368
// Delete any previously generated xml file
372369
File.Delete(xmlFile);
373370

374-
var arguments = ""; // "--gccxml-gcc-options " + GccXmlGccOptionsFile;
375-
376-
// Overrides settings for gccxml for compiling Win8 version
377-
arguments += " --gccxml-config \"" + Path.Combine(Path.GetDirectoryName(ExecutablePath), @"..\share\gccxml-0.9\vc" + vsVersion + @"\gccxml_config") + "\"";
371+
var arguments = "";
372+
arguments += " --castxml-gccxml";
373+
arguments += " -x c++ -std=c++11 -fmsc-version=1800 -fms-extensions -fms-compatibility -Wno-microsoft-enum-value -Wno-macro-redefined";
374+
arguments += " -o " + xmlFile;
378375

379-
arguments += " -fxml=" + xmlFile;
380376
foreach (var directory in GetIncludePaths())
381377
arguments += " " + directory;
382378

Source/Tools/SharpGen/RunGenerator.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ setlocal
44
pushd "%~dp0\Bin\%1"
55
ECHO "%~dp0msdndoc.zip"
66
xcopy /D /Y "%~dp0MSDNDoc.zip" .
7-
SharpGen.exe --doc --gccxml ..\..\..\..\..\External\gccxml\bin\gccxml.exe ..\..\..\..\Mapping.xml
7+
SharpGen.exe --doc --gccxml ..\..\..\..\..\External\castxml\bin\castxml.exe ..\..\..\..\Mapping.xml
88
set LOCALERROR = %ERRORLEVEL%
99
xcopy /D /Y MSDNDoc.zip %~dp0
1010
exit /B %LOCALERROR%

0 commit comments

Comments
 (0)