diff options
| author | star9029 <[email protected]> | 2024-11-20 15:11:56 +0800 |
|---|---|---|
| committer | star9029 <[email protected]> | 2024-11-20 15:11:56 +0800 |
| commit | 2b280eed3a311892e4dc1855edd327e46b848ba8 (patch) | |
| tree | 9b0022f5ed996667e177bc36b9621d56855efccf /xmake/modules | |
| parent | cefc6b3f0f70508da1f7a64d7d2ad64e45be036c (diff) | |
add wine run support
Diffstat (limited to 'xmake/modules')
| -rw-r--r-- | xmake/modules/detect/tools/find_wine.lua | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/xmake/modules/detect/tools/find_wine.lua b/xmake/modules/detect/tools/find_wine.lua new file mode 100644 index 000000000..05119a88d --- /dev/null +++ b/xmake/modules/detect/tools/find_wine.lua @@ -0,0 +1,54 @@ +--!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 +-- @file find_wine.lua +-- + +-- imports +import("lib.detect.find_program") +import("lib.detect.find_programver") + +-- find wine +-- +-- @param opt the argument options, e.g. {version = true} +-- +-- @return program, version +-- +-- @code +-- +-- local wine = find_wine() +-- local wine, version = find_wine({version = true}) +-- +-- @endcode +-- +function main(opt) + -- init options + opt = opt or {} + + -- find program + local program = find_program(opt.program or "wine", opt) + + -- find program version + local version = nil + if program and opt and opt.version then + opt.parse = opt.parse or "wine%-(%d+%.%d+%.%d+)" + version = find_programver(program, opt) + end + + -- ok? + return program, version +end |
