Skip to content

Commit b2b5567

Browse files
committed
Call the parser setup code in CLI and get rid of specific Mac parser setup code.
1 parent 94ef299 commit b2b5567

File tree

1 file changed

+1
-20
lines changed

1 file changed

+1
-20
lines changed

src/CLI/Generator.cs

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,7 @@ public void Setup(Driver driver)
162162
if (abi == CppAbi.Microsoft)
163163
parserOptions.MicrosoftMode = true;
164164

165-
if (triple.Contains("apple"))
166-
SetupMacOptions(parserOptions);
165+
parserOptions.Setup();
167166

168167
if (triple.Contains("linux"))
169168
SetupLinuxOptions(parserOptions);
@@ -204,24 +203,6 @@ private void SetupLinuxOptions(ParserOptions parserOptions)
204203
parserOptions.AddDefines("_GLIBCXX_USE_CXX11_ABI=" + (options.Cpp11ABI ? "1" : "0"));
205204
}
206205

207-
private static void SetupMacOptions(ParserOptions options)
208-
{
209-
options.MicrosoftMode = false;
210-
options.NoBuiltinIncludes = true;
211-
212-
if (Platform.IsMacOS)
213-
{
214-
var headersPaths = new List<string> {
215-
"/usr/include"
216-
};
217-
218-
foreach (var header in headersPaths)
219-
options.AddSystemIncludeDirs(header);
220-
}
221-
222-
options.AddArguments("-stdlib=libc++");
223-
}
224-
225206
public void SetupPasses(Driver driver)
226207
{
227208
driver.Context.TranslationUnitPasses.AddPass(new FunctionToInstanceMethodPass());

0 commit comments

Comments
 (0)