Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Unified Diff: tools/gn/secondary/build/config/compiler/BUILD.gn

Issue 21114002: Add initial prototype for the GN meta-buildsystem. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add owners and readme Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/gn/secondary/build/config/BUILDCONFIG.gn ('k') | tools/gn/secondary/build/config/win/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/secondary/build/config/compiler/BUILD.gn
diff --git a/tools/gn/secondary/build/config/compiler/BUILD.gn b/tools/gn/secondary/build/config/compiler/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..04878281ab15debc2d767c5e5e23060a901982be
--- /dev/null
+++ b/tools/gn/secondary/build/config/compiler/BUILD.gn
@@ -0,0 +1,134 @@
+# Copyright (c) 2013 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.
+
+# runtime_library -------------------------------------------------------------
+#
+# Sets the runtime library and associated options.
+#
+# We don't bother making multiple versions that are toggle-able since there
+# is more than one axis of control (which makes it complicated) and there's
+# no practical reason for anybody to change this since the CRT must agree.
+
+config("runtime_library") {
+ if (is_component_build) {
+ # Component mode: dynamic CRT.
+ defines = [ "COMPONENT_BUILD" ]
+ if (is_win) {
+ # Since the library is shared, it requires exceptions or will give errors
+ # about things not matching, so keep exceptions on.
+ if (is_debug) {
+ cflags = [ "/MDd" ]
+ } else {
+ cflags = [ "/MD" ]
+ }
+ }
+ } else {
+ # Static CRT.
+ if (is_win) {
+ # We don't use exceptions, and when we link statically we can just get
+ # rid of them entirely.
+ defines = [ "_HAS_EXCEPTIONS=0" ]
+ if (is_debug) {
+ cflags = [ "/MTd" ]
+ } else {
+ cflags = [ "/MT" ]
+ }
+ }
+ }
+
+ if (is_win) {
+ defines += [
+ "__STD_C",
+ "__STDC_CONSTANT_MACROS",
+ "__STDC_FORMAT_MACROS",
+ "_CRT_RAND_S",
+ "_CRT_SECURE_NO_DEPRECATE",
+ "_SCL_SECURE_NO_DEPRECATE",
+ "_UNICODE",
+ "UNICODE",
+ ]
+ }
+}
+
+# chromium_code ---------------------------------------------------------------
+#
+# Toggles between higher and lower warnings for code that is (or isn't)
+# part of Chromium.
+
+config("chromium_code") {
+ if (is_win) {
+ cflags = [
+ "/W4", # Warning level 4.
+ ]
+ }
+}
+config("no_chromium_code") {
+ if (is_win) {
+ cflags = [
+ "/W3", # Warning level 3.
+ "/wd4800", # Disable warning when forcing value to bool.
+ ]
+ defines = [
+ "_CRT_NONSTDC_NO_WARNINGS",
+ "_CRT_NONSTDC_NO_DEPRECATE",
+ ]
+ }
+}
+
+# rtti ------------------------------------------------------------------------
+#
+# Allows turning Run-Time Type Identification on or off.
+
+config("rtti") {
+ if (is_win) {
+ cflags = [ "/GR" ]
+ }
+}
+config("no_rtti") {
+ if (is_win) {
+ cflags = [ "/GR-" ]
+ }
+}
+
+# Warnings ---------------------------------------------------------------------
+
+config("disable_annoying_warnings") {
+ if (is_win) {
+ # Please keep ordered and add names if you add more.
+ cflags = [
+ "/wd4018", # Comparing signed and unsigned values.
+ "/wd4100", # Unreferenced formal function parameter.
+ "/wd4121", # Alignment of a member was sensitive to packing.
+ "/wd4125", # Decimal digit terminates octal escape sequence.
+ "/wd4127", # Conditional expression is constant.
+ "/wd4130", # Logical operation on address of string constant.
+ # TODO(brettw) is this necessary? If so, it should probably be on whoever
+ # is silly enough to be doing this rather than globally.
+ #"/wd4131", # Function uses old-style declarator.
+ "/wd4189", # A variable was declared and initialized but never used.
+ "/wd4201", # Nonstandard extension used: nameless struct/union.
+ "/wd4238", # Nonstandard extension used: class rvalue used as lvalue.
+ "/wd4244", # Conversion: possible loss of data.
+ "/wd4245", # Conversion: signed/unsigned mismatch,
+ "/wd4251", # Class needs to have dll-interface.
+ "/wd4310", # Cast truncates constant value.
+ "/wd4351", # Elements of array will be default initialized.
+ "/wd4355", # 'this' used in base member initializer list.
+ "/wd4396", # Inline friend template thing.
+ "/wd4428", # Universal character name encountered in source.
+ "/wd4481", # Nonstandard extension: override specifier.
+ "/wd4503", # Decorated name length exceeded, name was truncated.
+ "/wd4505", # Unreferenced local function has been removed.
+ "/wd4510", # Default constructor could not be generated.
+ "/wd4512", # Assignment operator could not be generated.
+ "/wd4530", # Exception handler used, but unwind semantics not enabled.
+ "/wd4610", # Class can never be instantiated, constructor required.
+ "/wd4611", # C++ object destruction and 'catch'.
+ "/wd4701", # Potentially uninitialized local variable name used.
+ "/wd4702", # Unreachable code.
+ "/wd4706", # Assignment within conditional expression.
+ "/wd4819", # Character not in the current code page.
+ ]
+ }
+}
« no previous file with comments | « tools/gn/secondary/build/config/BUILDCONFIG.gn ('k') | tools/gn/secondary/build/config/win/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698