summaryrefslogtreecommitdiff
path: root/xmake/modules/package/tools
diff options
context:
space:
mode:
authorruki <[email protected]>2020-09-07 23:11:23 +0800
committerruki <[email protected]>2020-09-07 23:11:23 +0800
commita60e3691be27ed3f5a0d7651f7b720b7e75b7031 (patch)
treea7c40369f4c0ef8ac132fa351634ff6ce2a09620 /xmake/modules/package/tools
parent84085d03b29fcb17ef93f6e8e367b21488904f6e (diff)
support ios for trybuild/cmake
Diffstat (limited to 'xmake/modules/package/tools')
-rw-r--r--xmake/modules/package/tools/cmake.lua15
1 files changed, 11 insertions, 4 deletions
diff --git a/xmake/modules/package/tools/cmake.lua b/xmake/modules/package/tools/cmake.lua
index 81df10d5d..28a767ad3 100644
--- a/xmake/modules/package/tools/cmake.lua
+++ b/xmake/modules/package/tools/cmake.lua
@@ -58,8 +58,8 @@ function _get_configs_for_android(package, configs)
end
end
--- get configs for iphoneos
-function _get_configs_for_iphoneos(package, configs)
+-- get configs for appleos
+function _get_configs_for_appleos(package, configs)
local envs = {}
local cflags = table.join(table.wrap(package:build_getenv("cxflags")), package:build_getenv("cflags"))
local cxxflags = table.join(table.wrap(package:build_getenv("cxflags")), package:build_getenv("cxxflags"))
@@ -69,9 +69,16 @@ function _get_configs_for_iphoneos(package, configs)
envs.CMAKE_STATIC_LINKER_FLAGS = table.concat(table.wrap(package:build_getenv("arflags")), ' ')
envs.CMAKE_EXE_LINKER_FLAGS = table.concat(table.wrap(package:build_getenv("ldflags")), ' ')
envs.CMAKE_SHARED_LINKER_FLAGS = table.concat(table.wrap(package:build_getenv("shflags")), ' ')
+ if package:is_plat("watchos") then
+ envs.CMAKE_SYSTEM_NAME = "watchOS"
+ else
+ envs.CMAKE_SYSTEM_NAME = "iOS"
+ end
envs.CMAKE_FIND_ROOT_PATH_MODE_LIBRARY = "ONLY"
envs.CMAKE_FIND_ROOT_PATH_MODE_INCLUDE = "ONLY"
envs.CMAKE_FIND_ROOT_PATH_MODE_PROGRAM = "NEVER"
+ -- avoid install bundle targets
+ envs.CMAKE_MACOSX_BUNDLE = "NO"
for k, v in pairs(envs) do
table.insert(configs, "-D" .. k .. "=" .. v)
end
@@ -152,8 +159,8 @@ function _get_configs(package, configs)
_get_configs_for_windows(package, configs)
elseif package:is_plat("android") then
_get_configs_for_android(package, configs)
- elseif package:is_plat("iphoneos") then
- _get_configs_for_iphoneos(package, configs)
+ elseif package:is_plat("iphoneos", "watchos") then
+ _get_configs_for_appleos(package, configs)
elseif package:is_plat("mingw") then
_get_configs_for_mingw(package, configs)
elseif not package:is_plat(os.subhost()) then