diff options
| author | ruki <[email protected]> | 2022-05-15 14:48:54 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-05-15 14:48:54 +0800 |
| commit | 4e49f4cc6f37086385dc8dab04f8aa9dbfd3875a (patch) | |
| tree | 52173558811f20d52e6c30e8b5bd7150cf5ab83f | |
| parent | 35b45c71346256fdccb098287a2f2d2f604eeb28 (diff) | |
check toolchain
| -rw-r--r-- | xmake/modules/private/service/distcc_build/server_session.lua | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/xmake/modules/private/service/distcc_build/server_session.lua b/xmake/modules/private/service/distcc_build/server_session.lua index 8b86f44b1..419ae2f1c 100644 --- a/xmake/modules/private/service/distcc_build/server_session.lua +++ b/xmake/modules/private/service/distcc_build/server_session.lua @@ -190,10 +190,14 @@ function server_session:_tool(name, opt) local cacheinfo = self:_cache():get(cachekey) if not cacheinfo then local toolchain_inst = toolchain.load(name, {plat = plat, arch = arch}) - local program, toolname = toolchain_inst:tool(toolkind) - assert(program, "%s/%s not found!", name, toolkind) - cacheinfo = {program, toolname} - self:_cache():set(cachekey, cacheinfo) + if toolchain_inst:check() then + local program, toolname = toolchain_inst:tool(toolkind) + assert(program, "%s/%s not found!", name, toolkind) + cacheinfo = {program, toolname} + self:_cache():set(cachekey, cacheinfo) + else + raise("toolchain(%s) not found!", name) + end end return cacheinfo[1], cacheinfo[2] end |
