diff options
| author | ruki <[email protected]> | 2020-12-24 23:08:39 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-12-24 23:08:39 +0800 |
| commit | 70865b36f34647bda2bdd218b428bcca0cecc9da (patch) | |
| tree | 98fba7be3efef8668b971d733a07c7eb285d6163 /xmake/rules/utils/compiler_runtime/xmake.lua | |
| parent | 5beced53d4ba81070c79a777ac5f5f0233e22e4e (diff) | |
add utils.compiler.runtime rule
Diffstat (limited to 'xmake/rules/utils/compiler_runtime/xmake.lua')
| -rw-r--r-- | xmake/rules/utils/compiler_runtime/xmake.lua | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/xmake/rules/utils/compiler_runtime/xmake.lua b/xmake/rules/utils/compiler_runtime/xmake.lua new file mode 100644 index 000000000..a9ca1ac49 --- /dev/null +++ b/xmake/rules/utils/compiler_runtime/xmake.lua @@ -0,0 +1,31 @@ +--!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 xmake.lua +-- + +-- define rule: utils.compiler.runtime +rule("utils.compiler.runtime") + after_load(function (target) + + -- set vs runtime + local vs_runtime = get_config("vs_runtime") + if vs_runtime and target:is_plat("windows") and not target:get("runtimes") then + target:set("runtimes", vs_runtime .. (is_mode("debug") and "d" or "")) + end + end) + |
