summaryrefslogtreecommitdiff
path: root/xmake/modules/package/tools/cmake.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2024-01-15 22:33:15 +0800
committerruki <[email protected]>2024-01-15 22:33:15 +0800
commit45f0750451087954ca4d649192d593341dd809f9 (patch)
tree05d00ead354c59b1bdc0d5d2654b8400e9889435 /xmake/modules/package/tools/cmake.lua
parent92bca5156bfb9f177a249031ac98f843f6958c0c (diff)
fix find libs from macos/arm64
Diffstat (limited to 'xmake/modules/package/tools/cmake.lua')
-rw-r--r--xmake/modules/package/tools/cmake.lua9
1 files changed, 7 insertions, 2 deletions
diff --git a/xmake/modules/package/tools/cmake.lua b/xmake/modules/package/tools/cmake.lua
index 77511735b..179db1e00 100644
--- a/xmake/modules/package/tools/cmake.lua
+++ b/xmake/modules/package/tools/cmake.lua
@@ -435,6 +435,11 @@ function _get_configs_for_appleos(package, configs, opt)
envs.CMAKE_FIND_ROOT_PATH_MODE_PROGRAM = "NEVER"
-- avoid install bundle targets
envs.CMAKE_MACOSX_BUNDLE = "NO"
+ -- avoids finding host include/library path
+ if package:is_cross() then
+ envs.CMAKE_FIND_USE_CMAKE_SYSTEM_PATH = "0"
+ envs.CMAKE_FIND_USE_INSTALL_PREFIX = "0"
+ end
_insert_configs_from_envs(configs, envs, opt)
end
@@ -558,9 +563,9 @@ function _get_configs_for_cross(package, configs, opt)
envs.CMAKE_FIND_ROOT_PATH_MODE_PROGRAM = "NEVER"
-- avoid add -isysroot on macOS
envs.CMAKE_OSX_SYSROOT = ""
- -- Avoid cmake to add the flags -search_paths_first and -headerpad_max_install_names on macOS
+ -- avoid cmake to add the flags -search_paths_first and -headerpad_max_install_names on macOS
envs.HAVE_FLAG_SEARCH_PATHS_FIRST = "0"
- -- Avoids finding host include/library path
+ -- avoids finding host include/library path
envs.CMAKE_FIND_USE_CMAKE_SYSTEM_PATH = "0"
envs.CMAKE_FIND_USE_INSTALL_PREFIX = "0"
_insert_configs_from_envs(configs, envs, opt)