148f512ceSopenharmony_ci#!/bin/bash
248f512ceSopenharmony_ci# Copyright (c) 2021 Huawei Device Co., Ltd.
348f512ceSopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
448f512ceSopenharmony_ci# you may not use this file except in compliance with the License.
548f512ceSopenharmony_ci# You may obtain a copy of the License at
648f512ceSopenharmony_ci#
748f512ceSopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
848f512ceSopenharmony_ci#
948f512ceSopenharmony_ci# Unless required by applicable law or agreed to in writing, software
1048f512ceSopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
1148f512ceSopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1248f512ceSopenharmony_ci# See the License for the specific language governing permissions and
1348f512ceSopenharmony_ci# limitations under the License.
1448f512ceSopenharmony_ci
1548f512ceSopenharmony_ciset -e
1648f512ceSopenharmony_ci
1748f512ceSopenharmony_ciecho "use protoc to do the prebuild (gn unable set LD_LIBRARY_PATH)"
1848f512ceSopenharmony_ci
1948f512ceSopenharmony_ciecho "pwd $(pwd)"
2048f512ceSopenharmony_ci
2148f512ceSopenharmony_ciMYDIR=$(dirname $0)
2248f512ceSopenharmony_ciBUILD_TOP=$MYDIR/../../../
2348f512ceSopenharmony_ciecho MYDIR $MYDIR
2448f512ceSopenharmony_ciecho BUILD_TOP $BUILD_TOP
2548f512ceSopenharmony_ci
2648f512ceSopenharmony_ciprotoc_cmdline=$*
2748f512ceSopenharmony_ciecho protoc_cmdline $protoc_cmdline
2848f512ceSopenharmony_ci
2948f512ceSopenharmony_ci# search one by bone
3048f512ceSopenharmony_ciPREBUILD_HOST_CLANG_RUNTIME=$BUILD_TOP/prebuilts/clang/host/linux-x86/clang-r353983c/lib64
3148f512ceSopenharmony_ciPREBUILD_OHOS_CLANG_RUNTIME=$BUILD_TOP/prebuilts/clang/ohos/linux-x86_64/llvm/lib
3248f512ceSopenharmony_ciexport LD_LIBRARY_PATH=$PREBUILD_HOST_CLANG_RUNTIME:$PREBUILD_OHOS_CLANG_RUNTIME:$LD_LIBRARY_PATH
3348f512ceSopenharmony_cicmd="$protoc_cmdline"
3448f512ceSopenharmony_ciecho $cmd
3548f512ceSopenharmony_ci$cmd
36