summaryrefslogtreecommitdiff
path: root/xmake/modules/detect/tools/find_codesign.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2020-04-04 21:11:06 +0800
committerruki <[email protected]>2020-04-04 21:11:06 +0800
commitd656204be63f729a9e7b60f509af1fc3450726cc (patch)
tree165c71c6a202a2d43c590cf16959449968e10f47 /xmake/modules/detect/tools/find_codesign.lua
parent82c4738ba1f8c7839d272b5e9d7e818efa97bdbf (diff)
add codesign
Diffstat (limited to 'xmake/modules/detect/tools/find_codesign.lua')
-rw-r--r--xmake/modules/detect/tools/find_codesign.lua53
1 files changed, 53 insertions, 0 deletions
diff --git a/xmake/modules/detect/tools/find_codesign.lua b/xmake/modules/detect/tools/find_codesign.lua
new file mode 100644
index 000000000..2dc5d0b75
--- /dev/null
+++ b/xmake/modules/detect/tools/find_codesign.lua
@@ -0,0 +1,53 @@
+--!A cross-platform build utility based on Lua
+--
+-- Licensed under the Apache License, Version 2.0 (the "License");
+-- you may not use this file except in compliance with the License.
+-- You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+--
+-- Copyright (C) 2015-2020, TBOOX Open Source Group.
+--
+-- @author ruki
+-- @file find_codesign.lua
+--
+
+-- imports
+import("lib.detect.find_program")
+import("lib.detect.find_programver")
+
+-- find codesign
+--
+-- @param opt the arguments, e.g. {version = true}
+--
+-- @return program, version
+--
+-- @code
+--
+-- local codesign = find_codesign()
+-- local codesign, version = find_codesign({version = true})
+--
+-- @endcode
+--
+function main(opt)
+
+ -- only for macosx
+ if not is_host("macosx") then
+ return
+ end
+
+ -- init options
+ opt = opt or {}
+ opt.check = function (program)
+ os.execv(program, {"-d", "/bin/echo"})
+ end
+
+ -- find program
+ return find_program(opt.program or "codesign", opt)
+end