diff options
| author | ruki <[email protected]> | 2020-09-07 23:11:23 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-09-07 23:11:23 +0800 |
| commit | a60e3691be27ed3f5a0d7651f7b720b7e75b7031 (patch) | |
| tree | a7c40369f4c0ef8ac132fa351634ff6ce2a09620 /xmake/modules/package | |
| parent | 84085d03b29fcb17ef93f6e8e367b21488904f6e (diff) | |
support ios for trybuild/cmake
Diffstat (limited to 'xmake/modules/package')
| -rw-r--r-- | xmake/modules/package/tools/cmake.lua | 15 |
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 |
