add build options
Change-Id: I6d6ecac95901f832ab76ec1bb7c7ffe2f8fcc55e
diff --git a/BUILD b/BUILD
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/BUILD
@@ -0,0 +1 @@
+# dummy
diff --git a/base/BUILD b/base/BUILD
index a9ca0e6..d61383d 100644
--- a/base/BUILD
+++ b/base/BUILD
@@ -1,6 +1,7 @@
# Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+load("//:build_config.bzl", "build_config")
cc_library(
name = "base",
@@ -13,6 +14,7 @@
"stl_util.h",
"template_util.h",
],
+ copts = build_config.default_copts,
visibility = ["//visibility:public"],
deps = [
"//build:build_config",
diff --git a/base/strings/BUILD b/base/strings/BUILD
index 60aebcf..7a06170 100644
--- a/base/strings/BUILD
+++ b/base/strings/BUILD
@@ -1,6 +1,7 @@
# Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+load("//:build_config.bzl", "build_config")
cc_library(
name = "strings",
@@ -22,6 +23,7 @@
"utf_string_conversion_utils.h",
"utf_string_conversions.h",
],
+ copts = build_config.default_copts,
visibility = ["//visibility:public"],
deps = [
"//base",
diff --git a/base/third_party/icu/BUILD b/base/third_party/icu/BUILD
index 97a033e..6bfe0c3 100644
--- a/base/third_party/icu/BUILD
+++ b/base/third_party/icu/BUILD
@@ -1,10 +1,12 @@
# Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+load("//:build_config.bzl", "build_config")
cc_library(
name = "icu",
srcs = ["icu_utf.cc"],
hdrs = ["icu_utf.h"],
+ copts = build_config.default_copts,
visibility = ["//visibility:public"],
)
diff --git a/build/BUILD b/build/BUILD
index f057fe5..429d34c 100644
--- a/build/BUILD
+++ b/build/BUILD
@@ -1,9 +1,11 @@
# Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+load("//:build_config.bzl", "build_config")
cc_library(
name = "build_config",
hdrs = ["build_config.h"],
+ copts = build_config.default_copts,
visibility = ["//visibility:public"],
)
diff --git a/build_config.bzl b/build_config.bzl
new file mode 100644
index 0000000..d5fca65
--- /dev/null
+++ b/build_config.bzl
@@ -0,0 +1,8 @@
+_default_copts = [
+ "-std=c++14",
+ "-fno-strict-aliasing",
+]
+
+build_config = struct(
+ default_copts = _default_copts,
+)
diff --git a/polyfills/BUILD b/polyfills/BUILD
index e80d717..454685b 100644
--- a/polyfills/BUILD
+++ b/polyfills/BUILD
@@ -1,6 +1,7 @@
# Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+load("//:build_config.bzl", "build_config")
cc_library(
name = "polyfills",
@@ -12,5 +13,6 @@
"base/logging.h",
"base/trace_event/memory_usage_estimator.h",
],
+ copts = build_config.default_copts,
visibility = ["//visibility:public"],
)
diff --git a/test/BUILD b/test/BUILD
index 05c578b..3653782 100644
--- a/test/BUILD
+++ b/test/BUILD
@@ -1,9 +1,11 @@
# Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+load("//:build_config.bzl", "build_config")
cc_test(
name = "basic_test",
srcs = ["basic_test.cc"],
+ copts = build_config.default_copts,
deps = ["//url"],
)
diff --git a/url/BUILD b/url/BUILD
index ec01ee3..0126bdc 100644
--- a/url/BUILD
+++ b/url/BUILD
@@ -1,6 +1,7 @@
# Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+load("//:build_config.bzl", "build_config")
cc_library(
name = "url",
@@ -41,6 +42,7 @@
"url_file.h",
"url_util.h",
],
+ copts = build_config.default_copts,
linkopts = ["-licuuc"],
visibility = ["//visibility:public"],
deps = [