From b6fa9cb06682311714ce18e6a65f243c6299af2f Mon Sep 17 00:00:00 2001
From: zxstty <zhaojiaqi18@huawei.com>
Date: Thu, 9 Nov 2023 11:10:52 +0800
Subject: [PATCH] 0007

---
 .../bounds_checking_function/BUILD.gn         | 28 +++++++++++++++++++
 .../bounds_checking_function/include          |  1 +
 .../compiler_gn/third_party/cJSON/BUILD.gn    | 25 +++++++++++++++++
 .../compiler_gn/third_party/cJSON/cJSON.h     |  1 +
 .../compiler_gn/third_party/libxml2/BUILD.gn  | 11 ++++++++
 .../third_party/libxml2/include/libxml        |  1 +
 6 files changed, 67 insertions(+)
 create mode 100644 openeuler/compiler_gn/third_party/bounds_checking_function/BUILD.gn
 create mode 120000 openeuler/compiler_gn/third_party/bounds_checking_function/include
 create mode 100644 openeuler/compiler_gn/third_party/cJSON/BUILD.gn
 create mode 120000 openeuler/compiler_gn/third_party/cJSON/cJSON.h
 create mode 100644 openeuler/compiler_gn/third_party/libxml2/BUILD.gn
 create mode 120000 openeuler/compiler_gn/third_party/libxml2/include/libxml

diff --git a/openeuler/compiler_gn/third_party/bounds_checking_function/BUILD.gn b/openeuler/compiler_gn/third_party/bounds_checking_function/BUILD.gn
new file mode 100644
index 0000000..ae44b79
--- /dev/null
+++ b/openeuler/compiler_gn/third_party/bounds_checking_function/BUILD.gn
@@ -0,0 +1,28 @@
+# Copyright (c) 2021 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")
+
+config("libsec_public_config") {
+  include_dirs = [ "include" ]
+  libs = [ "boundscheck" ]
+}
+
+ohos_static_library("libsec_static") {
+  #libs = [ "boundscheck" ]
+  all_dependent_configs = [ ":libsec_public_config" ]
+}
+
+ohos_shared_library("libsec_shared") {
+  #libs = [ "boundscheck" ]
+  all_dependent_configs = [ ":libsec_public_config" ]
+}
diff --git a/openeuler/compiler_gn/third_party/bounds_checking_function/include b/openeuler/compiler_gn/third_party/bounds_checking_function/include
new file mode 120000
index 0000000..bc414ef
--- /dev/null
+++ b/openeuler/compiler_gn/third_party/bounds_checking_function/include
@@ -0,0 +1 @@
+/usr/include/
\ No newline at end of file
diff --git a/openeuler/compiler_gn/third_party/cJSON/BUILD.gn b/openeuler/compiler_gn/third_party/cJSON/BUILD.gn
new file mode 100644
index 0000000..48864a4
--- /dev/null
+++ b/openeuler/compiler_gn/third_party/cJSON/BUILD.gn
@@ -0,0 +1,25 @@
+#Copyright (c) 2019-2021 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")
+import("//build/config/sysroot.gni")
+config("cJSON_config") {
+  include_dirs = [ "${sysroot}/usr/include/cjson" ]
+  libs = [ "cjson" ]
+}
+ohos_static_library("cjson_static") {
+  public_configs = [ ":cJSON_config" ]
+}
+ohos_shared_library("cjson") {
+  public_configs = [ ":cJSON_config" ]
+}
diff --git a/openeuler/compiler_gn/third_party/cJSON/cJSON.h b/openeuler/compiler_gn/third_party/cJSON/cJSON.h
new file mode 120000
index 0000000..a75d9ff
--- /dev/null
+++ b/openeuler/compiler_gn/third_party/cJSON/cJSON.h
@@ -0,0 +1 @@
+/usr/include/cjson/cJSON.h
\ No newline at end of file
diff --git a/openeuler/compiler_gn/third_party/libxml2/BUILD.gn b/openeuler/compiler_gn/third_party/libxml2/BUILD.gn
new file mode 100644
index 0000000..f097e1d
--- /dev/null
+++ b/openeuler/compiler_gn/third_party/libxml2/BUILD.gn
@@ -0,0 +1,11 @@
+import("//build/ohos.gni")
+import("//build/config/sysroot.gni")
+config("libxml2_private_config") {
+  include_dirs = [ "${sysroot}/usr/include/libxml2" ]
+  libs = [ "xml2" ]
+}
+
+ohos_shared_library("libxml2") {
+  public_configs = [ ":libxml2_private_config" ]
+}
+
diff --git a/openeuler/compiler_gn/third_party/libxml2/include/libxml b/openeuler/compiler_gn/third_party/libxml2/include/libxml
new file mode 120000
index 0000000..8eb8d2d
--- /dev/null
+++ b/openeuler/compiler_gn/third_party/libxml2/include/libxml
@@ -0,0 +1 @@
+/usr/include/libxml2/libxml/
\ No newline at end of file
-- 
2.33.0

