Skip to content

[Web] Include emscripten headers by default #105800

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions platform/web/detect.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
import sys
from pathlib import Path
from typing import TYPE_CHECKING

from emscripten_helpers import (
Expand Down Expand Up @@ -110,6 +111,14 @@ def configure(env: "SConsEnvironment"):
print_error("Initial memory must be a valid integer")
sys.exit(255)

## Add Emscripten to the included paths (for compile_commands.json completion)
emcc_path = Path(str(WhereIs("emcc")))
while emcc_path.is_symlink():
# For some reason, mypy trips on `Path.readlink` not being defined, somehow.
emcc_path = emcc_path.readlink() # type: ignore[attr-defined]
emscripten_include_path = emcc_path.parent.joinpath("cache", "sysroot", "include")
env.Append(CPPPATH=[emscripten_include_path])
Comment on lines +114 to +120
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the new logic, in order to include automatically the right headers to the build.


## Build type

if env.debug_features:
Expand Down
Loading