diff options
| author | star9029 <[email protected]> | 2024-09-06 21:05:29 +0800 |
|---|---|---|
| committer | star9029 <[email protected]> | 2024-09-06 21:05:29 +0800 |
| commit | 125c24a7fc6eecfdb1221a823d534472b1bdceca (patch) | |
| tree | 399dc8805f7d1aa1e5e106196a9131c3e2097ab5 | |
| parent | 79e282463c92e3ecd9229a647d8072eb3b5fdc05 (diff) | |
Fix cmake find_package on wasm
| -rw-r--r-- | xmake/modules/package/tools/cmake.lua | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/xmake/modules/package/tools/cmake.lua b/xmake/modules/package/tools/cmake.lua index 8e103959d..dac716560 100644 --- a/xmake/modules/package/tools/cmake.lua +++ b/xmake/modules/package/tools/cmake.lua @@ -610,7 +610,18 @@ function _get_configs_for_wasm(package, configs, opt) end end end + + local envs = {} + local deps_installdir = {} + for _, dep in ipairs(package:librarydeps({private = true})) do + if not dep:is_system() then + table.insert(deps_installdir, dep:installdir()) + end + end + -- https://github.com/emscripten-core/emscripten/issues/13310 + envs.CMAKE_FIND_ROOT_PATH = path.joinenv(deps_installdir) _get_configs_for_generic(package, configs, opt) + _insert_configs_from_envs(configs, envs, opt) end -- get configs for cross |
