2525 _check_os_arch_keys = "check_os_arch_keys" ,
2626 _exec_os_arch_dict_value = "exec_os_arch_dict_value" ,
2727 _is_absolute_path = "is_absolute_path" ,
28+ _is_standalone_arch = "is_standalone_arch" ,
2829 _list_to_string = "list_to_string" ,
2930 _os = "os" ,
3031 _os_arch_pair = "os_arch_pair" ,
@@ -243,7 +244,10 @@ def _cc_toolchains_str(
243244 cc_toolchains_str = ""
244245 toolchain_names = []
245246 for (target_os , target_arch ) in _supported_targets :
246- suffix = "{}-{}" .format (target_arch , target_os )
247+ if _is_standalone_arch (target_os , target_arch ):
248+ suffix = target_arch
249+ else :
250+ suffix = "{}-{}" .format (target_arch , target_os )
247251 cc_toolchain_str = _cc_toolchain_str (
248252 rctx ,
249253 suffix ,
@@ -315,6 +319,8 @@ def _cc_toolchain_str(
315319 "darwin-aarch64" : "aarch64-apple-macosx" ,
316320 "linux-aarch64" : "aarch64-unknown-linux-gnu" ,
317321 "linux-x86_64" : "x86_64-unknown-linux-gnu" ,
322+ "wasm32" : "wasm32-unknown-unknown" ,
323+ "wasm64" : "wasm64-unknown-unknown" ,
318324 }[target_pair ]
319325 cxx_builtin_include_directories = [
320326 toolchain_path_prefix + "include/c++/v1" ,
@@ -341,6 +347,11 @@ def _cc_toolchain_str(
341347 _join (sysroot_prefix , "/usr/include" ),
342348 _join (sysroot_prefix , "/System/Library/Frameworks" ),
343349 ])
350+ elif target_os == "none" :
351+ if sysroot_prefix :
352+ cxx_builtin_include_directories .extend ([
353+ _join (sysroot_prefix , "/include" ),
354+ ])
344355 else :
345356 fail ("Unreachable" )
346357
0 commit comments