From 7bd90133902bc03bbc6b10f20a6aa7149f626caa Mon Sep 17 00:00:00 2001 From: ruki Date: Mon, 10 Jul 2023 23:04:10 +0800 Subject: add has_flags for swift-frontend --- .../detect/tools/swift_frontend/has_flags.lua | 22 ++++++++++++++++++++++ xmake/modules/detect/tools/swiftc/has_flags.lua | 1 - xmake/toolchains/swift/xmake.lua | 2 +- 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 xmake/modules/detect/tools/swift_frontend/has_flags.lua diff --git a/xmake/modules/detect/tools/swift_frontend/has_flags.lua b/xmake/modules/detect/tools/swift_frontend/has_flags.lua new file mode 100644 index 000000000..4af0d592f --- /dev/null +++ b/xmake/modules/detect/tools/swift_frontend/has_flags.lua @@ -0,0 +1,22 @@ +--!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 has_flags.lua +-- + +-- imports +inherit("detect.tools.swiftc.has_flags") diff --git a/xmake/modules/detect/tools/swiftc/has_flags.lua b/xmake/modules/detect/tools/swiftc/has_flags.lua index fc4ff6540..99b36de75 100644 --- a/xmake/modules/detect/tools/swiftc/has_flags.lua +++ b/xmake/modules/detect/tools/swiftc/has_flags.lua @@ -23,7 +23,6 @@ import("core.cache.detectcache") -- try running function _try_running(...) - local argv = {...} local errors = nil return try { function () os.runv(table.unpack(argv)); return true end, catch { function (errs) errors = (errs or ""):trim() end }}, errors diff --git a/xmake/toolchains/swift/xmake.lua b/xmake/toolchains/swift/xmake.lua index 1d9d1279b..2dec302bf 100644 --- a/xmake/toolchains/swift/xmake.lua +++ b/xmake/toolchains/swift/xmake.lua @@ -26,7 +26,7 @@ toolchain("swift") set_description("Swift Programming Language Compiler") -- set toolset - set_toolset("sc", "$(env SC)", "swiftc") + set_toolset("sc", "$(env SC)", "swift-frontend", "swiftc") set_toolset("scld", "$(env SC)", "swiftc") set_toolset("scsh", "$(env SC)", "swiftc") -- cgit v1.3.1