naiveproxy/src/url/BUILD.gn
2024-01-19 23:07:20 +08:00

99 lines
2.2 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 || is_robolectric) {
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_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.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 = [ "//base/third_party/dynamic_annotations" ]
public_deps = [
"//base",
"//build:robolectric_buildflags",
]
configs += [ "//build/config/compiler:wexit_time_destructors" ]
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_canon_icu_alternatives_dummy.cc" ]
} else if (is_ios) {
sources += [ "url_idna_icu_alternatives_ios.mm" ]
} else {
sources += [ "url_canon_icu_alternatives_dummy.cc" ]
}
} else {
# Use ICU.
sources += [
"url_canon_icu.cc",
"url_canon_icu.h",
"url_idna_icu.cc",
]
deps += [
"//base:i18n",
"//third_party/icu",
]
}
}