diff options
| author | ruki <[email protected]> | 2020-07-31 00:38:15 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-07-31 00:38:15 +0800 |
| commit | 2a8c070910d30f70e68434723c0dbe46ae233954 (patch) | |
| tree | 5ced6d52f068504e530e2916132a7a640910e7b9 /xmake/toolchains/dlang/check.lua | |
| parent | 7cc471182dc9e137c2d5ff8d7731157bf227d819 (diff) | |
fix find dmd
Diffstat (limited to 'xmake/toolchains/dlang/check.lua')
| -rw-r--r-- | xmake/toolchains/dlang/check.lua | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/xmake/toolchains/dlang/check.lua b/xmake/toolchains/dlang/check.lua index cd40b0d15..14baa3282 100644 --- a/xmake/toolchains/dlang/check.lua +++ b/xmake/toolchains/dlang/check.lua @@ -20,17 +20,22 @@ -- imports import("core.project.config") +import("lib.detect.find_tool") import("detect.sdks.find_cross_toolchain") --- check the cross toolchain, for ldc2/gdc toolchain function main(toolchain) - -- is cross? + -- we attempt to find dmd, ldc2 in $PATH + if find_tool("dmd") or find_tool("ldc2") then + return true + end + + -- we need find ldc2 and gdc in the given toolchain sdk directory local sdkdir = config.get("sdk") local bindir = config.get("bin") local cross = config.get("cross") if not sdkdir and not bindir and not cross then - return + return end -- find cross toolchain |
