reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced
    1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
   41
   42
   43
   44
   45
   46
   47
   48
   49
   50
   51
   52
   53
   54
   55
   56
   57
   58
   59
   60
   61
   62
   63
   64
   65
   66
   67
   68
   69
   70
   71
   72
   73
   74
   75
   76
   77
   78
   79
   80
   81
   82
   83
   84
   85
   86
   87
   88
   89
   90
   91
import("//compiler-rt/target.gni")
import("//compiler-rt/test/test.gni")
import("//llvm/triples.gni")
import("//llvm/utils/gn/build/libs/zlib/enable.gni")
import("//llvm/utils/gn/build/toolchain/compiler.gni")
import("//llvm/utils/gn/build/write_cmake_config.gni")
import("//llvm/version.gni")

write_cmake_config("lit_common_configured") {
  input = "lit.common.configured.in"
  output = "$target_gen_dir/lit.common.configured"

  values = [
    "LIT_SITE_CFG_IN_HEADER=## Autogenerated from $input, do not edit",

    "COMPILER_RT_DEFAULT_TARGET_TRIPLE=$llvm_current_triple",
    "COMPILER_RT_DEFAULT_TARGET_ARCH=$crt_current_target_arch",

    "COMPILER_RT_TEST_COMPILER_CFLAGS=$target_flags_string",
    "LLVM_BUILD_MODE=.",
    "LLVM_MAIN_SRC_DIR=" + rebase_path("//llvm"),
    "LLVM_BINARY_DIR=" + rebase_path(root_build_dir),
    "COMPILER_RT_SOURCE_DIR=" + rebase_path("//compiler-rt"),

    # This is only used by tsan to find the path to an instrumented libc++.
    # Since we don't currently support running the tsan tests, leave it empty
    # for now. Eventually it should probably be replaced with some mechanism
    # where the libraries are found in a toolchain dir.
    "COMPILER_RT_BINARY_DIR=",

    # We don't currently support the multiarch runtime layout.
    "LLVM_ENABLE_PER_TARGET_RUNTIME_DIR_PYBOOL=False",

    "LLVM_TOOLS_DIR=" + rebase_path("$root_build_dir/bin"),
    "LLVM_LIBRARY_OUTPUT_INTDIR=" + rebase_path("$root_build_dir/lib"),

    "LLVM_LIBCXX_USED=0",

    "GOLD_EXECUTABLE=ld",
    "COMPILER_RT_RESOLVED_TEST_COMPILER=" +
        rebase_path("$root_build_dir/bin/clang"),
    "COMPILER_RT_TEST_COMPILER_ID=Clang",
    "PYTHON_EXECUTABLE=$python_path",
    "COMPILER_RT_DEBUG_PYBOOL=False",
    "COMPILER_RT_INTERCEPT_LIBDISPATCH_PYBOOL=False",
    "COMPILER_RT_RESOLVED_LIBRARY_OUTPUT_DIR=" +
        rebase_path(crt_current_out_dir),
    "COMPILER_RT_EMULATOR=",
    "COMPILER_RT_ASAN_SHADOW_SCALE=",
    "SANITIZER_CAN_USE_CXXABI_PYBOOL=True",
    "COMPILER_RT_HAS_LLD_PYBOOL=True",
    "COMPILER_RT_HAS_GWP_ASAN_PYBOOL=False",
    "HAVE_RPC_XDR_H=0",
    "ANDROID_NDK_VERSION=19",
    "ANDROID_SERIAL_FOR_TESTING=$android_serial_for_testing",
  ]

  if (host_cpu == "x64") {
    values += [ "HOST_ARCH=x86_64" ]
  } else {
    assert(false, "unimplemented host_cpu " + host_cpu)
  }

  if (host_os == "mac") {
    values += [ "HOST_OS=Darwin" ]
  } else if (host_os == "linux") {
    values += [ "HOST_OS=Linux" ]
  } else if (host_os == "win") {
    values += [ "HOST_OS=Windows" ]
  } else {
    assert(false, "unsupported host_os " + host_os)
  }

  if (current_os != "win" || llvm_enable_dia_sdk) {
    values += [ "CAN_SYMBOLIZE=1" ]
  } else {
    values += [ "CAN_SYMBOLIZE=0" ]
  }

  if (current_os == "android") {
    values += [ "ANDROID_PYBOOL=True" ]
  } else {
    values += [ "ANDROID_PYBOOL=False" ]
  }

  if (llvm_enable_zlib) {
    values += [ "HAVE_LIBZ=1" ]
  } else {
    values += [ "HAVE_LIBZ=0" ]
  }
}