Source3018: XNNPACK.tar.gz
Source3019: FLATBUFFERS-2.0.tar.gz
Source3020: NEON2SSE.tar.gz
+Source3021: remove_const.patch
%{!?build_type: %define build_type Release}
%{!?npud_build: %define npud_build 1}
tar -xf %{SOURCE3018} -C ./externals
tar -xf %{SOURCE3019} -C ./externals
tar -xf %{SOURCE3020} -C ./externals
+cp -xf %{SOURCE3021} ./externals
+cd externals/FLATBUFFERS-2.0
+pwd
+patch -p1 < ../remove_const.patch
%build
%ifarch arm armv7l armv7hl aarch64 x86_64 %ix86 riscv64
--- /dev/null
+--- a/include/flatbuffers/stl_emulation.h
++++ b/include/flatbuffers/stl_emulation.h
+@@ -45,14 +45,18 @@
+ #endif
+ #endif // defined(FLATBUFFERS_USE_STD_OPTIONAL) ...
+
+-// The __cpp_lib_span is the predefined feature macro.
+-#if defined(FLATBUFFERS_USE_STD_SPAN)
+- #include <span>
+-#elif defined(__cpp_lib_span) && defined(__has_include)
+- #if __has_include(<span>)
+- #include <span>
+- #define FLATBUFFERS_USE_STD_SPAN
++#ifndef FLATBUFFERS_USE_STD_SPAN
++ // Testing __cpp_lib_span requires including either <version> or <span>,
++ // both of which were added in C++20.
++ // See: https://en.cppreference.com/w/cpp/utility/feature_test
++ #if defined(__cplusplus) && __cplusplus >= 202002L
++ #define FLATBUFFERS_USE_STD_SPAN 1
+ #endif
++#endif // FLATBUFFERS_USE_STD_SPAN
++
++#if defined(FLATBUFFERS_USE_STD_SPAN)
++ #include <array>
++ #include <span>
+ #else
+ // Disable non-trivial ctors if FLATBUFFERS_SPAN_MINIMAL defined.
+ #if !defined(FLATBUFFERS_TEMPLATES_ALIASES) || defined(FLATBUFFERS_CPP98_STL)
+@@ -625,7 +629,7 @@
+ private:
+ // This is a naive implementation with 'count_' member even if (Extent != dynamic_extent).
+ pointer const data_;
+- const size_type count_;
++ size_type count_;
+ };
+
+ #if !defined(FLATBUFFERS_SPAN_MINIMAL)