diff options
| author | ruki <[email protected]> | 2020-05-19 22:39:51 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-05-19 09:59:07 +0800 |
| commit | 6ee9db874fcfeb94fcc06982f132ea469ec98e0e (patch) | |
| tree | 85d36f6fed4718827bfec3267ef62cef27dedda1 /xmake/toolchains/dlang/xmake.lua | |
| parent | 5dfb51f3e1c06c07097158153f39c45830029685 (diff) | |
add dlang toolchain
Diffstat (limited to 'xmake/toolchains/dlang/xmake.lua')
| -rw-r--r-- | xmake/toolchains/dlang/xmake.lua | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/xmake/toolchains/dlang/xmake.lua b/xmake/toolchains/dlang/xmake.lua new file mode 100644 index 000000000..1ce144f8e --- /dev/null +++ b/xmake/toolchains/dlang/xmake.lua @@ -0,0 +1,36 @@ +--!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-2020, TBOOX Open Source Group. +-- +-- @author ruki +-- @file xmake.lua +-- + +-- define toolchain +toolchain("dlang") + + -- set toolsets + set_toolsets("dc", "dmd", "ldc2", "gdc") + set_toolsets("dcld", "dmd", "ldc2", "gdc") + set_toolsets("dcsh", "dmd", "ldc2", "gdc") + set_toolsets("dcar", "dmd", "ldc2", "gdc") + + -- on load + on_load(function (toolchain) + local march = is_arch("x86_64", "x64") and "-m64" or "-m32" + toolchain:add("dcflags", march) + toolchain:add("dcshflags", march) + toolchain:add("dcldflags", march) + end) |
