summaryrefslogtreecommitdiff
path: root/xmake/modules/package/tools/cmake.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2020-12-09 00:55:07 +0800
committerruki <[email protected]>2020-12-09 00:55:07 +0800
commit7d18274bb0b10b0f89a0762cd98d72650f5d7036 (patch)
treed5f226039b7ed0f80488323ee836c08562228c45 /xmake/modules/package/tools/cmake.lua
parent80a93c8d1a79ceaceee3ac8bf9525c8a1bdb757f (diff)
support ios simulator for cmake/tools
Diffstat (limited to 'xmake/modules/package/tools/cmake.lua')
-rw-r--r--xmake/modules/package/tools/cmake.lua11
1 files changed, 9 insertions, 2 deletions
diff --git a/xmake/modules/package/tools/cmake.lua b/xmake/modules/package/tools/cmake.lua
index 41dae509b..da8a25761 100644
--- a/xmake/modules/package/tools/cmake.lua
+++ b/xmake/modules/package/tools/cmake.lua
@@ -216,10 +216,17 @@ function _get_configs_for_appleos(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)
+ -- https://cmake.org/cmake/help/v3.17/manual/cmake-toolchains.7.html#id25
if package:is_plat("watchos") then
- envs.CMAKE_SYSTEM_NAME = "watchOS"
+ envs.CMAKE_SYSTEM_NAME = "watchOS"
+ if package:is_arch("x86_64", "i386") then
+ envs.CMAKE_OSX_SYSROOT = "watchsimulator"
+ end
else
- envs.CMAKE_SYSTEM_NAME = "iOS"
+ envs.CMAKE_SYSTEM_NAME = "iOS"
+ if package:is_arch("x86_64", "i386") then
+ envs.CMAKE_OSX_SYSROOT = "iphonesimulator"
+ end
end
envs.CMAKE_FIND_ROOT_PATH_MODE_LIBRARY = "ONLY"
envs.CMAKE_FIND_ROOT_PATH_MODE_INCLUDE = "ONLY"