code: def cross_build(opts: Opts, cmd_runner=None):
      if cmd_runner is None:
          cmd_runner = CmdRunner(opts.dry_run)
  
      host_platform = get_host_platform()
      logging.info(
          f"Cross-building from host platform {host_platform} to target platform {opts.target_platform}"
      )
  
      tmp_native_built_tools_root_dir = None
  
      if opts.native_built_tools_root_dir:
          native_built_tools_root_dir = opts.native_built_tools_root_dir
      else:
          tmp_native_built_tools_root_dir = tempfile.TemporaryDirectory(
              prefix="native_built_tools_root_dir"
          )
          native_built_tools_root_dir = (
              tmp_native_built_tools_root_dir.name
          )
  
          logging.info("Build tools")
          build(
              dry_run=opts.dry_run,
              verbose=opts.verbose,
              build_root_dir=native_built_tools_root_dir,
              build_type="Release",
              rebuild=opts.rebuild,
              targets=Targets.tools,
              cmake_target_toolchain=opts.cmake_build_toolchain,
              msvs_version=opts.msvs_version,
              msvc_toolset=opts.msvc_toolset,
              macosx_version_min=opts.macosx_version_min,
          )
  
      source_root_dir = get_source_root_dir()
  
      if opts.cmake_target_toolchain is None:
          cmake_target_toolchain = get_default_cross_build_toolchain(
              source_root_dir, opts
          )
      else:
          cmake_target_toolchain = opts.cmake_target_toolchain
  
      if opts.conan_host_profile is None:
          conan_host_profile = get_default_conan_host_profile(
              source_root_dir, opts.target_platform
          )
      else:
          conan_host_profile = opts.conan_host_profile
  
      conan_cmd_prefix = [
          "conan",
          "install",
          "-s",
          f"build_type={opts.build_type}",
          "-if",
          opts.build_root_dir,
          "--build=missing",
      ]
  
      conan_tools_cmd = conan_cmd_prefix + [
          os.path.join(source_root_dir, "conanfile.txt")
      ]
      logging.info("Run conan to build tools")
      cmd_runner.run(conan_tools_cmd)
  
      conan_libs_cmd = conan_cmd_prefix + [
          "--no-imports",
          f"-pr:h={conan_host_profile}",
          "-pr:b=default",
          os.path.join(source_root_dir, "conanfile.txt"),
      ]
      logging.info(
          f"Run conan to build libs for target platform {opts.target_platform}"
      )
      cmd_runner.run(conan_libs_cmd)
  
      final_build_opts = copy.copy(opts)
      final_build_opts.cmake_target_toolchain = cmake_target_toolchain
      final_build_opts.native_built_tools_root_dir = (
          native_built_tools_root_dir
      )
  
      logging.info(
          f"Run build for target platform {opts.target_platform}"
      )
      build(opts=final_build_opts, cross_build_final_stage=True)
  
imports: import argparse
  import copy
  import logging
  import os
  import platform
  import subprocess
  import sys
  import tempfile
  from typing import Dict
label_desc: Use image node_id 8 for calling a global function with example usage: cross_build(opts, cmd_runner) without return types