Skip to content

Conversation

@brainos233
Copy link
Contributor

Emscripten's cmake warpper emcmake won't convert environment EM_PKG_CONFIG_PATH to PKG_CONFIG_PATH, which makes cmake's pkg_check_modules() function can't find dependencies in install dir.

For example, libavif will not find libsharpyuv

Details

build-libavif.web-wasm running in /home/aa/Builds/renpy-build/tmp/build/libavif.web-wasm ...
configure: cmake -G Ninja -DCMAKE_FIND_ROOT_PATH=/home/aa/Builds/renpy-build/tmp/install.web-wasm -DCMAKE_SYSTEM_NAME=Emscripten -DCMAKE_SYSTEM_PROCESSOR=generic -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ONLY -DCMAKE_PROJECT_INCLUDE_BEFORE=/home/aa/Builds/renpy-build/tools/cmake_build_variables.cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_BUILD_PARALLEL_LEVEL=12 -DCMAKE_INSTALL_PREFIX=/home/aa/Builds/renpy-build/tmp/install.web-wasm -DAVIF_CODEC_AOM=1 -DAVIF_CODEC_AOM_ENCODE=0 -DBUILD_SHARED_LIBS=0 /home/aa/Builds/renpy-build/tmp/source/libavif -DCMAKE_TOOLCHAIN_FILE=/home/aa/Builds/renpy-build/tmp/cross.web-wasm/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -DCMAKE_CROSSCOMPILING_EMULATOR=/home/aa/Builds/renpy-build/tmp/cross.web-wasm/node/22.16.0_64bit/bin/node
-- libavif: Enabling warnings for Clang
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Checking for module 'libyuv'
--   Package 'libyuv', required by 'virtual:world', not found
-- libavif: libyuv (1878) found; libyuv-based fast paths enabled.
-- Checking for module 'libsharpyuv'
--   Package 'libsharpyuv', required by 'virtual:world', not found
-- libavif: libsharpyuv not found

This PR's solution is using emmake to warp pkg-config, so environments like EM_PKG_CONFIG_PATH could work correctly in cmake. This is the recommended method by Emscripten.

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.

1 participant