naiveproxy/src/url/BUILD.gn
2024-08-18 16:08:12 +08:00

119 lines
2.7 KiB
Plaintext

# Copyright 2013 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/buildflag_header.gni")
import("features.gni")
import("//build/config/cronet/config.gni")
import("//third_party/jni_zero/jni_zero.gni")
if (is_android) {
import("//build/config/android/rules.gni")
}
buildflag_header("buildflags") {
header = "buildflags.h"
flags = [ "USE_PLATFORM_ICU_ALTERNATIVES=$use_platform_icu_alternatives" ]
}
component("url") {
sources = [
"gurl.cc",
"gurl.h",
"origin.cc",
"origin.h",
"scheme_host_port.cc",
"scheme_host_port.h",
"third_party/mozilla/url_parse.cc",
"third_party/mozilla/url_parse.h",
"url_canon.cc",
"url_canon.h",
"url_canon_etc.cc",
"url_canon_filesystemurl.cc",
"url_canon_fileurl.cc",
"url_canon_host.cc",
"url_canon_internal.cc",
"url_canon_internal.h",
"url_canon_internal_file.h",
"url_canon_ip.cc",
"url_canon_ip.h",
"url_canon_mailtourl.cc",
"url_canon_non_special_url.cc",
"url_canon_path.cc",
"url_canon_pathurl.cc",
"url_canon_query.cc",
"url_canon_relative.cc",
"url_canon_stdstring.cc",
"url_canon_stdstring.h",
"url_canon_stdurl.cc",
"url_constants.h",
"url_features.cc",
"url_features.h",
"url_file.h",
"url_parse_file.cc",
"url_parse_internal.h",
"url_util.cc",
"url_util.h",
"url_util_internal.h",
]
defines = [ "IS_URL_IMPL" ]
deps = []
public_deps = [
"//base",
"//build:robolectric_buildflags",
]
configs += [ "//build/config/compiler:wexit_time_destructors" ]
if (is_android || is_robolectric) {
deps += [ ":url_jni_headers" ]
if (!is_cronet_build) {
sources += [
"android/gurl_android.cc",
"android/gurl_android.h",
"android/origin_android.cc",
"android/parsed_android.cc",
"android/parsed_android.h",
]
}
}
if (is_robolectric) {
# Make jni.h available.
public_configs = [ "//third_party/jdk" ]
}
if (is_win) {
# Don't conflict with Windows' "url.dll".
output_name = "url_lib"
}
# ICU support.
if (use_platform_icu_alternatives) {
if (is_android) {
sources += [ "url_idna_icu_alternatives_android.cc" ]
deps += [ ":buildflags" ]
} else if (is_ios) {
sources += [ "url_idna_icu_alternatives_ios.mm" ]
} else {
assert(false,
"ICU alternative is not implemented for platform: " + target_os)
}
} else {
# Use ICU.
sources += [
"url_canon_icu.cc",
"url_canon_icu.h",
"url_idna_icu.cc",
]
deps += [
"//base:i18n",
"//third_party/icu",
]
}
}