diff options
author | Xuelian Bai <xuelian.bai@samsung.com> | 2021-05-26 23:30:54 +0800 |
---|---|---|
committer | Xuelian Bai <xuelian.bai@samsung.com> | 2021-06-01 19:15:33 +0800 |
commit | 689fc20fbdbf1131e5db1bf2dd171c2d64ca331f (patch) | |
tree | df34db232c2fdcbfb2385488e1311ee9bdd38206 | |
parent | ff61890722a91e97c44940494be5b6eed0d5ff5b (diff) | |
download | SPIRV-Cross-689fc20fbdbf1131e5db1bf2dd171c2d64ca331f.tar.gz SPIRV-Cross-689fc20fbdbf1131e5db1bf2dd171c2d64ca331f.tar.bz2 SPIRV-Cross-689fc20fbdbf1131e5db1bf2dd171c2d64ca331f.zip |
Add build support for Tizensubmit/tizen/20210604.110910
1. Add spec file
2. Add path for find_package to find local glslang and spirv-tools
Change-Id: I23b60a588195ea62ebbcc96ba11d95dff17b0d77
Signed-Off-by: Xuelian Bai <xuelian.bai@samsung.com>
-rw-r--r-- | CMakeLists.txt | 8 | ||||
-rw-r--r-- | packaging/spirv-cross.manifest | 5 | ||||
-rw-r--r-- | packaging/spirv-cross.spec | 48 |
3 files changed, 57 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 39acf9a3..2087a64c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -462,16 +462,16 @@ if (SPIRV_CROSS_CLI) find_package(PythonInterp) find_program(spirv-cross-glslang NAMES glslangValidator PATHS ${CMAKE_CURRENT_SOURCE_DIR}/external/glslang-build/output/bin - NO_DEFAULT_PATH) + /usr/bin) find_program(spirv-cross-spirv-as NAMES spirv-as PATHS ${CMAKE_CURRENT_SOURCE_DIR}/external/spirv-tools-build/output/bin - NO_DEFAULT_PATH) + /usr/bin) find_program(spirv-cross-spirv-val NAMES spirv-val PATHS ${CMAKE_CURRENT_SOURCE_DIR}/external/spirv-tools-build/output/bin - NO_DEFAULT_PATH) + /usr/bin) find_program(spirv-cross-spirv-opt NAMES spirv-opt PATHS ${CMAKE_CURRENT_SOURCE_DIR}/external/spirv-tools-build/output/bin - NO_DEFAULT_PATH) + /usr/bin) if ((${spirv-cross-glslang} MATCHES "NOTFOUND") OR (${spirv-cross-spirv-as} MATCHES "NOTFOUND") OR (${spirv-cross-spirv-val} MATCHES "NOTFOUND") OR (${spirv-cross-spirv-opt} MATCHES "NOTFOUND")) set(SPIRV_CROSS_ENABLE_TESTS OFF) diff --git a/packaging/spirv-cross.manifest b/packaging/spirv-cross.manifest new file mode 100644 index 00000000..75b0fa5e --- /dev/null +++ b/packaging/spirv-cross.manifest @@ -0,0 +1,5 @@ +<manifest> + <request> + <domain name="_"/> + </request> +</manifest> diff --git a/packaging/spirv-cross.spec b/packaging/spirv-cross.spec new file mode 100644 index 00000000..ec8d4c1d --- /dev/null +++ b/packaging/spirv-cross.spec @@ -0,0 +1,48 @@ +Name: spirv-cross +Version: 2021.4.22 +Release: 0 +Summary: Khronos SPIRV-Cross +Group: Graphics & UI Framework/GL +License: MIT +Source: %{name}-%{version}.tar.gz +Source1001: %{name}.manifest + +BuildRequires: cmake +BuildRequires: pkg-config +BuildRequires: libtool +BuildRequires: python3 +BuildRequires: glslang +BuildRequires: spirv-tools + +%define BUILD_TYPE Debug + +%description +SPIRV-Cross is a tool designed for parsing and converting SPIR-V to other shader languages. + +%prep +%setup -q + +%build +cp %{SOURCE1001} . + +# build SPIRV headers +mkdir build +cd build +cmake -DCMAKE_INSTALL_LIBDIR=%{_libdir} -DCMAKE_INSTALL_INCLUDEDIR=%{_includedir} -DCMAKE_INSTALL_DATADIR=%{_datadir} -DCMAKE_INSTALL_BINDIR=%{_bindir} .. +make -j4 + +%install +rm -rf %{buildroot} +mkdir -p %{buildroot}%{_libdir} %{buildroot}%{_bindir} %{buildroot}%{_includedir} +cp -ra ./build/*.a %{buildroot}%{_libdir} +cp -ra ./build/spirv-cross %{buildroot}%{_bindir} +cp -ra ./build/spirv-cross-* %{buildroot}%{_bindir} +cp -ra ./include/* %{buildroot}%{_includedir} + +%files +%manifest %{name}.manifest +%license LICENSE +%defattr(-,root,root,-) +%{_bindir}/* +%{_includedir}/* +%{_libdir}/*.a |