summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2024-09-11 23:11:13 +0800
committerruki <[email protected]>2024-09-11 23:11:13 +0800
commit25e1d8ace98008b51772abefe49c8e533c9e04b2 (patch)
tree01699edd38e81f12ef715dacbf1547a2b5a4da8a
parent9e70298e25cde32fdde0cae65f4977a096eabfa7 (diff)
improve tools.cmake for wasm
-rw-r--r--xmake/modules/package/tools/cmake.lua18
1 files changed, 7 insertions, 11 deletions
diff --git a/xmake/modules/package/tools/cmake.lua b/xmake/modules/package/tools/cmake.lua
index 91a5e0559..543d402e1 100644
--- a/xmake/modules/package/tools/cmake.lua
+++ b/xmake/modules/package/tools/cmake.lua
@@ -612,17 +612,13 @@ function _get_configs_for_wasm(package, configs, opt)
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)
+ -- avoid find and add system include/library path
+ -- @see https://github.com/xmake-io/xmake/issues/2037
+ -- https://github.com/xmake-io/xmake/issues/5577
+ table.insert(configs, "-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=BOTH")
+ table.insert(configs, "-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=BOTH")
+ table.insert(configs, "-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH")
+ table.insert(configs, "-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER")
end
-- get configs for cross