Add mingw support to glslang, spirv-headers and spirv-tools (#791)

* Add mingw support to glslang, spirv-headers and spirv-tools

* Fix glslang and spirv-tools tests

* Add MinGW support to spirv-cross and spirv-reflect
pull/794/head
Jérôme Leclercq 3 years ago committed by GitHub
parent 7fb549c6bf
commit 66eb03baa9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      packages/g/glslang/xmake.lua
  2. 6
      packages/s/spirv-cross/xmake.lua
  3. 2
      packages/s/spirv-headers/xmake.lua
  4. 2
      packages/s/spirv-reflect/xmake.lua
  5. 8
      packages/s/spirv-tools/xmake.lua

@ -29,7 +29,7 @@ package("glslang")
end
end)
on_install("linux", "windows", "macosx", function (package)
on_install("linux", "windows", "macosx", "mingw", function (package)
package:addenv("PATH", "bin")
io.replace("CMakeLists.txt", "ENABLE_OPT OFF", "ENABLE_OPT ON")
io.replace("StandAlone/CMakeLists.txt", "target_link_libraries(glslangValidator ${LIBRARIES})", [[
@ -52,10 +52,10 @@ package("glslang")
end)
on_test(function (package)
os.vrun("glslangValidator --version")
if not package:is_plat("mingw") or is_subhost("msys") then
os.vrun("glslangValidator --version")
end
if not package:config("binaryonly") then
assert(package:has_cxxfuncs("ShInitialize", {configs = {languages = "c++11"}, includes = "glslang/Public/ShaderLang.h"}))
end
end)

@ -12,7 +12,7 @@ package("spirv-cross")
add_deps("cmake")
add_links("spirv-cross-c", "spirv-cross-cpp", "spirv-cross-reflect", "spirv-cross-msl", "spirv-cross-util", "spirv-cross-hlsl", "spirv-cross-glsl", "spirv-cross-core")
on_install("windows", "linux", "macosx", function (package)
on_install("windows", "linux", "macosx", "mingw", function (package)
local configs = {"-DSPIRV_CROSS_ENABLE_TESTS=OFF"}
if package:config("shared") then
table.insert(configs, "-DSPIRV_CROSS_SHARED=ON")
@ -24,6 +24,8 @@ package("spirv-cross")
end)
on_test(function (package)
os.vrun("spirv-cross --help")
if not package:is_plat("mingw") or is_subhost("msys") then
os.vrun("spirv-cross --help")
end
assert(package:has_cfuncs("spvc_get_version", {includes = "spirv_cross/spirv_cross_c.h"}))
end)

@ -13,7 +13,7 @@ package("spirv-headers")
add_deps("cmake")
on_install("linux", "windows", "macosx", function (package)
on_install(function (package)
import("package.tools.cmake").install(package, {"-DSPIRV_HEADERS_SKIP_EXAMPLES=ON"})
end)

@ -11,7 +11,7 @@ package("spirv-reflect")
add_deps("spirv-headers")
on_install("windows", "linux", "macosx", function (package)
on_install("windows", "linux", "macosx", "mingw", function (package)
io.gsub("spirv_reflect.h", "#include \"%.%/include%/spirv%/unified1%/spirv.h\"", "#include \"spirv/unified1/spirv.h\"")
io.writefile("xmake.lua", [[
add_rules("mode.debug", "mode.release")

@ -38,7 +38,7 @@ package("spirv-tools")
end
end)
on_install("linux", "windows", "macosx", function (package)
on_install("linux", "windows", "macosx", "mingw", function (package)
package:addenv("PATH", "bin")
local configs = {"-DSPIRV_SKIP_TESTS=ON"}
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
@ -59,7 +59,9 @@ package("spirv-tools")
end)
on_test(function (package)
os.runv("spirv-as --help")
os.runv("spirv-opt --help")
if not package:is_plat("mingw") or is_subhost("msys") then
os.runv("spirv-as --help")
os.runv("spirv-opt --help")
end
assert(package:has_cxxfuncs("spvContextCreate", {configs = {languages = "c++11"}, includes = "spirv-tools/libspirv.hpp"}))
end)

Loading…
Cancel
Save