Skip to content

Commit e0072e9

Browse files
committed
Merge pull request godotengine#105800 from adamscott/add-emscripten-include-path
[Web] Include emscripten headers by default
2 parents 88c47c6 + b0e472c commit e0072e9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

platform/web/detect.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import os
22
import sys
3+
from pathlib import Path
34
from typing import TYPE_CHECKING
45

56
from emscripten_helpers import (
@@ -115,6 +116,14 @@ def configure(env: "SConsEnvironment"):
115116
print_error("Initial memory must be a valid integer")
116117
sys.exit(255)
117118

119+
# Add Emscripten to the included paths (for compile_commands.json completion)
120+
emcc_path = Path(str(WhereIs("emcc")))
121+
while emcc_path.is_symlink():
122+
# For some reason, mypy trips on `Path.readlink` not being defined, somehow.
123+
emcc_path = emcc_path.readlink() # type: ignore[attr-defined]
124+
emscripten_include_path = emcc_path.parent.joinpath("cache", "sysroot", "include")
125+
env.Append(CPPPATH=[emscripten_include_path])
126+
118127
## Build type
119128

120129
if env.debug_features:

0 commit comments

Comments
 (0)