diff options
| author | ruki <[email protected]> | 2020-11-14 00:47:25 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-11-14 00:47:25 +0800 |
| commit | 0d59f55c4926ed3566538d2f13e8ad6b402a256b (patch) | |
| tree | 6edd652de8d6c557182217bf5bfa879631f683a9 | |
| parent | 3c879da3a536d4f113731bde1f5f8c6cb56a7509 (diff) | |
improve codesign for simulator app
| -rw-r--r-- | xmake/modules/private/tools/codesign.lua | 2 | ||||
| -rw-r--r-- | xmake/rules/xcode/application/build.lua | 6 | ||||
| -rw-r--r-- | xmake/rules/xcode/bundle/xmake.lua | 6 | ||||
| -rw-r--r-- | xmake/rules/xcode/framework/xmake.lua | 6 |
4 files changed, 16 insertions, 4 deletions
diff --git a/xmake/modules/private/tools/codesign.lua b/xmake/modules/private/tools/codesign.lua index 338cc0792..99563c29a 100644 --- a/xmake/modules/private/tools/codesign.lua +++ b/xmake/modules/private/tools/codesign.lua @@ -152,7 +152,7 @@ function main (programdir, codesign_identity, mobile_provision, opt) -- get entitlements for mobile local entitlements - if mobile_provision then + if codesign_identity and mobile_provision then local provisions = mobile_provisions() if provisions then mobile_provision = provisions[mobile_provision] diff --git a/xmake/rules/xcode/application/build.lua b/xmake/rules/xcode/application/build.lua index 75840281b..432ab8bf9 100644 --- a/xmake/rules/xcode/application/build.lua +++ b/xmake/rules/xcode/application/build.lua @@ -84,7 +84,11 @@ function main (target, opt) end -- do codesign - codesign(bundledir, target:values("xcode.codesign_identity") or get_config("xcode_codesign_identity"), mobile_provision, {deep = true}) + local codesign_identity = target:values("xcode.codesign_identity") or get_config("xcode_codesign_identity") + if target:is_plat("macosx") or (target:is_plat("iphoneos") and target:is_arch("x86_64", "i386")) then + codesign_identity = nil + end + codesign(bundledir, codesign_identity, mobile_provision, {deep = true}) end, {dependfile = target:dependfile(bundledir), files = {bundledir, target:targetfile()}}) end diff --git a/xmake/rules/xcode/bundle/xmake.lua b/xmake/rules/xcode/bundle/xmake.lua index 43da6e7fa..a3adfa0f9 100644 --- a/xmake/rules/xcode/bundle/xmake.lua +++ b/xmake/rules/xcode/bundle/xmake.lua @@ -94,7 +94,11 @@ rule("xcode.bundle") end -- do codesign - codesign(bundledir, target:values("xcode.codesign_identity") or get_config("xcode_codesign_identity")) + local codesign_identity = target:values("xcode.codesign_identity") or get_config("xcode_codesign_identity") + if target:is_plat("macosx") or (target:is_plat("iphoneos") and target:is_arch("x86_64", "i386")) then + codesign_identity = nil + end + codesign(bundledir, codesign_identity) end, {dependfile = target:dependfile(bundledir), files = {bundledir, target:targetfile()}}) end) diff --git a/xmake/rules/xcode/framework/xmake.lua b/xmake/rules/xcode/framework/xmake.lua index d84a85c9e..3d8137aeb 100644 --- a/xmake/rules/xcode/framework/xmake.lua +++ b/xmake/rules/xcode/framework/xmake.lua @@ -148,7 +148,11 @@ rule("xcode.framework") -- do codesign, only for dynamic library if target:targetkind() == "shared" then - codesign(contentsdir, target:values("xcode.codesign_identity") or get_config("xcode_codesign_identity")) + local codesign_identity = target:values("xcode.codesign_identity") or get_config("xcode_codesign_identity") + if target:is_plat("macosx") or (target:is_plat("iphoneos") and target:is_arch("x86_64", "i386")) then + codesign_identity = nil + end + codesign(contentsdir, codesign_identity) end end, {dependfile = target:dependfile(bundledir), files = {bundledir, target:targetfile()}}) end) |
