diff --git a/BUILD.gn b/BUILD.gn index 3805e4eff909813fa4c2edcf08f4fd212cbf1dd0..015f9ee81b11c920e436a6699b3564f544e2f817 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -11,6 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. import("//build/ohos.gni") +import("//third_party/cares/cares.gni") declare_args() { netstack_feature_http3 = false @@ -187,6 +188,28 @@ is_cares_on = !is_mingw && !is_mac && current_os != "ios" && host_os != "mac" && current_os != "mac" print("Build curl is_cares_on: $is_cares_on") +cares_src_path = "//third_party/cares" +cares_path = root_out_dir + "/third_party_cares" +cares_code_dir = cares_path + "/c-ares-1.18.1" + +action("installOpenEulerCares") { + print("Cares install") + script = "//third_party/cares/install.sh" + args = [ + rebase_path(cares_src_path, root_build_dir), + rebase_path(cares_path, root_build_dir), + ] + inputs = [ cares_src_path ] + outputs = [] + foreach(src, cares_srcs) { + outputs += [ "$cares_code_dir/src/lib/" + src ] + } + foreach(test, sources_test) { + outputs += [ "$cares_code_dir/" + test ] + } +} + + if (defined(ohos_lite)) { import("//build/lite/config/component/lite_component.gni") @@ -432,7 +455,7 @@ if (defined(ohos_lite)) { ] if (is_cares_on) { - deps += [ "//third_party/cares:c_ares" ] + external_deps = [ "netstack:c_ares" ] defines = [ "USE_ARES" ] } } @@ -589,7 +612,7 @@ if (defined(ohos_lite)) { } } if (is_cares_on) { - deps += [ "//third_party/cares:c_ares" ] + external_deps = [ "netstack:c_ares" ] defines = [ "USE_ARES" ] } diff --git a/bundle.json b/bundle.json index 126c4e6795be0076a1d9922e8eff9b33e583b7f5..44c7e792cc59e8eb6715ec18e68694530a19578b 100644 --- a/bundle.json +++ b/bundle.json @@ -22,12 +22,13 @@ "rom": "", "ram": "", "deps": { - "components": [], + "components": [ + "netstack" + ], "third_party": [ "nghttp2", "openssl", - "zlib", - "cares" + "zlib" ] }, "build": {