diff options
| author | ruki <[email protected]> | 2023-01-14 00:36:18 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2023-01-14 00:36:18 +0800 |
| commit | 75b97c2509fd3d8eeec884c01c3eb6fc3635459a (patch) | |
| tree | 9bd327815a9217673fb1e2d08a4ced70c3822212 /xmake/modules | |
| parent | af36e0b08cf70100ae8cd15ff7dc4f33066d9ff5 (diff) | |
add verilator toolchains
Diffstat (limited to 'xmake/modules')
| -rw-r--r-- | xmake/modules/detect/tools/find_verilator.lua | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/xmake/modules/detect/tools/find_verilator.lua b/xmake/modules/detect/tools/find_verilator.lua new file mode 100644 index 000000000..3c3b57180 --- /dev/null +++ b/xmake/modules/detect/tools/find_verilator.lua @@ -0,0 +1,50 @@ +--!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_verilator.lua +-- + +-- imports +import("lib.detect.find_program") +import("lib.detect.find_programver") + +-- find verilator +-- +-- @param opt the argument options, e.g. {version = true} +-- +-- @return program, version +-- +-- @code +-- +-- local verilator = find_verilator() +-- +-- @endcode +-- +function main(opt) + + -- find program + opt = opt or {} + local program = find_program(opt.program or "verilator", opt) + + -- find program version + local version = nil + if program and opt and opt.version then + version = find_programver(program, opt) + end + return program, version +end + |
