@@ -335,6 +335,7 @@ comment "Graphic applications"
source "package/pngquant/Config.in"
source "package/qt5cinex/Config.in"
source "package/rrdtool/Config.in"
+ source "package/spirv-llvm-translator/Config.in"
source "package/spirv-tools/Config.in"
source "package/stellarium/Config.in"
source "package/sway/Config.in"
new file mode 100644
@@ -0,0 +1,22 @@
+config BR2_PACKAGE_SPIRV_LLVM_TRANSLATOR
+ bool "spirv-translator"
+ depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS
+ depends on BR2_TOOLCHAIN_GCC_AT_LEAST_7
+ depends on BR2_TOOLCHAIN_HAS_THREADS
+ depends on BR2_INSTALL_LIBSTDCPP
+ depends on !BR2_STATIC_LIBS
+ depends on BR2_HOST_GCC_AT_LEAST_7 # host-llvm
+ select BR2_PACKAGE_LLVM
+ select BR2_PACKAGE_SPIRV_HEADERS
+ select BR2_PACKAGE_ZLIB
+ help
+ LLVM/SPIR-V Bi-Directional Translator is a library and tool
+ for translation between LLVM IR and SPIR-V.
+
+ https://github.com/khronosGroup/SPIRV-LLVM-Translator
+
+comment "spirv-translator needs a toolchain w/ threads, C++, gcc >= 7, dynamic library, host gcc >= 7"
+ depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS
+ depends on !BR2_TOOLCHAIN_HAS_THREADS || !BR2_INSTALL_LIBSTDCPP || \
+ !BR2_TOOLCHAIN_GCC_AT_LEAST_7 \
+ || BR2_STATIC_LIBS || !BR2_HOST_GCC_AT_LEAST_7
@@ -19,4 +19,14 @@ HOST_SPIRV_LLVM_TRANSLATOR_CONF_OPTS = \
-DLLVM_EXTERNAL_PROJECTS="SPIRV-Headers" \
-DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=$(HOST_DIR)/include
+SPIRV_LLVM_TRANSLATOR_INSTALL_STAGING = YES
+SPIRV_LLVM_TRANSLATOR_DEPENDENCIES = host-clang host-llvm llvm spirv-headers
+SPIRV_LLVM_TRANSLATOR_CONF_OPTS = \
+ -DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=$(STAGING_DIR)/usr \
+ -DLLVM_BUILD_TOOLS=ON \
+ -DLLVM_DIR=$(STAGING_DIR)/lib/cmake/llvm \
+ -DLLVM_SPIRV_BUILD_EXTERNAL=YES \
+ -DLLVM_SPIRV_INCLUDE_TESTS=OFF
+
+$(eval $(cmake-package))
$(eval $(host-cmake-package))