diff options
| author | ruki <[email protected]> | 2022-03-17 22:55:11 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-03-17 22:55:11 +0800 |
| commit | f6f371ae572e8076fee71006622598b33b14f11e (patch) | |
| tree | 515ea20fe27f297cc6369e3b42334bf71bfa9abc /xmake/modules/package/tools/cmake.lua | |
| parent | 002b55ba40bfbf1e166b019e2760aa8f6cf74f2e (diff) | |
update tools.cmake
Diffstat (limited to 'xmake/modules/package/tools/cmake.lua')
| -rw-r--r-- | xmake/modules/package/tools/cmake.lua | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/xmake/modules/package/tools/cmake.lua b/xmake/modules/package/tools/cmake.lua index a97402f94..39f1e25f8 100644 --- a/xmake/modules/package/tools/cmake.lua +++ b/xmake/modules/package/tools/cmake.lua @@ -417,7 +417,11 @@ function _get_configs_for_cross(package, configs, opt) envs.CMAKE_STATIC_LINKER_FLAGS = table.concat(table.wrap(package:build_getenv("arflags")), ' ') envs.CMAKE_EXE_LINKER_FLAGS = _get_ldflags(package, opt) envs.CMAKE_SHARED_LINKER_FLAGS = _get_shflags(package, opt) - envs.CMAKE_SYSTEM_NAME = "Linux" + -- 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" + end -- avoid find and add system include/library path -- @see https://github.com/xmake-io/xmake/issues/2037 envs.CMAKE_FIND_ROOT_PATH = sdkdir |
