diff options
| author | ruki <[email protected]> | 2020-12-16 00:45:51 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-12-16 00:45:51 +0800 |
| commit | b3d4c235f88fb14f0aa42c2704727a104ab33fd2 (patch) | |
| tree | 16583126000d6b88da0b1eaf1294a4aba692f72f /xmake/rules/xcode | |
| parent | dcdd8e5712a863fe225539a09671a7a6a73d60b6 (diff) | |
improve toolchain for xcode
Diffstat (limited to 'xmake/rules/xcode')
| -rw-r--r-- | xmake/rules/xcode/info_plist/xmake.lua | 8 | ||||
| -rw-r--r-- | xmake/rules/xcode/storyboard/xmake.lua | 13 | ||||
| -rw-r--r-- | xmake/rules/xcode/xcassets/xmake.lua | 13 |
3 files changed, 23 insertions, 11 deletions
diff --git a/xmake/rules/xcode/info_plist/xmake.lua b/xmake/rules/xcode/info_plist/xmake.lua index 5b36277d4..9d8d47731 100644 --- a/xmake/rules/xcode/info_plist/xmake.lua +++ b/xmake/rules/xcode/info_plist/xmake.lua @@ -31,6 +31,7 @@ rule("xcode.info_plist") import("core.base.option") import("core.theme.theme") import("core.project.depend") + import("core.tool.toolchain") import("private.utils.progress") -- check @@ -60,8 +61,13 @@ rule("xcode.info_plist") PRODUCT_NAME = target:name(), PRODUCT_DISPLAY_NAME = target:name(), CURRENT_PROJECT_VERSION = target:version() and tostring(target:version()) or "1.0", - MACOSX_DEPLOYMENT_TARGET = get_config("target_minver_macosx") } + if target:is_plat("macosx") then + local toolchain_xcode = toolchain.load("xcode", {plat = target:plat(), arch = target:arch()}) + if toolchain_xcode then + maps.MACOSX_DEPLOYMENT_TARGET = toolchain_xcode:config("target_minver") + end + end if target:rule("xcode.bundle") then maps.PRODUCT_BUNDLE_PACKAGE_TYPE = "BNDL" elseif target:rule("xcode.framework") then diff --git a/xmake/rules/xcode/storyboard/xmake.lua b/xmake/rules/xcode/storyboard/xmake.lua index 83b04fbb0..95a9c9aed 100644 --- a/xmake/rules/xcode/storyboard/xmake.lua +++ b/xmake/rules/xcode/storyboard/xmake.lua @@ -31,6 +31,7 @@ rule("xcode.storyboard") import("core.base.option") import("core.theme.theme") import("core.project.depend") + import("core.tool.toolchain") import("private.utils.progress") -- get xcode sdk directory @@ -57,14 +58,16 @@ rule("xcode.storyboard") os.tryrm(base_lproj) -- do compile - local target_minver + local target_minver = nil + local toolchain_xcode = toolchain.load("xcode", {plat = target:plat(), arch = target:arch()}) + if toolchain_xcode then + target_minver = toolchain_xcode:config("target_minver") + end local argv = {"--errors", "--warnings", "--notices", "--auto-activate-custom-fonts", "--output-format", "human-readable-text"} - if is_plat("macosx") then - target_minver = get_config("target_minver_macosx") + if target:is_plat("macosx") then table.insert(argv, "--target-device") table.insert(argv, "mac") - elseif is_plat("iphoneos") then - target_minver = get_config("target_minver_iphoneos") + elseif target:is_plat("iphoneos") then table.insert(argv, "--target-device") table.insert(argv, "iphone") table.insert(argv, "--target-device") diff --git a/xmake/rules/xcode/xcassets/xmake.lua b/xmake/rules/xcode/xcassets/xmake.lua index 5c1912dd4..31c26a56d 100644 --- a/xmake/rules/xcode/xcassets/xmake.lua +++ b/xmake/rules/xcode/xcassets/xmake.lua @@ -31,6 +31,7 @@ rule("xcode.xcassets") import("core.base.option") import("core.theme.theme") import("core.project.depend") + import("core.tool.toolchain") import("private.utils.progress") -- get xcode sdk directory @@ -60,16 +61,18 @@ rule("xcode.xcassets") io.writefile(assetcatalog_generated_info_plist, "") -- do compile - local target_minver + local target_minver = nil + local toolchain_xcode = toolchain.load("xcode", {plat = target:plat(), arch = target:arch()}) + if toolchain_xcode then + target_minver = toolchain_xcode:config("target_minver") + end local argv = {"--warnings", "--notices", "--output-format", "human-readable-text"} - if is_plat("macosx") then - target_minver = get_config("target_minver_macosx") + if target:is_plat("macosx") then table.insert(argv, "--target-device") table.insert(argv, "mac") table.insert(argv, "--platform") table.insert(argv, "macosx") - elseif is_plat("iphoneos") then - target_minver = get_config("target_minver_iphoneos") + elseif target:is_plat("iphoneos") then table.insert(argv, "--target-device") table.insert(argv, "iphone") table.insert(argv, "--target-device") |
