summaryrefslogtreecommitdiff
path: root/xmake/modules/detect/tools
diff options
context:
space:
mode:
authorGaweringo <[email protected]>2025-01-31 22:52:46 +0100
committerGaweringo <[email protected]>2025-01-31 22:52:46 +0100
commit9afa188316f3a94e70f7643dc3ea41d46df8f03e (patch)
tree310d198966df5d342053b21c37ff73e5daf7c497 /xmake/modules/detect/tools
parent1c95d287f8bf7b80afc30e68ceb7f438afcccb7a (diff)
feat(debugger): add raddbg as a debugger option
Diffstat (limited to 'xmake/modules/detect/tools')
-rw-r--r--xmake/modules/detect/tools/find_raddbg.lua55
1 files changed, 55 insertions, 0 deletions
diff --git a/xmake/modules/detect/tools/find_raddbg.lua b/xmake/modules/detect/tools/find_raddbg.lua
new file mode 100644
index 000000000..faa310663
--- /dev/null
+++ b/xmake/modules/detect/tools/find_raddbg.lua
@@ -0,0 +1,55 @@
+--!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-present, TBOOX Open Source Group.
+--
+-- @author ruki, gaweringo
+-- @file find_raddbg.lua
+--
+
+-- imports
+import("lib.detect.find_program")
+import("lib.detect.find_programver")
+
+-- find raddbg
+--
+-- @param opt the argument options, e.g. {version = true, program="raddbg"}
+--
+-- @return program, version
+--
+-- @code
+--
+-- local raddbg = find_raddbg()
+-- local raddbg, version = find_raddbg({version = true})
+-- local raddbg, version = find_raddbg({version = true, program = "raddbg"})
+--
+-- @endcode
+--
+function main(opt)
+
+ -- init options
+ opt = opt or {}
+
+ -- find program
+ local program = find_program(opt.program or "raddbg", opt)
+
+ -- find program version
+ local version = nil
+ if program and opt and opt.version then
+ version = find_programver(program, opt)
+ end
+
+ -- ok?
+ return program, version
+end