From 7d18274bb0b10b0f89a0762cd98d72650f5d7036 Mon Sep 17 00:00:00 2001 From: ruki Date: Wed, 9 Dec 2020 00:55:07 +0800 Subject: support ios simulator for cmake/tools --- xmake/modules/package/tools/cmake.lua | 11 +++++++++-- 1 file 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" -- cgit v1.3.1