Skip to content

Commit 230079e

Browse files
David Schaefertritao
authored andcommitted
fixes #1191 CppSharp.CLI.exe --rtti sets -fno-rtti to clang
The problem being fixed is that although --rtti is given as argument to CppSharp.CLI.exe the runtime type information is turned off. The error is happening because the Generator options are copied over to the parserOptions after the parserOptions have been used to generate the cmake call. Thus, the default value of RTTI (off) is always evaluated and cmake will always get the parameter -fno-rtti. The same issue seems to apply to the unity build. This patch fixes the issue by moving the 2 assignments of Generator options properties into ParserOptions properties before they are evaluated in parserOptions.Setup();
1 parent 4dcbff3 commit 230079e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/CLI/Generator.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,9 @@ public void Setup(Driver driver)
152152
if (abi == CppAbi.Microsoft)
153153
parserOptions.MicrosoftMode = true;
154154

155+
parserOptions.UnityBuild = options.UnityBuild;
156+
parserOptions.EnableRTTI = options.EnableRTTI;
157+
155158
parserOptions.Setup();
156159

157160
if (triple.Contains("linux"))
@@ -174,9 +177,6 @@ public void Setup(Driver driver)
174177
parserOptions.AddDefines(d.Key + "=" + d.Value);
175178
}
176179

177-
parserOptions.UnityBuild = options.UnityBuild;
178-
parserOptions.EnableRTTI = options.EnableRTTI;
179-
180180
if (options.EnableExceptions)
181181
parserOptions.AddArguments("-fcxx-exceptions");
182182

0 commit comments

Comments
 (0)