diff options
author | lberki <lberki@google.com> | 2017-08-28 17:07:13 +0200 |
---|---|---|
committer | Vladimir Moskva <vladmos@google.com> | 2017-08-28 17:56:24 +0200 |
commit | a328f61a645304e88bb0c02c91a1bf6948530776 (patch) | |
tree | f136bb6328fb0128ccad7434ca3279fc9cfa2378 /src/main | |
parent | 37af5d531cdd052e5a0d313e2474c32c1c79b3d3 (diff) |
Add a --output_directory_suffix command line option to facilitate the removal of the C++ toolchain identifier from the output path.
RELNOTES: None.
PiperOrigin-RevId: 166705005
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java | 12 | ||||
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/cpp/CppOptions.java | 13 |
2 files changed, 23 insertions, 2 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 56ed29d4dd..a36781773f 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 @@ -1874,8 +1874,16 @@ public class CppConfiguration extends BuildConfiguration.Fragment { } else { lipoSuffix = ""; } - String toolchainPrefix = toolchainIdInOutputDirectory - ? toolchainIdentifier : desiredCpu; + String toolchainPrefix; + if (toolchainIdInOutputDirectory) { + toolchainPrefix = toolchainIdentifier; + } else { + toolchainPrefix = desiredCpu; + if (!cppOptions.outputDirectoryTag.isEmpty()) { + toolchainPrefix += "-" + cppOptions.outputDirectoryTag; + } + } + return toolchainPrefix + lipoSuffix; } diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppOptions.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppOptions.java index fec5f442d9..371d57cad6 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppOptions.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppOptions.java @@ -151,6 +151,19 @@ public class CppOptions extends FragmentOptions { ) public String cppCompiler; + // This is different from --platform_suffix in that that one is designed to facilitate the + // migration to toolchains and this one is designed to eliminate the C++ toolchain identifier + // form the output directory path. + @Option( + name = "cc_output_directory_tag", + defaultValue = "", + category = "misc", + documentationCategory = OptionDocumentationCategory.UNCATEGORIZED, + effectTags = {OptionEffectTag.UNKNOWN}, + help = "Specifies a suffix to be added to the configuration directory." + ) + public String outputDirectoryTag; + @Option( name = "glibc", defaultValue = "null", |