From b3d4c235f88fb14f0aa42c2704727a104ab33fd2 Mon Sep 17 00:00:00 2001 From: ruki Date: Wed, 16 Dec 2020 00:45:51 +0800 Subject: improve toolchain for xcode --- xmake/toolchains/xcode/check.lua | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'xmake/toolchains/xcode/check.lua') diff --git a/xmake/toolchains/xcode/check.lua b/xmake/toolchains/xcode/check.lua index 579def16c..c815cf5d0 100644 --- a/xmake/toolchains/xcode/check.lua +++ b/xmake/toolchains/xcode/check.lua @@ -27,8 +27,13 @@ import("detect.sdks.find_xcode") function main(toolchain) -- find xcode - local xcode = find_xcode(config.get("xcode"), {force = not optional, verbose = true, plat = toolchain:plat(), arch = toolchain:arch()}) + local xcode_sdkver = toolchain:config("xcode_sdkver") or config.get("xcode_sdkver") + local xcode = find_xcode(config.get("xcode"), {force = not optional, verbose = true, + sdkver = xcode_sdkver, + plat = toolchain:plat(), + arch = toolchain:arch()}) if xcode then + xcode_sdkver = xcode.sdkver config.set("xcode", xcode.sdkdir, {force = true, readonly = true}) else return false @@ -44,14 +49,7 @@ function main(toolchain) -- target("test") -- set_toolchains("xcode", {plat = os.host(), arch = os.arch()}) -- - local xcode_sdkver = toolchain:is_plat(config.plat()) and config.get("xcode_sdkver") - if not xcode_sdkver then - xcode_sdkver = config.get("xcode_sdkver_" .. toolchain:plat()) - end - local target_minver = toolchain:is_plat(config.plat()) and config.get("target_minver") - if not target_minver then - target_minver = config.get("target_minver_" .. toolchain:plat()) - end + local target_minver = toolchain:config("target_minver") and config.get("target_minver") if xcode_sdkver and not target_minver then target_minver = xcode_sdkver if toolchain:is_plat("macosx") then @@ -61,6 +59,8 @@ function main(toolchain) end end end - config.set("target_minver_" .. toolchain:plat(), target_minver) + toolchain:config_set("xcode_sdkver", xcode_sdkver) + toolchain:config_set("target_minver", target_minver) + toolchain:configs_save() return true end -- cgit v1.3.1 From c3bec4b1e483f5bcf443cf1a26b3b8bd8cfa2fba Mon Sep 17 00:00:00 2001 From: ruki Date: Wed, 16 Dec 2020 23:49:44 +0800 Subject: improve app rules --- tests/projects/objc/iosapp/xmake.lua | 2 ++ xmake/modules/detect/sdks/find_xcode.lua | 4 +--- xmake/rules/xcode/application/build.lua | 4 ++-- xmake/rules/xcode/application/install.lua | 6 +++--- xmake/rules/xcode/application/load.lua | 6 +++--- xmake/rules/xcode/application/package.lua | 2 +- xmake/rules/xcode/application/run.lua | 4 ++-- xmake/rules/xcode/application/uninstall.lua | 4 ++-- xmake/rules/xcode/bundle/xmake.lua | 4 ++-- xmake/rules/xcode/storyboard/xmake.lua | 2 +- xmake/rules/xcode/xcassets/xmake.lua | 2 +- xmake/toolchains/xcode/check.lua | 2 +- 12 files changed, 21 insertions(+), 21 deletions(-) (limited to 'xmake/toolchains/xcode/check.lua') diff --git a/tests/projects/objc/iosapp/xmake.lua b/tests/projects/objc/iosapp/xmake.lua index e1e9e6d74..c8becfc3b 100644 --- a/tests/projects/objc/iosapp/xmake.lua +++ b/tests/projects/objc/iosapp/xmake.lua @@ -4,3 +4,5 @@ target("test") add_rules("xcode.application") add_files("src/*.m", "src/**.storyboard", "src/*.xcassets") add_files("src/Info.plist") + set_plat("iphoneos") + set_arch("arm64") diff --git a/xmake/modules/detect/sdks/find_xcode.lua b/xmake/modules/detect/sdks/find_xcode.lua index a42ee1985..a1ffca6dc 100644 --- a/xmake/modules/detect/sdks/find_xcode.lua +++ b/xmake/modules/detect/sdks/find_xcode.lua @@ -96,7 +96,7 @@ function _find_xcode(sdkdir, xcode_sdkver, plat, arch) -- find mobile provision only for iphoneos local mobile_provision - if is_plat("iphoneos") then + if plat == "iphoneos" then local mobile_provisions = codesign.mobile_provisions() if mobile_provisions then mobile_provision = config.get("xcode_mobile_provision") @@ -174,8 +174,6 @@ function main(sdkdir, opt) end end else - - -- trace if opt.verbose or option.get("verbose") then cprint("checking for Xcode directory ... ${color.nothing}${text.nothing}") end diff --git a/xmake/rules/xcode/application/build.lua b/xmake/rules/xcode/application/build.lua index 432ab8bf9..a83e42684 100644 --- a/xmake/rules/xcode/application/build.lua +++ b/xmake/rules/xcode/application/build.lua @@ -41,7 +41,7 @@ function main (target, opt) -- copy target file local binarydir = contentsdir - if is_plat("macosx") then + if target:is_plat("macosx") then binarydir = path.join(contentsdir, "MacOS") end os.vcp(target:targetfile(), path.join(binarydir, path.filename(target:targetfile()))) @@ -72,7 +72,7 @@ function main (target, opt) -- generate embedded.mobileprovision to *.app/embedded.mobileprovision local mobile_provision_embedded = path.join(bundledir, "embedded.mobileprovision") local mobile_provision = target:values("xcode.mobile_provision") or get_config("xcode_mobile_provision") - if mobile_provision and is_plat("iphoneos") then + if mobile_provision and target:is_plat("iphoneos") then os.tryrm(mobile_provision_embedded) local provisions = codesign.mobile_provisions() if provisions then diff --git a/xmake/rules/xcode/application/install.lua b/xmake/rules/xcode/application/install.lua index bc76248ab..dee303ce4 100644 --- a/xmake/rules/xcode/application/install.lua +++ b/xmake/rules/xcode/application/install.lua @@ -62,13 +62,13 @@ end -- main entry function main (target) - if is_plat("iphoneos") then - if is_arch("x86_64", "i386") then + if target:is_plat("iphoneos") then + if target:is_arch("x86_64", "i386") then _install_for_ios_simulator(target) else _install_for_ios(target) end - elseif is_plat("macosx") then + elseif target:is_plat("macosx") then _install_for_macosx(target) end end diff --git a/xmake/rules/xcode/application/load.lua b/xmake/rules/xcode/application/load.lua index e4f76191e..7cf0625f0 100644 --- a/xmake/rules/xcode/application/load.lua +++ b/xmake/rules/xcode/application/load.lua @@ -29,7 +29,7 @@ function main (target) -- get contents and resources directory local contentsdir = bundledir local resourcesdir = bundledir - if is_plat("macosx") then + if target:is_plat("macosx") then contentsdir = path.join(bundledir, "Contents") resourcesdir = path.join(bundledir, "Contents", "Resources") end @@ -41,12 +41,12 @@ function main (target) target:set("filename", target:basename()) -- set install directory - if is_plat("macosx") and not target:get("installdir") then + if target:is_plat("macosx") and not target:get("installdir") then target:set("installdir", "/Applications") end -- add frameworks - if is_plat("macosx") then + if target:is_plat("macosx") then target:add("frameworks", "AppKit") else target:add("frameworks", "UIKit") diff --git a/xmake/rules/xcode/application/package.lua b/xmake/rules/xcode/application/package.lua index d7aa9cbfd..bcf8d60fe 100644 --- a/xmake/rules/xcode/application/package.lua +++ b/xmake/rules/xcode/application/package.lua @@ -40,7 +40,7 @@ end -- main entry function main (target, opt) - if is_plat("iphoneos") then + if target:is_plat("iphoneos") then _package_for_ios(target) end end diff --git a/xmake/rules/xcode/application/run.lua b/xmake/rules/xcode/application/run.lua index 19bbf9b85..14a7c0f12 100644 --- a/xmake/rules/xcode/application/run.lua +++ b/xmake/rules/xcode/application/run.lua @@ -87,9 +87,9 @@ end -- main entry function main (target, opt) - if is_plat("macosx") then + if target:is_plat("macosx") then _run_on_macosx(target, opt) - elseif is_plat("iphoneos") and is_arch("x86_64", "i386") then + elseif target:is_plat("iphoneos") and target:is_arch("x86_64", "i386") then _run_on_simulator(target, opt) else raise("we can only run application on macOS or simulator!") diff --git a/xmake/rules/xcode/application/uninstall.lua b/xmake/rules/xcode/application/uninstall.lua index be06e9fff..421cb8e83 100644 --- a/xmake/rules/xcode/application/uninstall.lua +++ b/xmake/rules/xcode/application/uninstall.lua @@ -38,9 +38,9 @@ end -- main entry function main (target) - if is_plat("iphoneos") then + if target:is_plat("iphoneos") then _uninstall_for_ios(target) - elseif is_plat("macosx") then + elseif target:is_plat("macosx") then _uninstall_for_macosx(target) end end diff --git a/xmake/rules/xcode/bundle/xmake.lua b/xmake/rules/xcode/bundle/xmake.lua index c96fc72ac..9cbd92b6f 100644 --- a/xmake/rules/xcode/bundle/xmake.lua +++ b/xmake/rules/xcode/bundle/xmake.lua @@ -35,7 +35,7 @@ rule("xcode.bundle") -- get contents and resources directory local contentsdir = bundledir local resourcesdir = bundledir - if is_plat("macosx") then + if target:is_plat("macosx") then contentsdir = path.join(bundledir, "Contents") resourcesdir = path.join(bundledir, "Contents", "Resources") end @@ -74,7 +74,7 @@ rule("xcode.bundle") progress.show(opt.progress, "${color.build.target}generating.xcode.$(mode) %s", path.filename(bundledir)) -- copy target file - if is_plat("macosx") then + if target:is_plat("macosx") then os.vcp(target:targetfile(), path.join(contentsdir, "MacOS", path.filename(target:targetfile()))) else os.vcp(target:targetfile(), path.join(contentsdir, path.filename(target:targetfile()))) diff --git a/xmake/rules/xcode/storyboard/xmake.lua b/xmake/rules/xcode/storyboard/xmake.lua index 95a9c9aed..bfa88e6e1 100644 --- a/xmake/rules/xcode/storyboard/xmake.lua +++ b/xmake/rules/xcode/storyboard/xmake.lua @@ -86,7 +86,7 @@ rule("xcode.storyboard") -- do link argv = {"--errors", "--warnings", "--notices", "--auto-activate-custom-fonts", "--output-format", "human-readable-text"} - if is_plat("macosx") then + if target:is_plat("macosx") then table.insert(argv, "--target-device") table.insert(argv, "mac") end diff --git a/xmake/rules/xcode/xcassets/xmake.lua b/xmake/rules/xcode/xcassets/xmake.lua index 31c26a56d..d20fc278c 100644 --- a/xmake/rules/xcode/xcassets/xmake.lua +++ b/xmake/rules/xcode/xcassets/xmake.lua @@ -88,7 +88,7 @@ rule("xcode.xcassets") end table.insert(argv, "--app-icon") table.insert(argv, "AppIcon") - if is_plat("iphoneos") then + if target:is_plat("iphoneos") then table.insert(argv, "--enable-on-demand-resources") table.insert(argv, "YES") table.insert(argv, "--compress-pngs") diff --git a/xmake/toolchains/xcode/check.lua b/xmake/toolchains/xcode/check.lua index c815cf5d0..d7412e798 100644 --- a/xmake/toolchains/xcode/check.lua +++ b/xmake/toolchains/xcode/check.lua @@ -28,7 +28,7 @@ function main(toolchain) -- find xcode local xcode_sdkver = toolchain:config("xcode_sdkver") or config.get("xcode_sdkver") - local xcode = find_xcode(config.get("xcode"), {force = not optional, verbose = true, + local xcode = find_xcode(config.get("xcode"), {force = true, verbose = toolchain:global(), sdkver = xcode_sdkver, plat = toolchain:plat(), arch = toolchain:arch()}) -- cgit v1.3.1 From 2fb94d278e31d0e10870317a4534891148921a0f Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 17 Dec 2020 00:10:01 +0800 Subject: improve menuconfig --- xmake/actions/config/main.lua | 10 +++++----- xmake/actions/config/menuconf.lua | 15 +++++++++++---- xmake/toolchains/xcode/check.lua | 1 + 3 files changed, 17 insertions(+), 9 deletions(-) (limited to 'xmake/toolchains/xcode/check.lua') diff --git a/xmake/actions/config/main.lua b/xmake/actions/config/main.lua index c52d2a179..6c143bf81 100644 --- a/xmake/actions/config/main.lua +++ b/xmake/actions/config/main.lua @@ -195,11 +195,6 @@ force to build in current directory via run `xmake -P .`]], os.projectdir()) -- lock the whole project project.lock() - -- find default platform and save to configuration - local plat, arch = find_platform({global = true}) - assert(plat == config.plat()) - assert(arch == config.arch()) - -- enter menu config local options_changed = false if option.get("menu") then @@ -274,6 +269,11 @@ force to build in current directory via run `xmake -P .`]], os.projectdir()) end end + -- find default platform and save to configuration + local plat, arch = find_platform({global = true}) + assert(plat == config.plat()) + assert(arch == config.arch()) + -- load platform instance local instance_plat = platform.load(plat, arch) diff --git a/xmake/actions/config/menuconf.lua b/xmake/actions/config/menuconf.lua index 67cb1fe69..8d72b2c71 100644 --- a/xmake/actions/config/menuconf.lua +++ b/xmake/actions/config/menuconf.lua @@ -31,6 +31,7 @@ import("core.ui.action") import("core.ui.menuconf") import("core.ui.mconfdialog") import("core.ui.application") +import("private.detect.find_platform") -- the app application local app = application() @@ -227,11 +228,17 @@ function app:_basic_configs(cache) -- make configs by category self._BASIC_CONFIGS = self:_make_configs_by_category("Basic Configuration", options_by_category, cache, function (opt) - -- get default + -- get option + local name = opt[2] or opt[1] local default = opt[4] + local kind = (opt[3] == "k" or type(default) == "boolean") and "boolean" or "string" - -- get kind - local kind = (opt[3] == "k" or type(default) == "boolean") and "boolean" or "string" + -- get default platform + if name == "plat" then + default = find_platform() + elseif name == "arch" then + _, default = find_platform() + end -- choice option? local values = opt.values @@ -267,7 +274,7 @@ function app:_basic_configs(cache) end -- make option info - return {name = opt[2] or opt[1], kind = kind, default = default, values = values, description = description} + return {name = name, kind = kind, default = default, values = values, description = description} end) return self._BASIC_CONFIGS end diff --git a/xmake/toolchains/xcode/check.lua b/xmake/toolchains/xcode/check.lua index d7412e798..47d267e4e 100644 --- a/xmake/toolchains/xcode/check.lua +++ b/xmake/toolchains/xcode/check.lua @@ -59,6 +59,7 @@ function main(toolchain) end end end + print(toolchain:cachekey(), target_minver) toolchain:config_set("xcode_sdkver", xcode_sdkver) toolchain:config_set("target_minver", target_minver) toolchain:configs_save() -- cgit v1.3.1 From b16614cffa6d77431770e641c56d52355718bd34 Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 17 Dec 2020 00:34:41 +0800 Subject: remove some prints --- xmake/modules/detect/sdks/find_xcode.lua | 6 +++--- xmake/toolchains/xcode/check.lua | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'xmake/toolchains/xcode/check.lua') diff --git a/xmake/modules/detect/sdks/find_xcode.lua b/xmake/modules/detect/sdks/find_xcode.lua index a1ffca6dc..8416a50b8 100644 --- a/xmake/modules/detect/sdks/find_xcode.lua +++ b/xmake/modules/detect/sdks/find_xcode.lua @@ -144,8 +144,8 @@ function main(sdkdir, opt) end -- get plat and arch - local plat = opt.plat or config.get("plat") or "macosx" - local arch = opt.arch or config.get("arch") or "x86_64" + local plat = opt.plat or config.get("plat") or os.host() + local arch = opt.arch or config.get("arch") or os.arch() -- find xcode local xcode = _find_xcode(sdkdir or config.get("xcode") or global.get("xcode"), opt.sdkver, plat, arch) @@ -159,7 +159,7 @@ function main(sdkdir, opt) -- trace if opt.verbose or option.get("verbose") then cprint("checking for Xcode directory ... ${color.success}%s", xcode.sdkdir) - cprint("checking for SDK version of Xcode ... ${color.success}%s", xcode.sdkver) + cprint("checking for SDK (%s) version of Xcode ... ${color.success}%s", plat, xcode.sdkver) if xcode.codesign_identity then cprint("checking for Codesign Identity of Xcode ... ${color.success}%s", xcode.codesign_identity) else diff --git a/xmake/toolchains/xcode/check.lua b/xmake/toolchains/xcode/check.lua index 47d267e4e..d7412e798 100644 --- a/xmake/toolchains/xcode/check.lua +++ b/xmake/toolchains/xcode/check.lua @@ -59,7 +59,6 @@ function main(toolchain) end end end - print(toolchain:cachekey(), target_minver) toolchain:config_set("xcode_sdkver", xcode_sdkver) toolchain:config_set("target_minver", target_minver) toolchain:configs_save() -- cgit v1.3.1 From 8e149f26ccfc93a756074915b5d5f052ba73ed85 Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 17 Dec 2020 00:40:44 +0800 Subject: improve to check xcode --- xmake/modules/detect/sdks/find_xcode.lua | 105 ++++++++++++------------------- xmake/toolchains/xcode/check.lua | 32 ++++++++-- 2 files changed, 68 insertions(+), 69 deletions(-) (limited to 'xmake/toolchains/xcode/check.lua') diff --git a/xmake/modules/detect/sdks/find_xcode.lua b/xmake/modules/detect/sdks/find_xcode.lua index 8416a50b8..4e7a1f677 100644 --- a/xmake/modules/detect/sdks/find_xcode.lua +++ b/xmake/modules/detect/sdks/find_xcode.lua @@ -27,7 +27,7 @@ import("lib.detect.find_directory") import("private.tools.codesign") -- find xcode directory -function _find_sdkdir(sdkdir) +function _find_sdkdir(sdkdir, opt) if sdkdir and os.isdir(sdkdir) then return sdkdir end @@ -35,9 +35,11 @@ function _find_sdkdir(sdkdir) end -- find the sdk version of xcode -function _find_xcode_sdkver(sdkdir, plat, arch) +function _find_xcode_sdkver(sdkdir, opt) -- select platform sdkdir + local plat = opt.plat + local arch = opt.arch local platsdkdir = nil if plat == "iphoneos" then if arch == "i386" or arch == "x86_64" then @@ -65,52 +67,56 @@ function _find_xcode_sdkver(sdkdir, plat, arch) end -- find the xcode toolchain -function _find_xcode(sdkdir, xcode_sdkver, plat, arch) +function _find_xcode(sdkdir, opt) -- find xcode root directory - sdkdir = _find_sdkdir(sdkdir) + sdkdir = _find_sdkdir(sdkdir, opt) if not sdkdir then return {} end -- find the sdk version - local sdkver = xcode_sdkver or _find_xcode_sdkver(sdkdir, plat, arch) + local sdkver = opt.sdkver or _find_xcode_sdkver(sdkdir, opt) if not sdkver then return {} end - -- find codesign identity - local codesign_identity = config.get("xcode_codesign_identity") - if codesign_identity == nil then -- we will disable codesign_identity if be false - codesign_identity = global.get("xcode_codesign_identity") - end - if codesign_identity == nil then - local codesign_identities = codesign.codesign_identities() - if codesign_identities then - for identity, _ in pairs(codesign_identities) do - codesign_identity = identity - break + -- find codesign + if opt.find_codesign then + + -- find codesign identity + local codesign_identity = config.get("xcode_codesign_identity") + if codesign_identity == nil then -- we will disable codesign_identity if be false + codesign_identity = global.get("xcode_codesign_identity") + end + if codesign_identity == nil then + local codesign_identities = codesign.codesign_identities() + if codesign_identities then + for identity, _ in pairs(codesign_identities) do + codesign_identity = identity + break + end end end - end - -- find mobile provision only for iphoneos - local mobile_provision - if plat == "iphoneos" then - local mobile_provisions = codesign.mobile_provisions() - if mobile_provisions then - mobile_provision = config.get("xcode_mobile_provision") - if mobile_provision == nil then -- we will disable mobile_provision if be false - mobile_provision = global.get("xcode_mobile_provision") - end - if mobile_provision == nil then - for provision, _ in pairs(mobile_provisions) do - mobile_provision = provision - break + -- find mobile provision only for iphoneos + local mobile_provision + if opt.plat == "iphoneos" then + local mobile_provisions = codesign.mobile_provisions() + if mobile_provisions then + mobile_provision = config.get("xcode_mobile_provision") + if mobile_provision == nil then -- we will disable mobile_provision if be false + mobile_provision = global.get("xcode_mobile_provision") + end + if mobile_provision == nil then + for provision, _ in pairs(mobile_provisions) do + mobile_provision = provision + break + end + -- valid mobile provision not found? reset it + elseif not mobile_provisions[mobile_provision] then + mobile_provision = nil end - -- valid mobile provision not found? reset it - elseif not mobile_provisions[mobile_provision] then - mobile_provision = nil end end end @@ -121,7 +127,7 @@ end -- -- @param sdkdir the xcode directory -- @param opt the argument options --- e.g. {verbose = true, force = false, sdkver = 19, toolchains_ver = "4.9"} +-- e.g. {verbose = true, force = false, sdkver = 19, find_codesign = true} -- -- @return the xcode toolchain. e.g. {bindir = .., cross = ..} -- @@ -148,36 +154,7 @@ function main(sdkdir, opt) local arch = opt.arch or config.get("arch") or os.arch() -- find xcode - local xcode = _find_xcode(sdkdir or config.get("xcode") or global.get("xcode"), opt.sdkver, plat, arch) - if xcode and xcode.sdkdir then - - -- save to config - config.set("xcode", xcode.sdkdir, {force = true, readonly = true}) - config.set("xcode_codesign_identity", xcode.codesign_identity, {force = true, readonly = true}) - config.set("xcode_mobile_provision", xcode.mobile_provision, {force = true, readonly = true}) - - -- trace - if opt.verbose or option.get("verbose") then - cprint("checking for Xcode directory ... ${color.success}%s", xcode.sdkdir) - cprint("checking for SDK (%s) version of Xcode ... ${color.success}%s", plat, xcode.sdkver) - if xcode.codesign_identity then - cprint("checking for Codesign Identity of Xcode ... ${color.success}%s", xcode.codesign_identity) - else - cprint("checking for Codesign Identity of Xcode ... ${color.nothing}${text.nothing}") - end - if plat == "iphoneos" then - if xcode.mobile_provision then - cprint("checking for Mobile Provision of Xcode ... ${color.success}%s", xcode.mobile_provision) - else - cprint("checking for Mobile Provision of Xcode ... ${color.nothing}${text.nothing}") - end - end - end - else - if opt.verbose or option.get("verbose") then - cprint("checking for Xcode directory ... ${color.nothing}${text.nothing}") - end - end + local xcode = _find_xcode(sdkdir or config.get("xcode") or global.get("xcode"), opt) -- save to cache cacheinfo.xcode = xcode or false diff --git a/xmake/toolchains/xcode/check.lua b/xmake/toolchains/xcode/check.lua index d7412e798..b8707a2a9 100644 --- a/xmake/toolchains/xcode/check.lua +++ b/xmake/toolchains/xcode/check.lua @@ -28,17 +28,37 @@ function main(toolchain) -- find xcode local xcode_sdkver = toolchain:config("xcode_sdkver") or config.get("xcode_sdkver") - local xcode = find_xcode(config.get("xcode"), {force = true, verbose = toolchain:global(), + local xcode = find_xcode(config.get("xcode"), {force = true, verbose = true, + find_codesign = toolchain:global(), sdkver = xcode_sdkver, plat = toolchain:plat(), arch = toolchain:arch()}) - if xcode then - xcode_sdkver = xcode.sdkver - config.set("xcode", xcode.sdkdir, {force = true, readonly = true}) - else + if not xcode then + cprint("checking for Xcode directory ... ${color.nothing}${text.nothing}") return false end + -- xcode found + xcode_sdkver = xcode.sdkver + if toolchain:global() then + config.set("xcode", xcode.sdkdir, {force = true, readonly = true}) + config.set("xcode_mobile_provision", xcode.mobile_provision, {force = true, readonly = true}) + config.set("xcode_codesign_identity", xcode.codesign_identity, {force = true, readonly = true}) + cprint("checking for Xcode directory ... ${color.success}%s", xcode.sdkdir) + if xcode.codesign_identity then + cprint("checking for Codesign Identity of Xcode ... ${color.success}%s", xcode.codesign_identity) + else + cprint("checking for Codesign Identity of Xcode ... ${color.nothing}${text.nothing}") + end + if toolchain:is_plat("iphoneos") then + if xcode.mobile_provision then + cprint("checking for Mobile Provision of Xcode ... ${color.success}%s", xcode.mobile_provision) + else + cprint("checking for Mobile Provision of Xcode ... ${color.nothing}${text.nothing}") + end + end + end + -- save target minver -- -- @note we need to differentiate the version for the system, @@ -62,5 +82,7 @@ function main(toolchain) toolchain:config_set("xcode_sdkver", xcode_sdkver) toolchain:config_set("target_minver", target_minver) toolchain:configs_save() + cprint("checking for SDK version of Xcode for %s (%s) ... ${color.success}%s", toolchain:plat(), toolchain:arch(), xcode_sdkver) + cprint("checking for Minimal target version of Xcode for %s (%s) ... ${color.success}%s", toolchain:plat(), toolchain:arch(), target_minver) return true end -- cgit v1.3.1 From 98a044d2947d070d035fe76c651fdbf9f0c3b135 Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 17 Dec 2020 22:43:28 +0800 Subject: save xcode directory to toolchain --- xmake/toolchains/xcode/check.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'xmake/toolchains/xcode/check.lua') diff --git a/xmake/toolchains/xcode/check.lua b/xmake/toolchains/xcode/check.lua index b8707a2a9..7bd6eca84 100644 --- a/xmake/toolchains/xcode/check.lua +++ b/xmake/toolchains/xcode/check.lua @@ -79,6 +79,7 @@ function main(toolchain) end end end + toolchain:config_set("xcode", xcode.sdkdir) toolchain:config_set("xcode_sdkver", xcode_sdkver) toolchain:config_set("target_minver", target_minver) toolchain:configs_save() -- cgit v1.3.1