Skip to content

Commit 4e3c1f8

Browse files
committed
Make sure that some versions can compile the cpp files
1 parent bbf0ae4 commit 4e3c1f8

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Packages/webxr/Editor/WebXRBuildProcessor.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,18 @@ public void OnPreprocessBuild(BuildReport report)
4444
// dirty later builds with assets that may not be needed or are out of date.
4545
CleanOldSettings();
4646

47+
if (report.summary.platform != BuildTarget.WebGL)
48+
{
49+
return;
50+
}
51+
52+
#if UNITY_2020_3 || UNITY_2021_1
53+
if (!PlayerSettings.WebGL.emscriptenArgs.Contains("-std="))
54+
{
55+
PlayerSettings.WebGL.emscriptenArgs += " -std=c++11";
56+
}
57+
#endif
58+
4759
WebXRSettings settings = null;
4860
EditorBuildSettings.TryGetConfigObject<WebXRSettings>("WebXR.Settings", out settings);
4961
if (settings == null)

0 commit comments

Comments
 (0)