diff --git a/build/gn/BUILD.gn b/build/gn/BUILD.gn index 4056c619eff07635cb82bff1af5084b892166e28..03018232124f5bef01834ecdf555f8639a69e99e 100644 --- a/build/gn/BUILD.gn +++ b/build/gn/BUILD.gn @@ -13,5 +13,6 @@ group("ft_engine") { deps = [ + "//display_server/utils/socketpair/ft_build:socketpair", ] } diff --git a/build/gn/fangtian.gni b/build/gn/fangtian.gni index f4b75d512ca369d8e48fbe772042745b7e6f0df9..a345c67959b1b757825f7a7e9b27e5d8e6292c3f 100755 --- a/build/gn/fangtian.gni +++ b/build/gn/fangtian.gni @@ -18,3 +18,4 @@ declare_args() { } +sys_inc = "/usr/include" diff --git a/build/prebuild.sh b/build/prebuild.sh index 9b6d36cbdd8ccd20ecf1b4ae8e1b5b38e1f2604f..91e0b3c1f4e0dd95f89e1952769a3dfb9df996a7 100755 --- a/build/prebuild.sh +++ b/build/prebuild.sh @@ -36,7 +36,7 @@ fi PYTHON_VERSION=$(python3 --version 2>&1 | awk '{print $2}') # Compare the versions -if [ "$(printf '%s\n' "$PYTHON_REQUIRED_VERSION" "$PYTHON_VERSION" | sort -V | head -n1)" = "$PYTHON_REQUIRED_VERSION" ]; then +if [ "$(printf '%s\n' "$PYTHON_REQUIRED_VERSION" "$PYTHON_VERSION" | sort -V | head -n1)" = "$PYTHON_REQUIRED_VERSION" ]; then echo "The python3 version is $PYTHON_VERSION" else echo "The python3 version is less than $PYTHON_REQUIRED_VERSION" @@ -59,4 +59,27 @@ echo -e "\e[36m[-] Prepare system packages...\e[0m" # Check & Install required system packages python3 ${PROJECT_DIR}/build/builder.py check --install-packages $* -echo -e "\033[32m[*] Pre-build Done. You can exec 'build.sh' now.\033[0m" +# install prebuild library +if [ ! -d ${PROJECT_DIR}/prebuilts/libs ]; then +git clone https://gitee.com/yanansong/ft_engine_prebuild.git ${PROJECT_DIR}/prebuilts/libs +fi + +# copy prebuild library to /usr/lib64 +ARCHNAME=`uname -m` +cd ${PROJECT_DIR}/prebuilts/libs/library/${ARCHNAME} +sudo cp -fr *.so /usr/lib64 +cd ${PROJECT_DIR} +rm -fr ${PROJECT_DIR}/prebuilts/libs + +# install prebuild include. delete download files +if [ ! -d ${PROJECT_DIR}/prebuilts/inc ]; then +git clone https://gitee.com/yanansong/devel_inc.git ${PROJECT_DIR}/prebuilts/inc +fi + +# copy include files to /usr/include. delete download files +cd ${PROJECT_DIR}/prebuilts/inc +sudo cp -fr * /usr/include +cd ${PROJECT_DIR} +rm -fr ${PROJECT_DIR}/prebuilts/inc + +echo -e "\033[32m[*] Pre-build Done. You need exec 'build.sh'.\033[0m" diff --git a/display_server/utils/scoped_bytrace/ft_build/BUILD.gn b/display_server/utils/scoped_bytrace/ft_build/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..66f7f5b7e5a09b2482744018071c588cc48f448f --- /dev/null +++ b/display_server/utils/scoped_bytrace/ft_build/BUILD.gn @@ -0,0 +1,40 @@ +# Copyright (c) 2023 Huawei Technologies Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/gn/fangtian.gni") + +config("scoped_bytrace_config") { + visibility = [ ":*" ] + cflags = [ + "-Wall", + "-Werror", + "-g3", + ] + include_dirs = [ + "${sys_inc}/hitrace_meter", + "${sys_inc}/hilog", + ] + libs = ["hilog", "hitrace_meter"] +} + +config("scoped_bytrace_public_config") { + include_dirs = [ "../export" ] +} + +ft_static_library("scoped_bytrace") { + sources = [ "../src/scoped_bytrace.cpp" ] + configs = [ ":scoped_bytrace_config" ] + public_configs = [ ":scoped_bytrace_public_config" ] + subsystem_name = "graphic" + part_name = "graphic_standard" +} \ No newline at end of file diff --git a/display_server/utils/socketpair/ft_build/BUILD.gn b/display_server/utils/socketpair/ft_build/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..ba8de726cac3fe695e5149bfa79b62a353ff01b6 --- /dev/null +++ b/display_server/utils/socketpair/ft_build/BUILD.gn @@ -0,0 +1,38 @@ +# Copyright (c) 2023 Huawei Technologies Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/gn/fangtian.gni") + +config("socketpair_config") { + visibility = [ ":socketpair" ] + cflags = [ + "-Wall", + "-Werror", + "-g3", + ] + include_dirs = [ + "../export", + "${sys_inc}/c_utils", + "${sys_inc}/ipc_core", + "${sys_inc}/hilog", + ] + libs = ["hilog", "ipc_core", "utils"] +} + +ft_shared_library("socketpair") { + sources = [ "../src/local_socketpair.cpp" ] + configs = [ ":socketpair_config" ] + deps = [ "//display_server/utils/scoped_bytrace/ft_build:scoped_bytrace" ] + part_name = "graphic_standard" + subsystem_name = "graphic" +} \ No newline at end of file