diff options
| author | ruki <[email protected]> | 2022-10-21 00:52:46 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-10-21 00:52:46 +0800 |
| commit | 2be6affa66038e8bbbcb8ce4154974acae6e8ad0 (patch) | |
| tree | 76b59cfdbd6409817d22b731bdd0aca477425cb5 /xmake/modules/detect/tools | |
| parent | ebd66cbd4f2aab72cf3a3a57b165ec82d08e42ed (diff) | |
improve to find armasm
Diffstat (limited to 'xmake/modules/detect/tools')
| -rw-r--r-- | xmake/modules/detect/tools/find_armasm64_msvc.lua | 54 | ||||
| -rw-r--r-- | xmake/modules/detect/tools/find_armasm_msvc.lua | 54 |
2 files changed, 108 insertions, 0 deletions
diff --git a/xmake/modules/detect/tools/find_armasm64_msvc.lua b/xmake/modules/detect/tools/find_armasm64_msvc.lua new file mode 100644 index 000000000..d485606c3 --- /dev/null +++ b/xmake/modules/detect/tools/find_armasm64_msvc.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_armasm64_msvc.lua +-- + +-- imports +import("lib.detect.find_program") +import("lib.detect.find_programver") +import("detect.sdks.find_mdk") + +-- find armasm +-- +-- @param opt the argument options, e.g. {version = true} +-- +-- @return program, version +-- +-- @code +-- +-- local armasm = find_armasm64_msvc() +-- local armasm, version = find_armasm64_msvc({program = "armasm64", version = true}) +-- +-- @endcode +-- +function main(opt) + + -- init options + opt = opt or {} + opt.check = "-h" + + -- find program + local program = find_program(opt.program or "armasm64.exe", opt) + + -- find program version + local version = nil + if program and opt.version then + version = find_programver(program, opt) + end + return program, version +end diff --git a/xmake/modules/detect/tools/find_armasm_msvc.lua b/xmake/modules/detect/tools/find_armasm_msvc.lua new file mode 100644 index 000000000..49209ccef --- /dev/null +++ b/xmake/modules/detect/tools/find_armasm_msvc.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_armasm_msvc.lua +-- + +-- imports +import("lib.detect.find_program") +import("lib.detect.find_programver") +import("detect.sdks.find_mdk") + +-- find armasm +-- +-- @param opt the argument options, e.g. {version = true} +-- +-- @return program, version +-- +-- @code +-- +-- local armasm = find_armasm_msvc() +-- local armasm, version = find_armasm_msvc({program = "armasm", version = true}) +-- +-- @endcode +-- +function main(opt) + + -- init options + opt = opt or {} + opt.check = "-h" + + -- find program + local program = find_program(opt.program or "armasm.exe", opt) + + -- find program version + local version = nil + if program and opt.version then + version = find_programver(program, opt) + end + return program, version +end |
