diff options
| author | Latias94 <[email protected]> | 2023-08-30 14:06:31 +0800 |
|---|---|---|
| committer | Latias94 <[email protected]> | 2023-08-30 14:06:31 +0800 |
| commit | db699f189067513da3b591e9d9a1edeb59ade8b4 (patch) | |
| tree | 60ef1fd5045c22a1ac7ea86cdaa9934f6973e518 /xmake/modules | |
| parent | 44c70cdcb4f28e2499fb893f4d2e1d17e79bac22 (diff) | |
feat: add hlsl2spv
Diffstat (limited to 'xmake/modules')
| -rw-r--r-- | xmake/modules/detect/tools/find_dxc.lua | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/xmake/modules/detect/tools/find_dxc.lua b/xmake/modules/detect/tools/find_dxc.lua new file mode 100644 index 000000000..075bbb6c3 --- /dev/null +++ b/xmake/modules/detect/tools/find_dxc.lua @@ -0,0 +1,59 @@ +--!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 find_dxc.lua +-- + +-- imports +import("lib.detect.find_program") +import("lib.detect.find_programver") + +-- find dxc +-- +-- @param opt the argument options, e.g. {version = true, program = "c:\xxx\dxc.exe"} +-- +-- @return program, version +-- +-- @code +-- +-- local dxc = find_dxc() +-- local dxc, version = find_dxc({version = true}) +-- local dxc, version = find_dxc({version = true, program = "c:\xxx\dxc.exe"}) +-- +-- @endcode +-- +function main(opt) + + -- init options + opt = opt or {} + + -- find program + opt.paths = opt.paths or + { + "$(env VULKAN_SDK)/Bin", + "$(env VK_SDK_PATH)/Bin", + "$(env PATH)" + } + local program = find_program(opt.program or "dxc.exe", opt) + + -- find program version + local version = nil + if program and opt and opt.version then + version = find_programver(program, opt) + end + return program, version +end |
