diff options
author | 2018-02-08 05:26:53 -0800 | |
---|---|---|
committer | 2018-02-08 05:28:55 -0800 | |
commit | 943afc78c1170e93e154edd1ef17389bae248e6b (patch) | |
tree | 0933bf969f30849e7b09407095e73a5ac7b53440 /src/test/java/com/google/devtools | |
parent | b116240ea496b95f8846abd76f29416b0bdc9cc9 (diff) |
Introduce -c source_file -o output_file build variables
Prior to this cl CompileCommandLine would (almost) unconditionally emit -c and
-o flags. This cl removes this logic and relies on crosstool to emit these
flags. This is another small step towards platform independent C++ rules.
Memory use is not affected, since the build variables used by this cl are already
exposed, this cl just forces crosstools to use it.
Encore of https://github.com/bazelbuild/bazel/commit/f26e8694ae78599b3e2004e3360eaf3443fa53a6.
RELNOTES: None.
PiperOrigin-RevId: 184981106
Diffstat (limited to 'src/test/java/com/google/devtools')
4 files changed, 900 insertions, 13 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/packages/util/MOCK_OSX_CROSSTOOL b/src/test/java/com/google/devtools/build/lib/packages/util/MOCK_OSX_CROSSTOOL index ef439b4bc1..f4cde055c8 100644 --- a/src/test/java/com/google/devtools/build/lib/packages/util/MOCK_OSX_CROSSTOOL +++ b/src/test/java/com/google/devtools/build/lib/packages/util/MOCK_OSX_CROSSTOOL @@ -1236,6 +1236,60 @@ toolchain { } } feature { + name: "compiler_input_flags" + flag_set { + action: "assemble" + action: "preprocess-assemble" + action: "c-compile" + action: "c++-compile" + action: "linkstamp-compile" + action: "c++-header-parsing" + action: "c++-header-preprocessing" + action: "c++-module-compile" + action: "c++-module-codegen" + action: "objc-compile" + action: "objc++-compile" + flag_group { + flag: "-c" + flag: "%{source_file}" + } + expand_if_all_available: "source_file" + } + } + feature { + name: "compiler_output_flags" + flag_set { + action: "assemble" + action: "preprocess-assemble" + action: "c-compile" + action: "c++-compile" + action: "linkstamp-compile" + action: "c++-header-parsing" + action: "c++-header-preprocessing" + action: "c++-module-compile" + action: "c++-module-codegen" + action: "objc-compile" + action: "objc++-compile" + flag_group { + flag: "-o" + flag: "%{output_object_file}" + expand_if_all_available: "output_object_file" + } + flag_group { + flag: "-S" + flag: "-o" + flag: "%{output_assembly_file}" + expand_if_all_available: "output_assembly_file" + } + flag_group { + flag: "-E" + flag: "-o" + flag: "%{output_preprocess_file}" + expand_if_all_available: "output_preprocess_file" + } + } + } + feature { name: "dbg_only_flag" flag_set { action: "objc-compile" @@ -1305,6 +1359,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "c++-compile" @@ -1328,6 +1384,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "linkstamp-compile" @@ -1351,6 +1409,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "c++-module-compile" @@ -1369,6 +1429,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "c++-header-parsing" @@ -1387,6 +1449,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "c++-header-preprocessing" @@ -1405,6 +1469,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "objc-compile" @@ -1432,6 +1498,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "objc++-compile" @@ -1460,6 +1528,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "assemble" @@ -1476,6 +1546,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "preprocess-assemble" @@ -1494,6 +1566,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "objc-archive" @@ -2968,6 +3042,60 @@ toolchain { } } feature { + name: "compiler_input_flags" + flag_set { + action: "assemble" + action: "preprocess-assemble" + action: "c-compile" + action: "c++-compile" + action: "linkstamp-compile" + action: "c++-header-parsing" + action: "c++-header-preprocessing" + action: "c++-module-compile" + action: "c++-module-codegen" + action: "objc-compile" + action: "objc++-compile" + flag_group { + flag: "-c" + flag: "%{source_file}" + } + expand_if_all_available: "source_file" + } + } + feature { + name: "compiler_output_flags" + flag_set { + action: "assemble" + action: "preprocess-assemble" + action: "c-compile" + action: "c++-compile" + action: "linkstamp-compile" + action: "c++-header-parsing" + action: "c++-header-preprocessing" + action: "c++-module-compile" + action: "c++-module-codegen" + action: "objc-compile" + action: "objc++-compile" + flag_group { + flag: "-o" + flag: "%{output_object_file}" + expand_if_all_available: "output_object_file" + } + flag_group { + flag: "-S" + flag: "-o" + flag: "%{output_assembly_file}" + expand_if_all_available: "output_assembly_file" + } + flag_group { + flag: "-E" + flag: "-o" + flag: "%{output_preprocess_file}" + expand_if_all_available: "output_preprocess_file" + } + } + } + feature { name: "dbg_only_flag" flag_set { action: "objc-compile" @@ -3037,6 +3165,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "c++-compile" @@ -3060,6 +3190,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "linkstamp-compile" @@ -3083,6 +3215,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "c++-module-compile" @@ -3101,6 +3235,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "c++-header-parsing" @@ -3119,6 +3255,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "c++-header-preprocessing" @@ -3137,6 +3275,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "objc-compile" @@ -3164,6 +3304,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "objc++-compile" @@ -3192,6 +3334,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "assemble" @@ -3208,6 +3352,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "preprocess-assemble" @@ -3226,6 +3372,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "objc-archive" @@ -4695,6 +4843,60 @@ toolchain { } } feature { + name: "compiler_input_flags" + flag_set { + action: "assemble" + action: "preprocess-assemble" + action: "c-compile" + action: "c++-compile" + action: "linkstamp-compile" + action: "c++-header-parsing" + action: "c++-header-preprocessing" + action: "c++-module-compile" + action: "c++-module-codegen" + action: "objc-compile" + action: "objc++-compile" + flag_group { + flag: "-c" + flag: "%{source_file}" + } + expand_if_all_available: "source_file" + } + } + feature { + name: "compiler_output_flags" + flag_set { + action: "assemble" + action: "preprocess-assemble" + action: "c-compile" + action: "c++-compile" + action: "linkstamp-compile" + action: "c++-header-parsing" + action: "c++-header-preprocessing" + action: "c++-module-compile" + action: "c++-module-codegen" + action: "objc-compile" + action: "objc++-compile" + flag_group { + flag: "-o" + flag: "%{output_object_file}" + expand_if_all_available: "output_object_file" + } + flag_group { + flag: "-S" + flag: "-o" + flag: "%{output_assembly_file}" + expand_if_all_available: "output_assembly_file" + } + flag_group { + flag: "-E" + flag: "-o" + flag: "%{output_preprocess_file}" + expand_if_all_available: "output_preprocess_file" + } + } + } + feature { name: "dbg_only_flag" flag_set { action: "objc-compile" @@ -4764,6 +4966,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "c++-compile" @@ -4787,6 +4991,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "linkstamp-compile" @@ -4810,6 +5016,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "c++-module-compile" @@ -4828,6 +5036,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "c++-header-parsing" @@ -4846,6 +5056,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "c++-header-preprocessing" @@ -4864,6 +5076,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "objc-compile" @@ -4891,6 +5105,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "objc++-compile" @@ -4919,6 +5135,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "assemble" @@ -4935,6 +5153,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "preprocess-assemble" @@ -4953,6 +5173,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "objc-archive" @@ -6422,6 +6644,60 @@ toolchain { } } feature { + name: "compiler_input_flags" + flag_set { + action: "assemble" + action: "preprocess-assemble" + action: "c-compile" + action: "c++-compile" + action: "linkstamp-compile" + action: "c++-header-parsing" + action: "c++-header-preprocessing" + action: "c++-module-compile" + action: "c++-module-codegen" + action: "objc-compile" + action: "objc++-compile" + flag_group { + flag: "-c" + flag: "%{source_file}" + } + expand_if_all_available: "source_file" + } + } + feature { + name: "compiler_output_flags" + flag_set { + action: "assemble" + action: "preprocess-assemble" + action: "c-compile" + action: "c++-compile" + action: "linkstamp-compile" + action: "c++-header-parsing" + action: "c++-header-preprocessing" + action: "c++-module-compile" + action: "c++-module-codegen" + action: "objc-compile" + action: "objc++-compile" + flag_group { + flag: "-o" + flag: "%{output_object_file}" + expand_if_all_available: "output_object_file" + } + flag_group { + flag: "-S" + flag: "-o" + flag: "%{output_assembly_file}" + expand_if_all_available: "output_assembly_file" + } + flag_group { + flag: "-E" + flag: "-o" + flag: "%{output_preprocess_file}" + expand_if_all_available: "output_preprocess_file" + } + } + } + feature { name: "dbg_only_flag" flag_set { action: "objc-compile" @@ -6491,6 +6767,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "c++-compile" @@ -6514,6 +6792,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "linkstamp-compile" @@ -6537,6 +6817,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "c++-module-compile" @@ -6555,6 +6837,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "c++-header-parsing" @@ -6573,6 +6857,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "c++-header-preprocessing" @@ -6591,6 +6877,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "objc-compile" @@ -6618,6 +6906,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "objc++-compile" @@ -6646,6 +6936,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "assemble" @@ -6662,6 +6954,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "preprocess-assemble" @@ -6680,6 +6974,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "objc-archive" @@ -8157,6 +8453,60 @@ toolchain { } } feature { + name: "compiler_input_flags" + flag_set { + action: "assemble" + action: "preprocess-assemble" + action: "c-compile" + action: "c++-compile" + action: "linkstamp-compile" + action: "c++-header-parsing" + action: "c++-header-preprocessing" + action: "c++-module-compile" + action: "c++-module-codegen" + action: "objc-compile" + action: "objc++-compile" + flag_group { + flag: "-c" + flag: "%{source_file}" + } + expand_if_all_available: "source_file" + } + } + feature { + name: "compiler_output_flags" + flag_set { + action: "assemble" + action: "preprocess-assemble" + action: "c-compile" + action: "c++-compile" + action: "linkstamp-compile" + action: "c++-header-parsing" + action: "c++-header-preprocessing" + action: "c++-module-compile" + action: "c++-module-codegen" + action: "objc-compile" + action: "objc++-compile" + flag_group { + flag: "-o" + flag: "%{output_object_file}" + expand_if_all_available: "output_object_file" + } + flag_group { + flag: "-S" + flag: "-o" + flag: "%{output_assembly_file}" + expand_if_all_available: "output_assembly_file" + } + flag_group { + flag: "-E" + flag: "-o" + flag: "%{output_preprocess_file}" + expand_if_all_available: "output_preprocess_file" + } + } + } + feature { name: "dbg_only_flag" flag_set { action: "objc-compile" @@ -8226,6 +8576,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "c++-compile" @@ -8249,6 +8601,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "linkstamp-compile" @@ -8272,6 +8626,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "c++-module-compile" @@ -8290,6 +8646,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "c++-header-parsing" @@ -8308,6 +8666,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "c++-header-preprocessing" @@ -8326,6 +8686,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "objc-compile" @@ -8353,6 +8715,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" implies: "apply_simulator_compiler_flags" } action_config { @@ -8382,6 +8746,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" implies: "apply_simulator_compiler_flags" } action_config { @@ -8399,6 +8765,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "preprocess-assemble" @@ -8417,6 +8785,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "objc-archive" @@ -9896,6 +10266,60 @@ toolchain { } } feature { + name: "compiler_input_flags" + flag_set { + action: "assemble" + action: "preprocess-assemble" + action: "c-compile" + action: "c++-compile" + action: "linkstamp-compile" + action: "c++-header-parsing" + action: "c++-header-preprocessing" + action: "c++-module-compile" + action: "c++-module-codegen" + action: "objc-compile" + action: "objc++-compile" + flag_group { + flag: "-c" + flag: "%{source_file}" + } + expand_if_all_available: "source_file" + } + } + feature { + name: "compiler_output_flags" + flag_set { + action: "assemble" + action: "preprocess-assemble" + action: "c-compile" + action: "c++-compile" + action: "linkstamp-compile" + action: "c++-header-parsing" + action: "c++-header-preprocessing" + action: "c++-module-compile" + action: "c++-module-codegen" + action: "objc-compile" + action: "objc++-compile" + flag_group { + flag: "-o" + flag: "%{output_object_file}" + expand_if_all_available: "output_object_file" + } + flag_group { + flag: "-S" + flag: "-o" + flag: "%{output_assembly_file}" + expand_if_all_available: "output_assembly_file" + } + flag_group { + flag: "-E" + flag: "-o" + flag: "%{output_preprocess_file}" + expand_if_all_available: "output_preprocess_file" + } + } + } + feature { name: "dbg_only_flag" flag_set { action: "objc-compile" @@ -9965,6 +10389,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "c++-compile" @@ -9988,6 +10414,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "linkstamp-compile" @@ -10011,6 +10439,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "c++-module-compile" @@ -10029,6 +10459,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "c++-header-parsing" @@ -10047,6 +10479,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "c++-header-preprocessing" @@ -10065,6 +10499,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "objc-compile" @@ -10092,6 +10528,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" implies: "apply_simulator_compiler_flags" } action_config { @@ -10121,6 +10559,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" implies: "apply_simulator_compiler_flags" } action_config { @@ -10138,6 +10578,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "preprocess-assemble" @@ -10156,6 +10598,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "objc-archive" @@ -11658,6 +12102,60 @@ toolchain { } } feature { + name: "compiler_input_flags" + flag_set { + action: "assemble" + action: "preprocess-assemble" + action: "c-compile" + action: "c++-compile" + action: "linkstamp-compile" + action: "c++-header-parsing" + action: "c++-header-preprocessing" + action: "c++-module-compile" + action: "c++-module-codegen" + action: "objc-compile" + action: "objc++-compile" + flag_group { + flag: "-c" + flag: "%{source_file}" + } + expand_if_all_available: "source_file" + } + } + feature { + name: "compiler_output_flags" + flag_set { + action: "assemble" + action: "preprocess-assemble" + action: "c-compile" + action: "c++-compile" + action: "linkstamp-compile" + action: "c++-header-parsing" + action: "c++-header-preprocessing" + action: "c++-module-compile" + action: "c++-module-codegen" + action: "objc-compile" + action: "objc++-compile" + flag_group { + flag: "-o" + flag: "%{output_object_file}" + expand_if_all_available: "output_object_file" + } + flag_group { + flag: "-S" + flag: "-o" + flag: "%{output_assembly_file}" + expand_if_all_available: "output_assembly_file" + } + flag_group { + flag: "-E" + flag: "-o" + flag: "%{output_preprocess_file}" + expand_if_all_available: "output_preprocess_file" + } + } + } + feature { name: "dbg_only_flag" flag_set { action: "objc-compile" @@ -11727,6 +12225,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" implies: "unfiltered_cxx_flags" } action_config { @@ -11751,6 +12251,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" implies: "unfiltered_cxx_flags" } action_config { @@ -11775,6 +12277,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "c++-module-compile" @@ -11793,6 +12297,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" implies: "unfiltered_cxx_flags" } action_config { @@ -11812,6 +12318,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" implies: "unfiltered_cxx_flags" } action_config { @@ -11831,6 +12339,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" implies: "unfiltered_cxx_flags" } action_config { @@ -11859,6 +12369,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" implies: "apply_simulator_compiler_flags" } action_config { @@ -11888,6 +12400,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" implies: "apply_simulator_compiler_flags" } action_config { @@ -11905,6 +12419,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" implies: "unfiltered_cxx_flags" } action_config { @@ -11924,6 +12440,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" implies: "unfiltered_cxx_flags" } action_config { @@ -13402,6 +13920,60 @@ toolchain { } } feature { + name: "compiler_input_flags" + flag_set { + action: "assemble" + action: "preprocess-assemble" + action: "c-compile" + action: "c++-compile" + action: "linkstamp-compile" + action: "c++-header-parsing" + action: "c++-header-preprocessing" + action: "c++-module-compile" + action: "c++-module-codegen" + action: "objc-compile" + action: "objc++-compile" + flag_group { + flag: "-c" + flag: "%{source_file}" + } + expand_if_all_available: "source_file" + } + } + feature { + name: "compiler_output_flags" + flag_set { + action: "assemble" + action: "preprocess-assemble" + action: "c-compile" + action: "c++-compile" + action: "linkstamp-compile" + action: "c++-header-parsing" + action: "c++-header-preprocessing" + action: "c++-module-compile" + action: "c++-module-codegen" + action: "objc-compile" + action: "objc++-compile" + flag_group { + flag: "-o" + flag: "%{output_object_file}" + expand_if_all_available: "output_object_file" + } + flag_group { + flag: "-S" + flag: "-o" + flag: "%{output_assembly_file}" + expand_if_all_available: "output_assembly_file" + } + flag_group { + flag: "-E" + flag: "-o" + flag: "%{output_preprocess_file}" + expand_if_all_available: "output_preprocess_file" + } + } + } + feature { name: "dbg_only_flag" flag_set { action: "objc-compile" @@ -13471,6 +14043,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "c++-compile" @@ -13494,6 +14068,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "linkstamp-compile" @@ -13517,6 +14093,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "c++-module-compile" @@ -13535,6 +14113,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "c++-header-parsing" @@ -13553,6 +14133,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "c++-header-preprocessing" @@ -13571,6 +14153,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "objc-compile" @@ -13598,6 +14182,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" implies: "apply_simulator_compiler_flags" } action_config { @@ -13627,6 +14213,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" implies: "apply_simulator_compiler_flags" } action_config { @@ -13644,6 +14232,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "preprocess-assemble" @@ -13662,6 +14252,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "objc-archive" @@ -15161,6 +15753,60 @@ toolchain { } } feature { + name: "compiler_input_flags" + flag_set { + action: "assemble" + action: "preprocess-assemble" + action: "c-compile" + action: "c++-compile" + action: "linkstamp-compile" + action: "c++-header-parsing" + action: "c++-header-preprocessing" + action: "c++-module-compile" + action: "c++-module-codegen" + action: "objc-compile" + action: "objc++-compile" + flag_group { + flag: "-c" + flag: "%{source_file}" + } + expand_if_all_available: "source_file" + } + } + feature { + name: "compiler_output_flags" + flag_set { + action: "assemble" + action: "preprocess-assemble" + action: "c-compile" + action: "c++-compile" + action: "linkstamp-compile" + action: "c++-header-parsing" + action: "c++-header-preprocessing" + action: "c++-module-compile" + action: "c++-module-codegen" + action: "objc-compile" + action: "objc++-compile" + flag_group { + flag: "-o" + flag: "%{output_object_file}" + expand_if_all_available: "output_object_file" + } + flag_group { + flag: "-S" + flag: "-o" + flag: "%{output_assembly_file}" + expand_if_all_available: "output_assembly_file" + } + flag_group { + flag: "-E" + flag: "-o" + flag: "%{output_preprocess_file}" + expand_if_all_available: "output_preprocess_file" + } + } + } + feature { name: "dbg_only_flag" flag_set { action: "objc-compile" @@ -15230,6 +15876,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "c++-compile" @@ -15253,6 +15901,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "linkstamp-compile" @@ -15276,6 +15926,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "c++-module-compile" @@ -15294,6 +15946,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "c++-header-parsing" @@ -15312,6 +15966,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "c++-header-preprocessing" @@ -15330,6 +15986,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "objc-compile" @@ -15357,6 +16015,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "objc++-compile" @@ -15385,6 +16045,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "assemble" @@ -15401,6 +16063,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "preprocess-assemble" @@ -15419,6 +16083,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "objc-archive" @@ -16920,6 +17586,60 @@ toolchain { } } feature { + name: "compiler_input_flags" + flag_set { + action: "assemble" + action: "preprocess-assemble" + action: "c-compile" + action: "c++-compile" + action: "linkstamp-compile" + action: "c++-header-parsing" + action: "c++-header-preprocessing" + action: "c++-module-compile" + action: "c++-module-codegen" + action: "objc-compile" + action: "objc++-compile" + flag_group { + flag: "-c" + flag: "%{source_file}" + } + expand_if_all_available: "source_file" + } + } + feature { + name: "compiler_output_flags" + flag_set { + action: "assemble" + action: "preprocess-assemble" + action: "c-compile" + action: "c++-compile" + action: "linkstamp-compile" + action: "c++-header-parsing" + action: "c++-header-preprocessing" + action: "c++-module-compile" + action: "c++-module-codegen" + action: "objc-compile" + action: "objc++-compile" + flag_group { + flag: "-o" + flag: "%{output_object_file}" + expand_if_all_available: "output_object_file" + } + flag_group { + flag: "-S" + flag: "-o" + flag: "%{output_assembly_file}" + expand_if_all_available: "output_assembly_file" + } + flag_group { + flag: "-E" + flag: "-o" + flag: "%{output_preprocess_file}" + expand_if_all_available: "output_preprocess_file" + } + } + } + feature { name: "dbg_only_flag" flag_set { action: "objc-compile" @@ -16989,6 +17709,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "c++-compile" @@ -17012,6 +17734,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "linkstamp-compile" @@ -17035,6 +17759,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "c++-module-compile" @@ -17053,6 +17779,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "c++-header-parsing" @@ -17071,6 +17799,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "c++-header-preprocessing" @@ -17089,6 +17819,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "objc-compile" @@ -17116,6 +17848,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "objc++-compile" @@ -17144,6 +17878,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "assemble" @@ -17160,6 +17896,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "preprocess-assemble" @@ -17178,6 +17916,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "objc-archive" @@ -18702,6 +19442,60 @@ toolchain { } } feature { + name: "compiler_input_flags" + flag_set { + action: "assemble" + action: "preprocess-assemble" + action: "c-compile" + action: "c++-compile" + action: "linkstamp-compile" + action: "c++-header-parsing" + action: "c++-header-preprocessing" + action: "c++-module-compile" + action: "c++-module-codegen" + action: "objc-compile" + action: "objc++-compile" + flag_group { + flag: "-c" + flag: "%{source_file}" + } + expand_if_all_available: "source_file" + } + } + feature { + name: "compiler_output_flags" + flag_set { + action: "assemble" + action: "preprocess-assemble" + action: "c-compile" + action: "c++-compile" + action: "linkstamp-compile" + action: "c++-header-parsing" + action: "c++-header-preprocessing" + action: "c++-module-compile" + action: "c++-module-codegen" + action: "objc-compile" + action: "objc++-compile" + flag_group { + flag: "-o" + flag: "%{output_object_file}" + expand_if_all_available: "output_object_file" + } + flag_group { + flag: "-S" + flag: "-o" + flag: "%{output_assembly_file}" + expand_if_all_available: "output_assembly_file" + } + flag_group { + flag: "-E" + flag: "-o" + flag: "%{output_preprocess_file}" + expand_if_all_available: "output_preprocess_file" + } + } + } + feature { name: "dbg_only_flag" flag_set { action: "objc-compile" @@ -18771,6 +19565,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" implies: "unfiltered_cxx_flags" } action_config { @@ -18795,6 +19591,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" implies: "unfiltered_cxx_flags" } action_config { @@ -18819,6 +19617,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "c++-module-compile" @@ -18837,6 +19637,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" implies: "unfiltered_cxx_flags" } action_config { @@ -18856,6 +19658,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" implies: "unfiltered_cxx_flags" } action_config { @@ -18875,6 +19679,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" implies: "unfiltered_cxx_flags" } action_config { @@ -18903,6 +19709,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "objc++-compile" @@ -18931,6 +19739,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "assemble" @@ -18947,6 +19757,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" implies: "unfiltered_cxx_flags" } action_config { @@ -18966,6 +19778,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" implies: "unfiltered_cxx_flags" } action_config { @@ -20466,6 +21280,60 @@ toolchain { } } feature { + name: "compiler_input_flags" + flag_set { + action: "assemble" + action: "preprocess-assemble" + action: "c-compile" + action: "c++-compile" + action: "linkstamp-compile" + action: "c++-header-parsing" + action: "c++-header-preprocessing" + action: "c++-module-compile" + action: "c++-module-codegen" + action: "objc-compile" + action: "objc++-compile" + flag_group { + flag: "-c" + flag: "%{source_file}" + } + expand_if_all_available: "source_file" + } + } + feature { + name: "compiler_output_flags" + flag_set { + action: "assemble" + action: "preprocess-assemble" + action: "c-compile" + action: "c++-compile" + action: "linkstamp-compile" + action: "c++-header-parsing" + action: "c++-header-preprocessing" + action: "c++-module-compile" + action: "c++-module-codegen" + action: "objc-compile" + action: "objc++-compile" + flag_group { + flag: "-o" + flag: "%{output_object_file}" + expand_if_all_available: "output_object_file" + } + flag_group { + flag: "-S" + flag: "-o" + flag: "%{output_assembly_file}" + expand_if_all_available: "output_assembly_file" + } + flag_group { + flag: "-E" + flag: "-o" + flag: "%{output_preprocess_file}" + expand_if_all_available: "output_preprocess_file" + } + } + } + feature { name: "dbg_only_flag" flag_set { action: "objc-compile" @@ -20535,6 +21403,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "c++-compile" @@ -20558,6 +21428,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "linkstamp-compile" @@ -20581,6 +21453,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "c++-module-compile" @@ -20599,6 +21473,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "c++-header-parsing" @@ -20617,6 +21493,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "c++-header-preprocessing" @@ -20635,6 +21513,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "objc-compile" @@ -20662,6 +21542,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "objc++-compile" @@ -20690,6 +21572,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "assemble" @@ -20706,6 +21590,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "preprocess-assemble" @@ -20724,6 +21610,8 @@ toolchain { implies: "user_compile_flags" implies: "sysroot" implies: "unfiltered_compile_flags" + implies: "compiler_input_flags" + implies: "compiler_output_flags" } action_config { config_name: "objc-archive" diff --git a/src/test/java/com/google/devtools/build/lib/rules/ToolchainTypeTest.java b/src/test/java/com/google/devtools/build/lib/rules/ToolchainTypeTest.java index 86170607d1..70fe4e0ee5 100644 --- a/src/test/java/com/google/devtools/build/lib/rules/ToolchainTypeTest.java +++ b/src/test/java/com/google/devtools/build/lib/rules/ToolchainTypeTest.java @@ -125,7 +125,7 @@ public class ToolchainTypeTest extends BuildViewTestCase { .write(); CppCompileAction compileAction = (CppCompileAction) getGeneratingAction(getBinArtifact("_objs/cclib/cclib/a.o", cclibrary)); - assertThat(compileAction.getArgv()).contains("foobarpiii"); + assertThat(compileAction.getArguments()).contains("foobarpiii"); ConfiguredTarget ccbinary = ScratchAttributeWriter.fromLabelString(this, "cc_binary", "//ccbin") @@ -134,7 +134,7 @@ public class ToolchainTypeTest extends BuildViewTestCase { .write(); compileAction = (CppCompileAction) getGeneratingAction(getBinArtifact("_objs/ccbin/ccbin/a.o", ccbinary)); - assertThat(compileAction.getArgv()).contains("foobarpiii"); + assertThat(compileAction.getArguments()).contains("foobarpiii"); ConfiguredTarget cctest = ScratchAttributeWriter.fromLabelString(this, "cc_test", "//cctest") @@ -143,6 +143,6 @@ public class ToolchainTypeTest extends BuildViewTestCase { .write(); compileAction = (CppCompileAction) getGeneratingAction(getBinArtifact("_objs/cctest/cctest/a.o", cctest)); - assertThat(compileAction.getArgv()).contains("foobarpiii"); + assertThat(compileAction.getArguments()).contains("foobarpiii"); } } diff --git a/src/test/java/com/google/devtools/build/lib/rules/cpp/CcCommonTest.java b/src/test/java/com/google/devtools/build/lib/rules/cpp/CcCommonTest.java index 644761235e..20ffd4015e 100644 --- a/src/test/java/com/google/devtools/build/lib/rules/cpp/CcCommonTest.java +++ b/src/test/java/com/google/devtools/build/lib/rules/cpp/CcCommonTest.java @@ -376,19 +376,19 @@ public class CcCommonTest extends BuildViewTestCase { " srcs = [ 'library.cc' ],", " nocopts = '-fPIC')"); - assertThat(getCppCompileAction("//a:pic").getArgv()).contains("-fPIC"); - assertThat(getCppCompileAction("//a:libpic.so").getArgv()).contains("-fPIC"); - assertThat(getCppCompileAction("//a:piclib").getArgv()).contains("-fPIC"); - assertThat(getCppCompileAction("//a:nopic").getArgv()).doesNotContain("-fPIC"); - assertThat(getCppCompileAction("//a:libnopic.so").getArgv()).doesNotContain("-fPIC"); - assertThat(getCppCompileAction("//a:nopiclib").getArgv()).doesNotContain("-fPIC"); + assertThat(getCppCompileAction("//a:pic").getArguments()).contains("-fPIC"); + assertThat(getCppCompileAction("//a:libpic.so").getArguments()).contains("-fPIC"); + assertThat(getCppCompileAction("//a:piclib").getArguments()).contains("-fPIC"); + assertThat(getCppCompileAction("//a:nopic").getArguments()).doesNotContain("-fPIC"); + assertThat(getCppCompileAction("//a:libnopic.so").getArguments()).doesNotContain("-fPIC"); + assertThat(getCppCompileAction("//a:nopiclib").getArguments()).doesNotContain("-fPIC"); } @Test public void testPicModeAssembly() throws Exception { useConfiguration("--cpu=k8"); scratch.file("a/BUILD", "cc_library(name='preprocess', srcs=['preprocess.S'])"); - List<String> argv = getCppCompileAction("//a:preprocess").getArgv(); + List<String> argv = getCppCompileAction("//a:preprocess").getArguments(); assertThat(argv).contains("-fPIC"); } diff --git a/src/test/java/com/google/devtools/build/lib/rules/cpp/CompileCommandLineTest.java b/src/test/java/com/google/devtools/build/lib/rules/cpp/CompileCommandLineTest.java index 513b64269a..7622fb3f03 100644 --- a/src/test/java/com/google/devtools/build/lib/rules/cpp/CompileCommandLineTest.java +++ b/src/test/java/com/google/devtools/build/lib/rules/cpp/CompileCommandLineTest.java @@ -91,7 +91,7 @@ public class CompileCommandLineTest extends BuildViewTestCase { " }", "}")) .build(); - assertThat(compileCommandLine.getArgv(scratchArtifact("a/FakeOutput").getExecPath(), null)) + assertThat(compileCommandLine.getArguments(/* overwrittenVariables= */ null)) .contains("-some_foo_flag"); } @@ -133,13 +133,12 @@ public class CompileCommandLineTest extends BuildViewTestCase { "}")) .setCoptsFilter(CoptsFilter.fromRegex(Pattern.compile(".*i_am_a_flag.*"))) .build(); - return compileCommandLine.getArgv(scratchArtifact("a/FakeOutput").getExecPath(), null); + return compileCommandLine.getArguments(/* overwrittenVariables= */ null); } private Builder makeCompileCommandLineBuilder() throws Exception { return CompileCommandLine.builder( scratchArtifact("a/FakeInput"), - scratchArtifact("a/FakeOutput"), CoptsFilter.alwaysPasses(), "c++-compile", getTargetConfiguration().getFragment(CppConfiguration.class).getCrosstoolTopPathFragment(), |