diff options
| author | ruki <[email protected]> | 2025-06-18 00:55:08 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-06-18 00:55:08 +0800 |
| commit | a82f5c1d7a7d43485087341b978749698bfcc6a1 (patch) | |
| tree | d6397ae34175554eda51f8413ec395890b07b694 | |
| parent | a92bcb8f105d6692d0ef7186bd3d8fc9a12d9b88 (diff) | |
pass emsdk config
| -rw-r--r-- | xmake/modules/package/manager/conan/v2/install_package.lua | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/xmake/modules/package/manager/conan/v2/install_package.lua b/xmake/modules/package/manager/conan/v2/install_package.lua index 45faca2eb..ab25307f3 100644 --- a/xmake/modules/package/manager/conan/v2/install_package.lua +++ b/xmake/modules/package/manager/conan/v2/install_package.lua @@ -25,6 +25,8 @@ import("core.project.config") import("core.tool.toolchain") import("core.platform.platform") import("lib.detect.find_tool") +import("lib.detect.find_file") +import("detect.sdks.find_emsdk") import("devel.git") import("net.fasturl") import("package.manager.conan.configurations") @@ -192,8 +194,14 @@ function _conan_generate_compiler_profile(profile, configs, opt) conf = {} conf["tools.android:ndk_path"] = ndk:config("ndk") elseif plat == "wasm" then + local emsdk = find_emsdk() + assert(emsdk and emsdk.emscripten, "emscripten not found!") + local emscripten_cmakefile = find_file("Emscripten.cmake", path.join(emsdk.emscripten, "cmake/Modules/Platform")) + assert(emscripten_cmakefile, "Emscripten.cmake not found!") + conf = {} conf["tools.build:compiler_executables"] = "{'c':'emcc', 'cpp':'em++'}" + conf["tools.cmake.cmaketoolchain:user_toolchain"] = "[" ..emscripten_cmakefile .. "]" else local program, toolname = platform.tool("cc", plat, arch) if toolname == "gcc" or toolname == "clang" then |
