github.com/johnnyeven/libtools@v0.0.0-20191126065708-61829c1adf46/third_party/gpus/crosstool/BUILD.tpl (about) 1 # This file is expanded from a template by cuda_configure.bzl 2 # Update cuda_configure.bzl#verify_build_defines when adding new variables. 3 4 load(":cc_toolchain_config.bzl", "cc_toolchain_config") 5 6 licenses(["restricted"]) 7 8 package(default_visibility = ["//visibility:public"]) 9 10 toolchain( 11 name = "toolchain-linux-x86_64", 12 exec_compatible_with = [ 13 "@bazel_tools//platforms:linux", 14 "@bazel_tools//platforms:x86_64", 15 ], 16 target_compatible_with = [ 17 "@bazel_tools//platforms:linux", 18 "@bazel_tools//platforms:x86_64", 19 ], 20 toolchain = ":cc-compiler-local", 21 toolchain_type = "@bazel_tools//tools/cpp:toolchain_type", 22 ) 23 24 cc_toolchain_suite( 25 name = "toolchain", 26 toolchains = { 27 "local|compiler": ":cc-compiler-local", 28 "darwin|compiler": ":cc-compiler-darwin", 29 "x64_windows|msvc-cl": ":cc-compiler-windows", 30 "x64_windows": ":cc-compiler-windows", 31 "arm": ":cc-compiler-local", 32 "aarch64": ":cc-compiler-local", 33 "k8": ":cc-compiler-local", 34 "piii": ":cc-compiler-local", 35 "ppc": ":cc-compiler-local", 36 "darwin": ":cc-compiler-darwin", 37 }, 38 ) 39 40 cc_toolchain( 41 name = "cc-compiler-local", 42 all_files = "%{linker_files}", 43 compiler_files = ":empty", 44 dwp_files = ":empty", 45 linker_files = "%{linker_files}", 46 objcopy_files = ":empty", 47 strip_files = ":empty", 48 # To support linker flags that need to go to the start of command line 49 # we need the toolchain to support parameter files. Parameter files are 50 # last on the command line and contain all shared libraries to link, so all 51 # regular options will be left of them. 52 supports_param_files = 1, 53 toolchain_identifier = "local_linux", 54 toolchain_config = ":cc-compiler-local-config", 55 ) 56 57 cc_toolchain_config( 58 name = "cc-compiler-local-config", 59 cpu = "local", 60 builtin_include_directories = [%{cxx_builtin_include_directories}], 61 extra_no_canonical_prefixes_flags = [%{extra_no_canonical_prefixes_flags}], 62 host_compiler_path = "%{host_compiler_path}", 63 host_compiler_prefix = "%{host_compiler_prefix}", 64 host_compiler_warnings = [%{host_compiler_warnings}], 65 host_unfiltered_compile_flags = [%{unfiltered_compile_flags}], 66 linker_bin_path = "%{linker_bin_path}", 67 ) 68 69 cc_toolchain( 70 name = "cc-compiler-darwin", 71 all_files = "%{linker_files}", 72 compiler_files = ":empty", 73 dwp_files = ":empty", 74 linker_files = "%{linker_files}", 75 objcopy_files = ":empty", 76 strip_files = ":empty", 77 supports_param_files = 0, 78 toolchain_identifier = "local_darwin", 79 toolchain_config = ":cc-compiler-local-darwin", 80 ) 81 82 cc_toolchain_config( 83 name = "cc-compiler-local-darwin", 84 cpu = "darwin", 85 builtin_include_directories = [%{cxx_builtin_include_directories}], 86 extra_no_canonical_prefixes_flags = [%{extra_no_canonical_prefixes_flags}], 87 host_compiler_path = "%{host_compiler_path}", 88 host_compiler_prefix = "%{host_compiler_prefix}", 89 host_compiler_warnings = [%{host_compiler_warnings}], 90 host_unfiltered_compile_flags = [%{unfiltered_compile_flags}], 91 linker_bin_path = "%{linker_bin_path}", 92 ) 93 94 cc_toolchain( 95 name = "cc-compiler-windows", 96 all_files = "%{win_linker_files}", 97 compiler_files = ":empty", 98 dwp_files = ":empty", 99 linker_files = "%{win_linker_files}", 100 objcopy_files = ":empty", 101 strip_files = ":empty", 102 supports_param_files = 1, 103 toolchain_identifier = "local_windows", 104 toolchain_config = ":cc-compiler-windows-config", 105 ) 106 107 cc_toolchain_config( 108 name = "cc-compiler-windows-config", 109 cpu = "x64_windows", 110 builtin_include_directories = [%{cxx_builtin_include_directories}], 111 msvc_cl_path = "%{msvc_cl_path}", 112 msvc_env_include = "%{msvc_env_include}", 113 msvc_env_lib = "%{msvc_env_lib}", 114 msvc_env_path = "%{msvc_env_path}", 115 msvc_env_tmp = "%{msvc_env_tmp}", 116 msvc_lib_path = "%{msvc_lib_path}", 117 msvc_link_path = "%{msvc_link_path}", 118 msvc_ml_path = "%{msvc_ml_path}", 119 ) 120 121 filegroup( 122 name = "empty", 123 srcs = [], 124 ) 125 126 filegroup( 127 name = "crosstool_wrapper_driver_is_not_gcc", 128 srcs = ["clang/bin/crosstool_wrapper_driver_is_not_gcc"], 129 ) 130 131 filegroup( 132 name = "windows_msvc_wrapper_files", 133 srcs = glob(["windows/msvc_*"]), 134 )