summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaikari <[email protected]>2025-10-04 17:02:24 +0300
committerGitHub <[email protected]>2025-10-04 17:02:24 +0300
commit0e69ae2a09410080ee90c053b5e46741020ea958 (patch)
tree2c040099641d11924bf283e741a0371bbefae7c6
parent05525e2450c8af5344bd1ace78d4b532955de76c (diff)
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..6293cfb39 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("wasm") then
+ target_ptrbytes = target:is_arch("armeabi", "armeabi-v7a", "x86", "mips", "i386", "armv7", "armv7s", "mipsel", "wasm32") and "4" or "8"
+ else
+ target_ptrbytes = target:check_sizeof("void*")
+ 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