From 79dfad0f990afbfcb8df93b570ab145109db7071 Mon Sep 17 00:00:00 2001 From: modehua Date: Wed, 1 Feb 2023 11:58:57 +0800 Subject: [PATCH 1/2] build --- build.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 build.sh diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..77074f5 --- /dev/null +++ b/build.sh @@ -0,0 +1,25 @@ +script_dir=$(cd $(dirname $0);pwd) +cd $script_dir +echo $script_dir + +if [ -f ./build/CMakeCache.txt ]; then + echo "" + #rm -rf ./build/* +else + mkdir build +fi +pwd +cd build +cmake .. +make -j6 + +if [ $? -ne 0 ];then + + err=1 + echo "--------------------------------------make fail---------------------------------------" + # commented, we should restore the CMakeLists.txts... +else + err=0 + echo "--------------------------------------make succeed------------------------------------" +fi +exit $err From b0274b77316d8da858b7a936d6ed26ff76e22fb9 Mon Sep 17 00:00:00 2001 From: luoliangyi <87842688@qq.com> Date: Wed, 1 Feb 2023 14:17:15 +0800 Subject: [PATCH 2/2] uos lang --- build.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/build.sh b/build.sh index 77074f5..79a7822 100755 --- a/build.sh +++ b/build.sh @@ -1,7 +1,21 @@ +sys=$(cat /etc/issue) +sys=${sys%% *} #操作系统 script_dir=$(cd $(dirname $0);pwd) cd $script_dir echo $script_dir +cp CMakeLists.txt CMakeLists.txtbkp + + +if [ "$sys" == "UnionTech" ];then + sed -i "s/kylin/uos/g" CMakeLists.txt +elif [ "$sys" == "Kylin" ];then + sed -i "s/uos/kylin/g" CMakeLists.txt +else + sed -i "s/uos/kylin/g" CMakeLists.txt + echo "其他操作系统" +fi + if [ -f ./build/CMakeCache.txt ]; then echo "" #rm -rf ./build/* @@ -22,4 +36,9 @@ else err=0 echo "--------------------------------------make succeed------------------------------------" fi + +if [ -f ../CMakeLists.txtbkp ]; then + mv ../CMakeLists.txtbkp ../CMakeLists.txt +fi + exit $err