aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/cpp/CppRuleClasses.java
diff options
context:
space:
mode:
authorGravatar Manuel Klimek <klimek@google.com>2015-10-06 13:59:57 +0000
committerGravatar Lukacs Berki <lberki@google.com>2015-10-07 07:08:49 +0000
commitdf593e90a34dc379d1c762ee8ef83bc0207c130d (patch)
tree56dcb3892b1fc28fae752aaf67ce7adb45831422 /src/main/java/com/google/devtools/build/lib/rules/cpp/CppRuleClasses.java
parent6f9a1f8dd4b06fdbfae8edb0b9b9b40852bc65fb (diff)
Add a feature to require explicitly passing module maps.
Currently, module maps contain both "use <module>" entries that specify which modules the current module map depends on, and "extern module" entries that provide paths where to load the dependent module maps from. This change adds a feature "module_map_without_extern_module", which instructs blaze to not write the "extern module" entries into the module map. Instead, the crosstool needs to add -fmodule-file flags for each dependent module file where needed for the compile via the new build variable "dependent_module_map_files". Note that the feature is phrased negatively ("_without_") in order to simplify the roll-out of this feature: as long as crosstools do not specify any features, they still want the old behavior. We cannot make the feature positive and add it to the legacy configuration, as we currently cannot remove features that have already been set in the crosstool file. -- MOS_MIGRATED_REVID=104757413
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/cpp/CppRuleClasses.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/cpp/CppRuleClasses.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppRuleClasses.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppRuleClasses.java
index b7bfaf85ef..77a9719923 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppRuleClasses.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppRuleClasses.java
@@ -101,6 +101,18 @@ public class CppRuleClasses {
public static final String MODULE_MAP_HOME_CWD = "module_map_home_cwd";
/**
+ * A string constant for the module_map_without_extern_module feature.
+ *
+ * <p>This features is a transitional feature; enabling it means that generated module maps
+ * will not have "extern module" declarations inside them; instead, the module maps need
+ * to be passed via the dependent_module_map_files build variable.
+ *
+ * <p>This variable is phrased negatively to aid the roll-out: currently, the default is that
+ * "extern module" declarations are generated.
+ */
+ public static final String MODULE_MAP_WITHOUT_EXTERN_MODULE = "module_map_without_extern_module";
+
+ /**
* A string constant for the layering_check feature.
*/
public static final String LAYERING_CHECK = "layering_check";