diff options
| author | ruki <[email protected]> | 2020-04-05 16:15:13 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-04-05 16:15:13 +0800 |
| commit | a60c8e6025e597fd569a41e5add672d87bd4ca5a (patch) | |
| tree | ad3c7e486f6677b67eeccb86544e5c77e1b586c1 /xmake/modules/detect/sdks/find_xcode.lua | |
| parent | b6436a2df4a37f82e38723711937743daceb5367 (diff) | |
add codesign config
Diffstat (limited to 'xmake/modules/detect/sdks/find_xcode.lua')
| -rw-r--r-- | xmake/modules/detect/sdks/find_xcode.lua | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/xmake/modules/detect/sdks/find_xcode.lua b/xmake/modules/detect/sdks/find_xcode.lua index db01c44ee..6385a4929 100644 --- a/xmake/modules/detect/sdks/find_xcode.lua +++ b/xmake/modules/detect/sdks/find_xcode.lua @@ -24,6 +24,7 @@ import("core.base.option") import("core.base.global") import("core.project.config") import("lib.detect.find_directory") +import("private.tools.codesign") -- find xcode directory function _find_sdkdir(sdkdir) @@ -78,8 +79,18 @@ function _find_xcode(sdkdir, xcode_sdkver, plat, arch) return {} end + -- find codesign identity + local codesign_identity = nil + local codesign_identities = codesign.codesign_identities() + if codesign_identities then + for identity, _ in pairs(codesign_identities) do + codesign_identity = identity + break + end + end + -- ok? - return {sdkdir = sdkdir, sdkver = sdkver} + return {sdkdir = sdkdir, sdkver = sdkver, codesign_identity = codesign_identity} end -- find xcode toolchain @@ -119,11 +130,13 @@ function main(sdkdir, opt) -- save to config config.set("xcode", xcode.sdkdir, {force = true, readonly = true}) config.set("xcode_sdkver", xcode.sdkver, {force = true, readonly = true}) + config.set("xcode_codesign_identity", xcode.codesign_identity, {force = true, readonly = true}) -- trace if opt.verbose or option.get("verbose") then cprint("checking for the Xcode directory ... ${color.success}%s", xcode.sdkdir) cprint("checking for the SDK version of Xcode ... ${color.success}%s", xcode.sdkver) + cprint("checking for the Codesign Identity of Xcode ... ${color.success}%s", xcode.codesign_identity) end else |
