diff options
author | Xuelian Bai <xuelian.bai@samsung.com> | 2021-05-26 23:30:54 +0800 |
---|---|---|
committer | Xuelian Bai <xuelian.bai@samsung.com> | 2024-01-25 16:28:58 +0800 |
commit | 1011813543554ebfc5cce2d1e84f632dcbfaa954 (patch) | |
tree | 2a3d58676bc2322fbe4512dba71f0b00476c0467 | |
parent | 2de1265fca722929785d9acdec4ab728c47a0254 (diff) | |
download | SPIRV-Cross-tizen.tar.gz SPIRV-Cross-tizen.tar.bz2 SPIRV-Cross-tizen.zip |
Add build support for Tizentizen
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 dbf85d5d..492fea17 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -468,16 +468,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..db42fdbb --- /dev/null +++ b/packaging/spirv-cross.spec @@ -0,0 +1,48 @@ +Name: spirv-cross +Version: 1.3.268 +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 |