aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Laurent Le Brun <laurentlb@google.com>2015-05-22 13:44:06 +0000
committerGravatar Kristina Chodorow <kchodorow@google.com>2015-05-22 19:59:57 +0000
commit91d870e65de28e92b03b518b41afdf659ce832ac (patch)
treeeeb9148b55c0d09b60bc82a1b1c773d6d3e44980 /src
parent34a2de682430ae8c3a5e70d8146e821b8709764d (diff)
Expose more CppConfiguration functions to Skylark.
-- MOS_MIGRATED_REVID=94274156
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java27
1 files changed, 26 insertions, 1 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java
index e0860644f8..10ba9c8f37 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java
@@ -1143,6 +1143,10 @@ public class CppConfiguration extends BuildConfiguration.Fragment {
* different sysroots, or the sysroot is the same as the default sysroot, then
* this method returns <code>null</code>.
*/
+ @SkylarkCallable(name = "sysroot", structField = true,
+ doc = "Returns the sysroot to be used. If the toolchain compiler does not support "
+ + "different sysroots, or the sysroot is the same as the default sysroot, then "
+ + "this method returns <code>None</code>.")
public PathFragment getSysroot() {
return sysroot;
}
@@ -1160,8 +1164,13 @@ public class CppConfiguration extends BuildConfiguration.Fragment {
* Returns the default options to use for compiling C, C++, and assembler.
* This is just the options that should be used for all three languages.
* There may be additional C-specific or C++-specific options that should be used,
- * in addition to the ones returned by this method;
+ * in addition to the ones returned by this method.
*/
+ @SkylarkCallable(name = "compiler_options",
+ doc = "Returns the default options to use for compiling C, C++, and assembler. "
+ + "This is just the options that should be used for all three languages. "
+ + "There may be additional C-specific or C++-specific options that should be used, "
+ + "in addition to the ones returned by this method")
public List<String> getCompilerOptions(Collection<String> features) {
return compilerFlags.evaluate(features);
}
@@ -1171,6 +1180,10 @@ public class CppConfiguration extends BuildConfiguration.Fragment {
* C. These should be go on the command line after the common options
* returned by {@link #getCompilerOptions}.
*/
+ @SkylarkCallable(name = "c_options", structField = true,
+ doc = "Returns the list of additional C-specific options to use for compiling C. "
+ + "These should be go on the command line after the common options returned by "
+ + "<code>compiler_options</code>")
public List<String> getCOptions() {
return cOptions;
}
@@ -1180,6 +1193,10 @@ public class CppConfiguration extends BuildConfiguration.Fragment {
* C++. These should be go on the command line after the common options
* returned by {@link #getCompilerOptions}.
*/
+ @SkylarkCallable(name = "cxx_options",
+ doc = "Returns the list of additional C++-specific options to use for compiling C++. "
+ + "These should be go on the command line after the common options returned by "
+ + "<code>compiler_options</code>")
public List<String> getCxxOptions(Collection<String> features) {
return cxxFlags.evaluate(features);
}
@@ -1188,6 +1205,9 @@ public class CppConfiguration extends BuildConfiguration.Fragment {
* Returns the default list of options which cannot be filtered by BUILD
* rules. These should be appended to the command line after filtering.
*/
+ @SkylarkCallable(name = "unfiltered_compiler_options",
+ doc = "Returns the default list of options which cannot be filtered by BUILD "
+ + "rules. These should be appended to the command line after filtering.")
public List<String> getUnfilteredCompilerOptions(Collection<String> features) {
return unfilteredCompilerFlags.evaluate(features);
}
@@ -1199,6 +1219,9 @@ public class CppConfiguration extends BuildConfiguration.Fragment {
* @see Link
*/
// TODO(bazel-team): Clean up the linker options computation!
+ @SkylarkCallable(name = "link_options", structField = true,
+ doc = "Returns the set of command-line linker options, including any flags "
+ + "inferred from the command-line options.")
public List<String> getLinkOptions() {
return linkOptions;
}
@@ -1647,6 +1670,8 @@ public class CppConfiguration extends BuildConfiguration.Fragment {
/**
* Returns the GNU System Name
*/
+ @SkylarkCallable(name = "target_gnu_system_name", structField = true,
+ doc = "The GNU System Name.")
public String getTargetGnuSystemName() {
return targetSystemName;
}