!2 add compat.h

Merge pull request !2 from zhuhongtao666/master
This commit is contained in:
openharmony_ci
2024-03-06 10:21:58 +00:00
committed by Gitee
3 changed files with 95 additions and 47 deletions
+63 -46
View File
@@ -1,46 +1,63 @@
# Copyright (C) 2023 Huawei Device 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/ohos.gni")
liburing_source = [
"//third_party/liburing/src/nolibc.c",
"//third_party/liburing/src/queue.c",
"//third_party/liburing/src/register.c",
"//third_party/liburing/src/setup.c",
"//third_party/liburing/src/syscall.c",
]
import("//build/ohos.gni")
config("liburing_config") {
visibility = [ ":*" ]
include_dirs = [
"//third_party/liburing",
"//third_party/liburing/src",
"//third_party/liburing/src/include",
"//third_party/liburing/src/include/liburing",
"//third_party/liburing/src/arch"
]
}
ohos_shared_library("liburing") {
configs = [ "//third_party/liburing:liburing_config" ]
sources = liburing_source
external_deps = [ "c_utils:utils" ]
subsystem_name = "thirdparty"
part_name = "liburing"
output_name = "liburing"
}
# Copyright (C) 2023-2024 Huawei Device 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/ohos.gni")
src_path = "//third_party/liburing"
out_dir = root_out_dir + "/third_party_liburing"
code_dir = out_dir + "/liburing"
liburing_source = [
"src/queue.c",
"src/register.c",
"src/setup.c",
"src/syscall.c",
]
config("liburing_config") {
visibility = [ ":*" ]
include_dirs = [
"$code_dir",
"$code_dir/src",
"$code_dir/src/include",
"$code_dir/src/include/liburing",
"$code_dir/src/arch",
]
}
action("liburing_configure") {
script = "install.sh"
args = [
rebase_path(src_path),
rebase_path(out_dir),
]
inputs = [ src_path ]
outputs = []
foreach(src, liburing_source) {
outputs += [ "$code_dir/" + src ]
}
}
ohos_shared_library("liburing") {
configs = [ "//third_party/liburing:liburing_config" ]
sources = []
foreach(src, liburing_source) {
sources += [ "$code_dir/" + src ]
}
deps = [ ":liburing_configure" ]
external_deps = [ "c_utils:utils" ]
subsystem_name = "thirdparty"
part_name = "liburing"
output_name = "liburing"
}
+3 -1
View File
@@ -22,7 +22,9 @@
"rom": "",
"ram": "",
"deps": {
"components": [],
"components": [
"c_utils"
],
"third_party": []
},
"build": {
Executable
+29
View File
@@ -0,0 +1,29 @@
#!/bin/bash
# Copyright (c) 2024 Huawei Device 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.
SRC_DIR="$1"
CODE_DIR="$2"
set -e
if [ "$SRC_DIR" == "" ] || [ "$CODE_DIR" == "" ]; then
exit 1
fi
mkdir -p $CODE_DIR
cp -r $SRC_DIR $CODE_DIR
CURRENT_DIR=$(pwd)
cd $CODE_DIR/liburing
sh ./configure
cd "$CURRENT_DIR"