Skip to content

gh-96254: Add new wasm build target and support a pkg_config_path #96252

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

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ PCbuild/win32/
Tools/unicode/data/
/autom4te.cache
/build/
/builddir/
/config.cache
/config.log
/config.status
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add support for a pthread and dynamic link version of the emscripten node build
17 changes: 17 additions & 0 deletions Tools/wasm/wasm_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ class BuildProfile:
dynamic_linking: Union[bool, None] = None
pthreads: Union[bool, None] = None
testopts: str = "-j2"
pkg_config_path: Union[str, None] = None

@property
def can_execute(self) -> bool:
Expand Down Expand Up @@ -361,6 +362,9 @@ def configure_cmd(self) -> List[str]:
if platform.config_site is not None:
cmd.append(f"CONFIG_SITE={platform.config_site}")

if self.pkg_config_path is not None:
cmd.append(f"PKG_CONFIG_PATH={self.pkg_config_path}")

return cmd

@property
Expand Down Expand Up @@ -483,6 +487,13 @@ def clean(self, all: bool = False):
target=EmscriptenTarget.node,
pthreads=True,
),
BuildProfile(
"emscripten-node-pthreads-dl",
host=Host.wasm32_emscripten,
target=EmscriptenTarget.node,
pthreads=True,
dynamic_linking=True
),
BuildProfile(
"emscripten-node-pthreads-debug",
host=Host.wasm32_emscripten,
Expand Down Expand Up @@ -541,6 +552,11 @@ def clean(self, all: bool = False):
nargs="?",
)

parser.add_argument(
"--pkg-config-path",
help="PKG_CONFIG_PATH value to pass to configure"
)


def main():
args = parser.parse_args()
Expand All @@ -550,6 +566,7 @@ def main():
parser.exit(0)

builder = PROFILES[args.platform]
builder.pkg_config_path = args.pkg_config_path
try:
builder.host.platform.check()
except ConditionError as e:
Expand Down