summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2023-06-12 23:42:40 +0800
committerGitHub <[email protected]>2023-06-12 23:42:40 +0800
commitc0343e58792f98e5b317d8229972a145cdaada55 (patch)
treec5c44c4fc5051a8097415ff741a51ddd952a6405
parent2018f5b4c66b89a72c02fd771433a1ce07090dea (diff)
parent79b129cc47859d3bc7439e40577f667b700e673a (diff)
Merge pull request #3834 from Arthapz/cmake-cross-system-name
allow custom system name when cross compiling
-rw-r--r--xmake/modules/package/tools/cmake.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/xmake/modules/package/tools/cmake.lua b/xmake/modules/package/tools/cmake.lua
index b3d669c51..003bc0acd 100644
--- a/xmake/modules/package/tools/cmake.lua
+++ b/xmake/modules/package/tools/cmake.lua
@@ -512,7 +512,7 @@ function _get_configs_for_cross(package, configs, opt)
-- we need not set it as cross compilation if we just pass toolchain
-- https://github.com/xmake-io/xmake/issues/2170
if not package:is_plat(os.subhost()) then
- envs.CMAKE_SYSTEM_NAME = "Linux"
+ envs.CMAKE_SYSTEM_NAME = package:targetos() or "Linux"
else
if package:config("pic") ~= false then
table.insert(configs, "-DCMAKE_POSITION_INDEPENDENT_CODE=ON")