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

Side by Side Diff: tools/gn/variables.cc

Issue 1621053002: Add an assert_no_deps variable to GN. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comment fix Created 4 years, 11 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 unified diff | Download patch
« no previous file with comments | « tools/gn/variables.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "tools/gn/variables.h" 5 #include "tools/gn/variables.h"
6 6
7 namespace variables { 7 namespace variables {
8 8
9 // Built-in variables ---------------------------------------------------------- 9 // Built-in variables ----------------------------------------------------------
10 10
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 "args: [string list] Arguments passed to an action."; 384 "args: [string list] Arguments passed to an action.";
385 const char kArgs_Help[] = 385 const char kArgs_Help[] =
386 "args: Arguments passed to an action.\n" 386 "args: Arguments passed to an action.\n"
387 "\n" 387 "\n"
388 " For action and action_foreach targets, args is the list of arguments\n" 388 " For action and action_foreach targets, args is the list of arguments\n"
389 " to pass to the script. Typically you would use source expansion (see\n" 389 " to pass to the script. Typically you would use source expansion (see\n"
390 " \"gn help source_expansion\") to insert the source file names.\n" 390 " \"gn help source_expansion\") to insert the source file names.\n"
391 "\n" 391 "\n"
392 " See also \"gn help action\" and \"gn help action_foreach\".\n"; 392 " See also \"gn help action\" and \"gn help action_foreach\".\n";
393 393
394 const char kAssertNoDeps[] = "assert_no_deps";
395 const char kAssertNoDeps_HelpShort[] =
396 "assert_no_deps: [label pattern list] Ensure no deps on these targets.";
397 const char kAssertNoDeps_Help[] =
398 "assert_no_deps: Ensure no deps on these targets.\n"
399 "\n"
400 " A list of label patterns.\n"
401 "\n"
402 " This list is a list of patterns that must not match any of the\n"
403 " transitive dependencies of the target. These include all public,\n"
404 " private, and data dependencies, and cross shared library boundaries.\n"
405 " This allows you to express that undesirable code isn't accidentally\n"
406 " added to downstream dependencies in a way that might otherwise be\n"
407 " difficult to notice.\n"
408 "\n"
409 " Checking does not cross executable boundaries. If a target depends on\n"
410 " an executable, it's assumed that the executable is a tool that is\n"
411 " producing part of the build rather than something that is linked and\n"
412 " distributed. This allows assert_no_deps to express what is distributed\n"
413 " in the final target rather than depend on the internal build steps\n"
414 " (which may include non-distributable code).\n"
415 "\n"
416 " See \"gn help label_pattern\" for the format of the entries in the\n"
417 " list. These patterns allow blacklisting individual targets or whole\n"
418 " directory hierarchies.\n"
419 "\n"
420 " Sometimes it is desirable to enforce that many targets have no\n"
421 " dependencies on a target or set of targets. One efficient way to\n"
422 " express this is to create a group with the assert_no_deps rule on\n"
423 " it, and make that group depend on all targets you want to apply that\n"
424 " assertion to.\n"
425 "\n"
426 "Example\n"
427 "\n"
428 " executable(\"doom_melon\") {\n"
429 " deps = [ \"//foo:bar\" ]\n"
430 " ...\n"
431 " assert_no_deps = [\n"
432 " \"//evil/*\", # Don't link any code from the evil directory.\n"
433 " \"//foo:test_support\", # This target is also disallowed.\n"
434 " ]\n"
435 " }\n";
436
394 const char kCflags[] = "cflags"; 437 const char kCflags[] = "cflags";
395 const char kCflags_HelpShort[] = 438 const char kCflags_HelpShort[] =
396 "cflags: [string list] Flags passed to all C compiler variants."; 439 "cflags: [string list] Flags passed to all C compiler variants.";
397 const char kCommonCflagsHelp[] = 440 const char kCommonCflagsHelp[] =
398 "cflags*: Flags passed to the C compiler.\n" 441 "cflags*: Flags passed to the C compiler.\n"
399 "\n" 442 "\n"
400 " A list of strings.\n" 443 " A list of strings.\n"
401 "\n" 444 "\n"
402 " \"cflags\" are passed to all invocations of the C, C++, Objective C,\n" 445 " \"cflags\" are passed to all invocations of the C, C++, Objective C,\n"
403 " and Objective C++ compilers.\n" 446 " and Objective C++ compilers.\n"
(...skipping 989 matching lines...) Expand 10 before | Expand all | Expand 10 after
1393 return info_map; 1436 return info_map;
1394 } 1437 }
1395 1438
1396 const VariableInfoMap& GetTargetVariables() { 1439 const VariableInfoMap& GetTargetVariables() {
1397 static VariableInfoMap info_map; 1440 static VariableInfoMap info_map;
1398 if (info_map.empty()) { 1441 if (info_map.empty()) {
1399 INSERT_VARIABLE(AllDependentConfigs) 1442 INSERT_VARIABLE(AllDependentConfigs)
1400 INSERT_VARIABLE(AllowCircularIncludesFrom) 1443 INSERT_VARIABLE(AllowCircularIncludesFrom)
1401 INSERT_VARIABLE(Args) 1444 INSERT_VARIABLE(Args)
1402 INSERT_VARIABLE(Asmflags) 1445 INSERT_VARIABLE(Asmflags)
1446 INSERT_VARIABLE(AssertNoDeps)
1403 INSERT_VARIABLE(Cflags) 1447 INSERT_VARIABLE(Cflags)
1404 INSERT_VARIABLE(CflagsC) 1448 INSERT_VARIABLE(CflagsC)
1405 INSERT_VARIABLE(CflagsCC) 1449 INSERT_VARIABLE(CflagsCC)
1406 INSERT_VARIABLE(CflagsObjC) 1450 INSERT_VARIABLE(CflagsObjC)
1407 INSERT_VARIABLE(CflagsObjCC) 1451 INSERT_VARIABLE(CflagsObjCC)
1408 INSERT_VARIABLE(CheckIncludes) 1452 INSERT_VARIABLE(CheckIncludes)
1409 INSERT_VARIABLE(CompleteStaticLib) 1453 INSERT_VARIABLE(CompleteStaticLib)
1410 INSERT_VARIABLE(Configs) 1454 INSERT_VARIABLE(Configs)
1411 INSERT_VARIABLE(Console) 1455 INSERT_VARIABLE(Console)
1412 INSERT_VARIABLE(Data) 1456 INSERT_VARIABLE(Data)
(...skipping 19 matching lines...) Expand all
1432 INSERT_VARIABLE(Sources) 1476 INSERT_VARIABLE(Sources)
1433 INSERT_VARIABLE(Testonly) 1477 INSERT_VARIABLE(Testonly)
1434 INSERT_VARIABLE(Visibility) 1478 INSERT_VARIABLE(Visibility)
1435 } 1479 }
1436 return info_map; 1480 return info_map;
1437 } 1481 }
1438 1482
1439 #undef INSERT_VARIABLE 1483 #undef INSERT_VARIABLE
1440 1484
1441 } // namespace variables 1485 } // namespace variables
OLDNEW
« no previous file with comments | « tools/gn/variables.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698