diff options
| author | ShifftC <[email protected]> | 2025-09-24 11:04:24 +0200 |
|---|---|---|
| committer | ShifftC <[email protected]> | 2025-09-29 11:24:56 +0200 |
| commit | 68501abaad6a9e8a99c058fe8c4986fb4cd4e08c (patch) | |
| tree | 8091ff64f556cadcc1b139fee0bed6acb32fe1da /xmake/modules | |
| parent | 1bb954e2d8294c4813f216bd20153f9eccf53adc (diff) | |
move check message function to shared module
Diffstat (limited to 'xmake/modules')
| -rw-r--r-- | xmake/modules/private/check/show.lua | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/xmake/modules/private/check/show.lua b/xmake/modules/private/check/show.lua new file mode 100644 index 000000000..4d94a7c5e --- /dev/null +++ b/xmake/modules/private/check/show.lua @@ -0,0 +1,40 @@ +--!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, Xmake Open Source Community. +-- +-- @author Shiffted +-- @file show.lua +-- + +function wshow(str, opt) + opt = opt or {} + _g.showed = _g.showed or {} + local showed = _g.showed + local infostr + if str and opt.sourcetips then + infostr = string.format("%s${clear}: %s", opt.sourcetips, str) + elseif opt.sourcetips and opt.apiname and opt.value ~= nil then + infostr = string.format("%s${clear}: unknown %s value '%s'", opt.sourcetips, opt.apiname, opt.value) + elseif str then + infostr = string.format("${clear}: %s", str) + end + if opt.probable_value then + infostr = string.format("%s, it may be '%s'", infostr, opt.probable_value) + end + if not showed[infostr] then + wprint(infostr) + showed[infostr] = true + end +end |
