summaryrefslogtreecommitdiff
path: root/xmake/modules/package/tools/cmake.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2024-09-06 23:01:42 +0800
committerGitHub <[email protected]>2024-09-06 23:01:42 +0800
commit3ab8306f221bb7c5cee789044eeafff419b1e15c (patch)
tree2fefe4466ea8c78439858719a6bf788e3300dc89 /xmake/modules/package/tools/cmake.lua
parent6d0d8e066ab4b0e7702476fbbac82f2af70eda61 (diff)
parent125c24a7fc6eecfdb1221a823d534472b1bdceca (diff)
Merge pull request #5578 from star-hengxing/wasm-cmake-find-package
Fix cmake find_package on wasm
Diffstat (limited to 'xmake/modules/package/tools/cmake.lua')
-rw-r--r--xmake/modules/package/tools/cmake.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/xmake/modules/package/tools/cmake.lua b/xmake/modules/package/tools/cmake.lua
index 13907c840..91a5e0559 100644
--- a/xmake/modules/package/tools/cmake.lua
+++ b/xmake/modules/package/tools/cmake.lua
@@ -611,7 +611,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