add_definitions(-DSPIRV_CHECK_CONTEXT)
endif()
-add_subdirectory(external)
+#add_subdirectory(external)
if (TARGET effcee)
add_definitions(-DSPIRV_EFFCEE)
--- /dev/null
+Name: spirv-tools
+Version: 0.1
+Release: 0
+Summary: Khronos SPIRV Tools
+Group: Graphics & UI Framework/GL
+License: Apache2.0
+Source: %{name}-%{version}.tar.gz
+Source1001: %{name}.manifest
+
+BuildRequires: cmake
+BuildRequires: pkg-config
+BuildRequires: libtool
+BuildRequires: python
+BuildRequires: python-xml
+BuildRequires: spirv-headers
+
+%define BUILD_TYPE Debug
+
+%description
+Khronos SPIRV Tools
+
+%package devel
+Summary: Khronos SPIRV Tools
+Group: System/Libraries
+
+%description devel
+Khronos SPIRV Tools
+
+%prep
+%setup -q
+
+%build
+cp %{SOURCE1001} .
+
+# build SPIRV tools
+mkdir build
+cd build
+cmake ../
+make
+
+%install
+rm -rf %{buildroot}
+# release pkg
+mkdir -p %{buildroot}%{_libdir}/pkgconfig
+cd build
+cp -a source/libSPIRV* %{buildroot}%{_libdir}/
+cp -a source/opt/libSPIRV* %{buildroot}%{_libdir}/
+cp -a source/link/libSPIRV* %{buildroot}%{_libdir}/
+cp -f SPIRV-Tools.pc %{buildroot}%{_libdir}/pkgconfig/SPIRV-Tools.pc
+cp -f SPIRV-Tools-shared.pc %{buildroot}%{_libdir}/pkgconfig/SPIRV-Tools-shared.pc
+cd ..
+
+# devel pkg
+mkdir -p %{buildroot}%{_includedir}
+cp -a include/spirv-tools %{buildroot}%{_includedir}
+
+%files
+%manifest %{name}.manifest
+%license LICENSE
+%defattr(-,root,root,-)
+%{_libdir}/libSPIRV*
+
+%files devel
+%defattr(-,root,root,-)
+%{_includedir}/spirv-tools/*
+%{_libdir}/pkgconfig/SPIRV*.pc
+
+
set(VIMSYNTAX_PROCESSING_SCRIPT "${spirv-tools_SOURCE_DIR}/utils/generate_vim_syntax.py")
set(XML_REGISTRY_PROCESSING_SCRIPT "${spirv-tools_SOURCE_DIR}/utils/generate_registry_tables.py")
set(LANG_HEADER_PROCESSING_SCRIPT "${spirv-tools_SOURCE_DIR}/utils/generate_language_headers.py")
+set(SPIRV_HEADER_INCLUDE_DIR "/usr/include")
# For now, assume the DebugInfo grammar file is in the current directory.
# It might migrate to SPIRV-Headers.