Added the ability to vendor shaderc

This commit is contained in:
2022-05-27 15:52:57 +02:00
parent 9473519a4e
commit 87667f0618
4 changed files with 16 additions and 6 deletions

3
.gitmodules vendored
View File

@@ -1,3 +1,6 @@
[submodule "vendor/llvm"]
path = vendor/llvm
url = https://github.com/llvm/llvm-project
[submodule "vendor/shaderc"]
path = vendor/shaderc
url = https://github.com/google/shaderc

View File

@@ -6,7 +6,7 @@ set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED True)
include(FindPkgConfig)
find_package(Boost 1.78
find_package(Boost 1.74
COMPONENTS log)
list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}")
if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/vendor/llvm/llvm/CMakeLists.txt")
@@ -26,14 +26,19 @@ if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/vendor/llvm/llvm/CMakeLists.txt")
else()
message(STATUS "Using system LLVM")
find_package(LLVM 13 REQUIRED CONFIG)
find_package(LLVM 14 REQUIRED CONFIG)
endif()
include(AddLLVM)
include(HandleLLVMOptions)
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/vendor/shaderc/CMakeLists.txt")
set(SHADERC_SKIP_TESTS ON)
add_subdirectory(vendor/shaderc)
#pkg_check_modules(shaderc REQUIRED IMPORTED_TARGET shaderc)
else()
pkg_check_modules(shaderc REQUIRED IMPORTED_TARGET shaderc)
endif()
message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")

View File

@@ -1,7 +1,8 @@
Installing on RPi (3 or 4):
```
```shell
curl https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
echo deb https://apt.llvm.org/bullseye llvm-toolchain-bullseye-14 main >/etc/apt/sources.list.d/llvm14.list
apt install llvm-14-tools llvm-14-dev clang build-essential cmake
```
apt install llvm-14-tools clang build-essential cmake git \
llvm-14-dev libboost-log-dev spirv-headers spirv-tools
```

1
vendor/shaderc vendored Submodule

Submodule vendor/shaderc added at 96b1dd72a8