blob: 9fef94b1df669326e38f5552fe32a614507e05a7 [file] [log] [blame]
Eric Kunze2364dcd2021-04-26 11:06:57 -07001#!/bin/bash
2
3# Copyright (c) 2020-2021, ARM Limited.
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16
Eric Kunzecc24c352021-08-24 14:11:47 -070017# Bail if any of the commands fail
18set -e
Eric Kunze2364dcd2021-04-26 11:06:57 -070019
20if test -f "third_party/flatbuffers/flatc";
21then
22 echo "Found flatc, skip building..."
23else
24 echo "flatc not found, building now..."
Eric Kunzecc24c352021-08-24 14:11:47 -070025 pushd third_party/flatbuffers/ > /dev/null
Eric Kunze2364dcd2021-04-26 11:06:57 -070026 cmake .
27 make flatc -j8
Eric Kunzecc24c352021-08-24 14:11:47 -070028 popd > /dev/null
Eric Kunze2364dcd2021-04-26 11:06:57 -070029fi
30
Eric Kunzecc24c352021-08-24 14:11:47 -070031pushd include/ > /dev/null
Eric Kunze2364dcd2021-04-26 11:06:57 -070032 ../third_party/flatbuffers/flatc --cpp ../schema/tosa.fbs
Eric Kunzecc24c352021-08-24 14:11:47 -070033popd > /dev/null
34pushd python/ > /dev/null
Eric Kunze2364dcd2021-04-26 11:06:57 -070035 ../third_party/flatbuffers/flatc --python ../schema/tosa.fbs
Eric Kunzecc24c352021-08-24 14:11:47 -070036popd > /dev/null
Eric Kunze2364dcd2021-04-26 11:06:57 -070037