summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2025-10-05 17:03:18 +0800
committerGitHub <[email protected]>2025-10-05 17:03:18 +0800
commit1b65f0f4ad2a9a1b091603c7d85518724a7c995f (patch)
tree57e06a2e8cdbd14d35e2670f61e5fbe75af88899
parent6ffb08da4ee35ccc5914fbec6f96158e6e033692 (diff)
parentb5981bc08e2040200efa07ae4dbe1c733af64f76 (diff)
Merge pull request #6890 from luadebug/fix-sizeof-wasm
Update cmake_importfiles.lua
-rw-r--r--xmake/modules/target/action/install/cmake_importfiles.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/xmake/modules/target/action/install/cmake_importfiles.lua b/xmake/modules/target/action/install/cmake_importfiles.lua
index 6b3d97546..b37729547 100644
--- a/xmake/modules/target/action/install/cmake_importfiles.lua
+++ b/xmake/modules/target/action/install/cmake_importfiles.lua
@@ -38,12 +38,18 @@ end
-- get the builtin variables
function _get_builtinvars(target, installdir)
+ local target_ptrbytes
+ if target:is_plat("cross") then
+ target_ptrbytes = target:check_sizeof("void*")
+ else
+ target_ptrbytes = target:is_arch64() and "8" or "4"
+ end
return {TARGETNAME = target:name(),
PROJECTNAME = project.name() or target:name(),
TARGETFILENAME = target:targetfile() and _get_libfile(target, installdir),
TARGETKIND = target:is_headeronly() and "INTERFACE" or (target:is_shared() and "SHARED" or "STATIC"),
PACKAGE_VERSION = target:get("version") or "1.0.0",
- TARGET_PTRBYTES = target:check_sizeof("void*")}
+ TARGET_PTRBYTES = target_ptrbytes}
end
-- install cmake config file