Skip to content

libvpx: added emcc compiler to support WASM builds - #27880

Merged
jcar87 merged 3 commits into
conan-io:masterfrom
perseoGI:pgi/libvpx/wasm-support
Jun 18, 2026
Merged

libvpx: added emcc compiler to support WASM builds#27880
jcar87 merged 3 commits into
conan-io:masterfrom
perseoGI:pgi/libvpx/wasm-support

Conversation

@perseoGI

@perseoGI perseoGI commented Jul 8, 2025

Copy link
Copy Markdown
Contributor

Summary

Changes to recipe: libvpx

Motivation

Described in #9865, with the purpose of cross compiling ffmpeg to Web Assembly, some recipe dependencies require some extra modifications.

Details

In the case of libvpx, the _target_name to be used on the Autotools configure script was not being set correctly.
Following a Google Discussion, and a fork of libvpx, using generic-gnu as target architecture is the way to go with this library.

To correctly compile this library, as it uses Autotools and we are not directly invoking to emconfigure, emmake, etc.
the environment variables must be set correctly:

CC=emcc
CXX=em++
AR=emar
NM=emnm
RANLIB=emranlib
STRIP=emstrip

In this case to test this recipe, I'm using the packaged emsdk recipe defined in conan-io/conan-toolchains#4.

Logs

[settings]
arch=wasm
build_type=Release
compiler=emcc
compiler.cppstd=17
compiler.libcxx=libc++
compiler.version=4.0.10
os=Emscripten
[tool_requires]
*: ninja/[*], emsdk/4.0.10
[conf]
tools.build:exelinkflags=['-sINITIAL_MEMORY=64MB']
tools.build:sharedlinkflags=['-sINITIAL_MEMORY=64MB']
tools.cmake.cmake_layout:build_folder_vars=['settings.build_type', 'settings.arch']
tools.cmake.cmaketoolchain:generator=Ninja

...

ibvpx/1.14.1 (test package): Running CMake.build()
libvpx/1.14.1 (test package): RUN: cmake --build "/Users/perseo/sources/conan-center-index/recipes/libvpx/all/test_package/build/release-wasm" -- -j14
[2/2] Linking C executable test_package.js


======== Testing the package: Executing test ========
libvpx/1.14.1 (test package): Running test()
$ node recipes/libvpx/all/test_package/build/release-wasm/test_package             
vpx version v1.14.

EDIT: This PR aims to use the same configuration (generic-gnu) than the build script used in ffmpeg.wasm
https://github.com/ffmpegwasm/ffmpeg.wasm/blob/main/build/libvpx.sh

AbrilRBS
AbrilRBS previously approved these changes Jun 18, 2026

@AbrilRBS AbrilRBS left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The provided logs show this working correctly now, good job! :)

Comment thread recipes/libvpx/all/conanfile.py Outdated
Co-authored-by: Francisco Ramírez <franchuti688@gmail.com>
@perseoGI

Copy link
Copy Markdown
Contributor Author

Adding compilation log traces with a wasm profile and a custom cmd_wrapper which redirects the output artifact to node:
libvpx-wasm.txt

@jcar87
jcar87 merged commit c39cc1f into conan-io:master Jun 18, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants