diff options
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/packages/util/BazelMockCcSupport.java')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/packages/util/BazelMockCcSupport.java | 121 |
1 files changed, 101 insertions, 20 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/packages/util/BazelMockCcSupport.java b/src/test/java/com/google/devtools/build/lib/packages/util/BazelMockCcSupport.java index f9b07d209d..ecd0814de1 100644 --- a/src/test/java/com/google/devtools/build/lib/packages/util/BazelMockCcSupport.java +++ b/src/test/java/com/google/devtools/build/lib/packages/util/BazelMockCcSupport.java @@ -102,6 +102,16 @@ public final class BazelMockCcSupport extends MockCcSupport { " module_map = 'crosstool.cppmap', supports_header_parsing = 1,", " objcopy_files = ':empty', static_runtime_libs = [':empty'], strip_files = ':empty',", ")", + "toolchain(name = 'cc-toolchain-k8',", + // Needs to be compatible with all execution environments for tests to work properly. + " exec_compatible_with = [],", + " target_compatible_with = [", + " '@bazel_tools//platforms:x86_64',", + " '@bazel_tools//platforms:linux',", + " ],", + " toolchain = ':cc-compiler-k8',", + " toolchain_type = ':toolchain_type',", + ")", "cc_toolchain(name = 'cc-no-dyn-linker-k8', all_files = ':empty', ", " compiler_files = ':empty', cpu = 'k8', compiler = 'compiler_no_dyn_linker', ", " libc = 'local', dwp_files = ':empty', dynamic_runtime_libs = [':empty'], ", @@ -109,6 +119,16 @@ public final class BazelMockCcSupport extends MockCcSupport { " module_map = 'crosstool.cppmap', supports_header_parsing = 1,", " objcopy_files = ':empty', static_runtime_libs = [':empty'], strip_files = ':empty',", ")", + "toolchain(name = 'cc-toolchain-no-dyn-linker-k8',", + // Needs to be compatible with all execution environments for tests to work properly. + " exec_compatible_with = [],", + " target_compatible_with = [", + " '@bazel_tools//platforms:x86_64',", + " '@bazel_tools//platforms:linux',", + " ],", + " toolchain = ':cc-no-dyn-linker-k8',", + " toolchain_type = ':toolchain_type',", + ")", "cc_toolchain(name = 'cc-compiler-ppc', all_files = ':empty', compiler_files = ':empty',", " cpu = 'ppc', compiler = 'compiler', libc = 'local', dwp_files = ':empty',", " dynamic_runtime_libs = [':empty'], ", @@ -116,6 +136,16 @@ public final class BazelMockCcSupport extends MockCcSupport { " module_map = 'crosstool.cppmap', supports_header_parsing = 1,", " objcopy_files = ':empty', static_runtime_libs = [':empty'], strip_files = ':empty',", ")", + "toolchain(name = 'cc-toolchain-ppc',", + // Needs to be compatible with all execution environments for tests to work properly. + " exec_compatible_with = [],", + " target_compatible_with = [", + " '@bazel_tools//platforms:ppc',", + " '@bazel_tools//platforms:linux',", + " ],", + " toolchain = ':cc-compiler-ppc',", + " toolchain_type = ':toolchain_type',", + ")", "cc_toolchain(name = 'cc-compiler-piii', all_files = ':all-files-piii',", " compiler_files = ':compiler-files-piii',", " cpu = 'piii', compiler = 'compiler', libc = 'local', dwp_files = ':empty',", @@ -124,6 +154,16 @@ public final class BazelMockCcSupport extends MockCcSupport { " module_map = 'crosstool.cppmap', supports_header_parsing = 1,", " objcopy_files = ':empty', static_runtime_libs = [':empty'], strip_files = ':empty',", ")", + "toolchain(name = 'cc-toolchain-piii',", + // Needs to be compatible with all execution environments for tests to work properly. + " exec_compatible_with = [],", + " target_compatible_with = [", + " '@bazel_tools//platforms:x86_32',", + " '@bazel_tools//platforms:linux',", + " ],", + " toolchain = ':cc-compiler-piii',", + " toolchain_type = ':toolchain_type',", + ")", "cc_toolchain(name = 'cc-compiler-darwin', all_files = ':empty', ", " compiler_files = ':empty',", " cpu = 'darwin', compiler = 'compiler', libc = 'macosx', dwp_files = ':empty',", @@ -132,6 +172,16 @@ public final class BazelMockCcSupport extends MockCcSupport { " module_map = 'crosstool.cppmap', supports_header_parsing = 1,", " objcopy_files = ':empty', static_runtime_libs = [':empty'], strip_files = ':empty',", ")", + "toolchain(name = 'cc-toolchain-darwin',", + // Needs to be compatible with all execution environments for tests to work properly. + " exec_compatible_with = [],", + " target_compatible_with = [", + " '@bazel_tools//platforms:x86_64',", + " '@bazel_tools//platforms:osx',", + " ],", + " toolchain = ':cc-compiler-darwin',", + " toolchain_type = ':toolchain_type',", + ")", "cc_toolchain(name = 'cc-no-dyn-linker-darwin', all_files = ':empty', ", " compiler_files = ':empty',", " cpu = 'darwin', compiler = 'compiler_no_dyn_linker', libc = 'macosx', " , @@ -140,6 +190,16 @@ public final class BazelMockCcSupport extends MockCcSupport { " module_map = 'crosstool.cppmap', supports_header_parsing = 1,", " objcopy_files = ':empty', static_runtime_libs = [':empty'], strip_files = ':empty',", ")", + "toolchain(name = 'cc-toolchain-no-dyn-linker-darwin',", + // Needs to be compatible with all execution environments for tests to work properly. + " exec_compatible_with = [],", + " target_compatible_with = [", + " '@bazel_tools//platforms:x86_64',", + " '@bazel_tools//platforms:osx',", + " ],", + " toolchain = ':cc-no-dyn-linker-darwin',", + " toolchain_type = ':toolchain_type',", + ")", "cc_toolchain(name = 'cc-compiler-ios_x86_64', all_files = ':empty', ", " compiler_files = ':empty',", " cpu = 'ios_x86_64', compiler = 'compiler', libc = 'local', dwp_files = ':empty',", @@ -148,6 +208,16 @@ public final class BazelMockCcSupport extends MockCcSupport { " module_map = 'crosstool.cppmap', supports_header_parsing = 1,", " objcopy_files = ':empty', static_runtime_libs = [':empty'], strip_files = ':empty',", ")", + "toolchain(name = 'cc-toolchain-ios_x86_64',", + // Needs to be compatible with all execution environments for tests to work properly. + " exec_compatible_with = [],", + " target_compatible_with = [", + " '@bazel_tools//platforms:x86_64',", + " '@bazel_tools//platforms:ios',", + " ],", + " toolchain = ':cc-compiler-ios_x86_64',", + " toolchain_type = ':toolchain_type',", + ")", "cc_toolchain(name = 'cc-compiler-armeabi-v7a', all_files = ':empty', ", " compiler_files = ':empty',", " cpu = 'armeabi-v7a', compiler = 'compiler', libc = 'armeabi-v7a', ", @@ -157,6 +227,16 @@ public final class BazelMockCcSupport extends MockCcSupport { " module_map = 'crosstool.cppmap', supports_header_parsing = 1,", " objcopy_files = ':empty', static_runtime_libs = [':empty'], strip_files = ':empty',", ")", + "toolchain(name = 'cc-toolchain-armeabi-v7a',", + // Needs to be compatible with all execution environments for tests to work properly. + " exec_compatible_with = [],", + " target_compatible_with = [", + " '@bazel_tools//platforms:arm',", + " '@bazel_tools//platforms:android',", + " ],", + " toolchain = ':cc-compiler-armeabi-v7a',", + " toolchain_type = ':toolchain_type',", + ")", "cc_toolchain(name = 'cc-compiler-x64_windows', all_files = ':empty', ", " compiler_files = ':empty',", " cpu = 'x64_windows', compiler = 'windows_msys64', libc = 'local', ", @@ -166,6 +246,16 @@ public final class BazelMockCcSupport extends MockCcSupport { " module_map = 'crosstool.cppmap', supports_header_parsing = 1,", " objcopy_files = ':empty', static_runtime_libs = [':empty'], strip_files = ':empty',", ")", + "toolchain(name = 'cc-toolchain-x64_windows',", + // Needs to be compatible with all execution environments for tests to work properly. + " exec_compatible_with = [],", + " target_compatible_with = [", + " '@bazel_tools//platforms:x86_64',", + " '@bazel_tools//platforms:windows',", + " ],", + " toolchain = ':cc-compiler-x64_windows',", + " toolchain_type = ':toolchain_type',", + ")", "cc_toolchain(name = 'cc-no-dyn-linker-x64_windows', all_files = ':empty', ", " compiler_files = ':empty',", " cpu = 'x64_windows', compiler = 'compiler_no_dyn_linker', libc = 'local', ", @@ -175,6 +265,16 @@ public final class BazelMockCcSupport extends MockCcSupport { " module_map = 'crosstool.cppmap', supports_header_parsing = 1,", " objcopy_files = ':empty', static_runtime_libs = [':empty'], strip_files = ':empty',", ")", + "toolchain(name = 'cc-toolchain-no-dyn-linker-x64_windows',", + // Needs to be compatible with all execution environments for tests to work properly. + " exec_compatible_with = [],", + " target_compatible_with = [", + " '@bazel_tools//platforms:x86_64',", + " '@bazel_tools//platforms:windows',", + " ],", + " toolchain = ':cc-no-dyn-linker-x64_windows',", + " toolchain_type = ':toolchain_type',", + ")", "filegroup(", " name = 'interface_library_builder',", " srcs = ['build_interface_so'],", @@ -182,26 +282,7 @@ public final class BazelMockCcSupport extends MockCcSupport { "filegroup(", " name = 'link_dynamic_library',", " srcs = ['link_dynamic_library.sh'],", - ")", - "toolchain(", - " name = 'toolchain_cc-compiler-piii',", - " toolchain_type = ':toolchain_type',", - " toolchain = '//third_party/crosstool/mock:cc-compiler-piii',", - " target_compatible_with = [':mock_value'],", - ")", - "toolchain(", - " name = 'dummy_cc_toolchain',", - " toolchain_type = ':toolchain_type',", - " toolchain = ':dummy_cc_toolchain_impl',", - ")", - "load(':dummy_toolchain.bzl', 'dummy_toolchain')", - "dummy_toolchain(name = 'dummy_cc_toolchain_impl')"); - config.create( - "/bazel_tools_workspace/tools/cpp/dummy_toolchain.bzl", - "def _dummy_toolchain_impl(ctx):", - " toolchain = platform_common.ToolchainInfo()", - " return [toolchain]", - "dummy_toolchain = rule(_dummy_toolchain_impl, attrs = {})"); + ")"); config.create( "/bazel_tools_workspace/tools/cpp/CROSSTOOL", readCrosstoolFile()); |