summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2025-06-18 22:36:29 +0800
committerruki <[email protected]>2025-06-18 22:36:29 +0800
commitf4228e1f0aa810412c97ca4ac5a77df3590e2431 (patch)
tree932cd6ce12b2b7ed0998da9f4afdf49f9d6faafd
parent9afa83aafc6b4183f7f30f026ec2daacaf369d18 (diff)
fix emcc profile
-rw-r--r--xmake/modules/package/manager/conan/find_package.lua2
-rw-r--r--xmake/modules/package/manager/conan/v2/install_package.lua10
2 files changed, 8 insertions, 4 deletions
diff --git a/xmake/modules/package/manager/conan/find_package.lua b/xmake/modules/package/manager/conan/find_package.lua
index dd714f365..12f8973de 100644
--- a/xmake/modules/package/manager/conan/find_package.lua
+++ b/xmake/modules/package/manager/conan/find_package.lua
@@ -47,7 +47,6 @@ end
function _conan_get_buildinfo(name, opt)
opt = opt or {}
local buildinfo_file = _conan_get_buildinfo_file(name, opt.dep_name)
- print("buildinfo_file", buildinfo_file)
if not os.isfile(buildinfo_file) then
return
end
@@ -58,7 +57,6 @@ function _conan_get_buildinfo(name, opt)
return
end
local buildinfo = io.load(buildinfo_file)
- print("buildinfo", buildinfo)
if buildinfo then
buildinfo = buildinfo[infokey]
end
diff --git a/xmake/modules/package/manager/conan/v2/install_package.lua b/xmake/modules/package/manager/conan/v2/install_package.lua
index ba2a8f021..f98c77c51 100644
--- a/xmake/modules/package/manager/conan/v2/install_package.lua
+++ b/xmake/modules/package/manager/conan/v2/install_package.lua
@@ -199,9 +199,15 @@ function _conan_generate_compiler_profile(profile, configs, opt)
local emscripten_cmakefile = find_file("Emscripten.cmake", path.join(emsdk.emscripten, "cmake/Modules/Platform"))
assert(emscripten_cmakefile, "Emscripten.cmake not found!")
+ profile:print("compiler=clang")
+ local version = _conan_get_compiler_version("clang")
+ if version then
+ profile:print("compiler.version=" .. version)
+ end
+
conf = {}
- conf["tools.build:compiler_executables"] = "{'c':'emcc', 'cpp':'em++'}"
- conf["tools.cmake.cmaketoolchain:user_toolchain"] = "[" ..emscripten_cmakefile .. "]"
+ conf["tools.build:compiler_executables"] = "{'c':'emcc', 'cpp':'em++', 'ar':'emar', 'ranlib':'emranlib'}"
+ conf["tools.cmake.cmaketoolchain:user_toolchain"] = "['" ..emscripten_cmakefile .. "']"
else
local program, toolname = platform.tool("cc", plat, arch)
if toolname == "gcc" or toolname == "clang" then