[CMake] Rename TARGET_TRIPLE to LLVM_TARGET_TRIPLE

This clarifies that this is an LLVM specific variable and avoids
potential conflicts with other projects.

Differential Revision: https://reviews.llvm.org/D119918
This commit is contained in:
Petr Hosek 2021-12-02 01:04:46 -08:00
parent 75779435f3
commit 0c0f6cfb7b
40 changed files with 64 additions and 58 deletions

View File

@ -8,7 +8,7 @@ config.llvm_build_mode = "@LLVM_BUILD_MODE@"
config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@"
config.bolt_obj_root = "@BOLT_BINARY_DIR@"
config.bolt_src_root = "@BOLT_SOURCE_DIR@"
config.target_triple = "@TARGET_TRIPLE@"
config.target_triple = "@LLVM_TARGET_TRIPLE@"
config.python_executable = "@Python3_EXECUTABLE@"
# Support substitution of the tools and libs dirs with user parameters. This is

View File

@ -12,7 +12,7 @@ config.llvm_shlib_dir = "@SHLIBDIR@"
config.llvm_plugin_ext = "@LLVM_PLUGIN_EXT@"
config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@"
config.host_triple = "@LLVM_HOST_TRIPLE@"
config.target_triple = "@TARGET_TRIPLE@"
config.target_triple = "@LLVM_TARGET_TRIPLE@"
config.llvm_use_sanitizer = "@LLVM_USE_SANITIZER@"
config.enable_shared = @ENABLE_SHARED@
config.enable_backtrace = @ENABLE_BACKTRACES@

View File

@ -6,7 +6,7 @@ config.clang_tools_dir = "@CLANG_TOOLS_DIR@"
config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
config.clang_libs_dir = "@CLANG_LIBS_DIR@"
config.llvm_libs_dir = "@LLVM_LIBS_DIR@"
config.target_triple = "@TARGET_TRIPLE@"
config.target_triple = "@LLVM_TARGET_TRIPLE@"
config.host_triple = "@LLVM_HOST_TRIPLE@"
config.python_executable = "@Python3_EXECUTABLE@"

View File

@ -4,6 +4,6 @@ config.extra_tools_obj_dir = "@CLANG_TOOLS_BINARY_DIR@/unittests"
config.extra_tools_src_dir = "@CLANG_TOOLS_SOURCE_DIR@/unittests"
config.llvm_libs_dir = "@LLVM_LIBS_DIR@"
config.shlibdir = "@SHLIBDIR@"
config.target_triple = "@TARGET_TRIPLE@"
config.target_triple = "@LLVM_TARGET_TRIPLE@"
lit_config.load_config(config, "@CLANG_TOOLS_SOURCE_DIR@/test/Unit/lit.cfg.py")

View File

@ -10,7 +10,7 @@ config.clang_tools_binary_dir = "@CLANG_TOOLS_BINARY_DIR@"
config.clang_tools_dir = "@CLANG_TOOLS_DIR@"
config.clang_libs_dir = "@SHLIBDIR@"
config.python_executable = "@Python3_EXECUTABLE@"
config.target_triple = "@TARGET_TRIPLE@"
config.target_triple = "@LLVM_TARGET_TRIPLE@"
config.clang_tidy_staticanalyzer = @CLANG_TIDY_ENABLE_STATIC_ANALYZER@
config.has_plugins = @CLANG_PLUGIN_SUPPORT@ & ~@LLVM_INSTALL_TOOLCHAIN_ONLY@

View File

@ -10,7 +10,7 @@ config.llvm_build_mode = "@LLVM_BUILD_MODE@"
config.clang_obj_root = path(r"@CLANG_BINARY_DIR@")
config.enable_shared = @ENABLE_SHARED@
config.shlibdir = path(r"@SHLIBDIR@")
config.target_triple = "@TARGET_TRIPLE@"
config.target_triple = "@LLVM_TARGET_TRIPLE@"
# Support substitution of the tools_dir, libs_dirs, and build_mode with user
# parameters. This is used when we can't determine the tool dir at

View File

@ -16,7 +16,7 @@ config.clang_src_dir = path(r"@CLANG_SOURCE_DIR@")
config.clang_tools_dir = path(r"@CLANG_TOOLS_DIR@")
config.clang_lib_dir = path(r"@CMAKE_LIBRARY_OUTPUT_DIRECTORY@")
config.host_triple = "@LLVM_HOST_TRIPLE@"
config.target_triple = "@TARGET_TRIPLE@"
config.target_triple = "@LLVM_TARGET_TRIPLE@"
config.host_cc = "@CMAKE_C_COMPILER@"
config.host_cxx = "@CMAKE_CXX_COMPILER@"
config.llvm_use_sanitizer = "@LLVM_USE_SANITIZER@"

View File

@ -6,7 +6,7 @@ config.clang_tools_dir = "@CLANG_TOOLS_DIR@"
config.perf_helper_dir = "@CMAKE_CURRENT_SOURCE_DIR@"
config.test_exec_root = "@CMAKE_CURRENT_BINARY_DIR@"
config.test_source_root = "@CLANG_PGO_TRAINING_DATA@"
config.target_triple = "@TARGET_TRIPLE@"
config.target_triple = "@LLVM_TARGET_TRIPLE@"
config.python_exe = "@Python3_EXECUTABLE@"
# Support substitution of the tools and libs dirs with user parameters. This is

View File

@ -6,7 +6,7 @@ config.clang_tools_dir = "@CLANG_TOOLS_DIR@"
config.perf_helper_dir = "@CMAKE_CURRENT_SOURCE_DIR@"
config.test_exec_root = "@CMAKE_CURRENT_BINARY_DIR@"
config.test_source_root = "@CLANG_PGO_TRAINING_DATA@"
config.target_triple = "@TARGET_TRIPLE@"
config.target_triple = "@LLVM_TARGET_TRIPLE@"
config.python_exe = "@Python3_EXECUTABLE@"
# Support substitution of the tools and libs dirs with user parameters. This is

View File

@ -128,7 +128,7 @@ macro(set_output_name output name arch)
if(COMPILER_RT_DEFAULT_TARGET_ONLY)
set(triple "${COMPILER_RT_DEFAULT_TARGET_TRIPLE}")
else()
set(triple "${TARGET_TRIPLE}")
set(triple "${LLVM_TARGET_TRIPLE}")
endif()
# Except for baremetal, when using arch-suffixed runtime library names,
# clang only looks for libraries named "arm" or "armhf", see

View File

@ -23,10 +23,10 @@ macro(compiler_rt_mock_llvm_cmake_config_set_cmake_path)
endmacro()
function(compiler_rt_mock_llvm_cmake_config_set_target_triple)
# Various bits of compiler-rt depend on the `TARGET_TRIPLE`variable being
# defined. This function tries to set a sensible value for the variable.
# This is a function rather than a macro to avoid polluting the variable
# namespace.
# Various bits of compiler-rt depend on the `LLVM_TARGET_TRIPLE` variable
# being defined. This function tries to set a sensible value for the
# variable. This is a function rather than a macro to avoid polluting the
# variable namespace.
set(COMPILER_OUTPUT "")
# If the user provides `COMPILER_RT_DEFAULT_TARGET_ONLY` and `CMAKE_C_COMPILER_TARGET`
@ -35,7 +35,7 @@ function(compiler_rt_mock_llvm_cmake_config_set_target_triple)
if (COMPILER_RT_DEFAULT_TARGET_ONLY)
if (NOT "${CMAKE_C_COMPILER_TARGET}" STREQUAL "")
message(STATUS
"Using CMAKE_C_COMPILER_TARGET (${CMAKE_C_COMPILER_TARGET}) as TARGET_TRIPLE")
"Using CMAKE_C_COMPILER_TARGET (${CMAKE_C_COMPILER_TARGET}) as LLVM_TARGET_TRIPLE")
endif()
set(COMPILER_OUTPUT "${CMAKE_C_COMPILER_TARGET}")
endif()
@ -61,12 +61,12 @@ function(compiler_rt_mock_llvm_cmake_config_set_target_triple)
if (HAD_ERROR)
message(FATAL_ERROR "Fetching target triple from compiler failed")
endif()
set(TARGET_TRIPLE "${COMPILER_OUTPUT}")
message(STATUS "TARGET_TRIPLE: \"${TARGET_TRIPLE}\"")
if ("${TARGET_TRIPLE}" STREQUAL "")
set(LLVM_TARGET_TRIPLE "${COMPILER_OUTPUT}")
message(STATUS "TARGET_TRIPLE: \"${LLVM_TARGET_TRIPLE}\"")
if ("${LLVM_TARGET_TRIPLE}" STREQUAL "")
message(FATAL_ERROR "TARGET_TRIPLE cannot be empty")
endif()
set(TARGET_TRIPLE "${TARGET_TRIPLE}" PARENT_SCOPE)
set(LLVM_TARGET_TRIPLE "${LLVM_TARGET_TRIPLE}" PARENT_SCOPE)
endfunction()
macro(compiler_rt_mock_llvm_cmake_config_include_cmake_files)

View File

@ -426,12 +426,12 @@ macro(construct_compiler_rt_default_triple)
endif()
set(COMPILER_RT_DEFAULT_TARGET_TRIPLE ${CMAKE_C_COMPILER_TARGET})
else()
set(COMPILER_RT_DEFAULT_TARGET_TRIPLE ${TARGET_TRIPLE} CACHE STRING
set(COMPILER_RT_DEFAULT_TARGET_TRIPLE ${LLVM_TARGET_TRIPLE} CACHE STRING
"Default triple for which compiler-rt runtimes will be built.")
endif()
string(REPLACE "-" ";" TARGET_TRIPLE_LIST ${COMPILER_RT_DEFAULT_TARGET_TRIPLE})
list(GET TARGET_TRIPLE_LIST 0 COMPILER_RT_DEFAULT_TARGET_ARCH)
string(REPLACE "-" ";" LLVM_TARGET_TRIPLE_LIST ${COMPILER_RT_DEFAULT_TARGET_TRIPLE})
list(GET LLVM_TARGET_TRIPLE_LIST 0 COMPILER_RT_DEFAULT_TARGET_ARCH)
# Map various forms of the architecture names to the canonical forms
# (as they are used by clang, see getArchNameForCompilerRTLib).
@ -442,7 +442,7 @@ macro(construct_compiler_rt_default_triple)
# Determine if test target triple is specified explicitly, and doesn't match the
# default.
if(NOT COMPILER_RT_DEFAULT_TARGET_TRIPLE STREQUAL TARGET_TRIPLE)
if(NOT COMPILER_RT_DEFAULT_TARGET_TRIPLE STREQUAL LLVM_TARGET_TRIPLE)
set(COMPILER_RT_HAS_EXPLICIT_DEFAULT_TARGET_TRIPLE TRUE)
else()
set(COMPILER_RT_HAS_EXPLICIT_DEFAULT_TARGET_TRIPLE FALSE)

View File

@ -12,7 +12,7 @@ config.arm_thumb = "@COMPILER_RT_ARM_THUMB@"
config.osx_sysroot_flag = "@OSX_SYSROOT_FLAG@"
config.cmake_binary_dir = "@CMAKE_BINARY_DIR@"
config.llvm_library_dir = "@LLVM_LIBRARY_DIR@"
config.target_triple = "@TARGET_TRIPLE@"
config.target_triple = "@LLVM_TARGET_TRIPLE@"
config.target_arch = "@LIBFUZZER_TEST_TARGET_ARCH@"
# Load common config for all compiler-rt lit tests.

View File

@ -1,7 +1,7 @@
@LIT_SITE_CFG_IN_HEADER@
# Generic config options for all compiler-rt unit tests.
config.target_triple = "@TARGET_TRIPLE@"
config.target_triple = "@LLVM_TARGET_TRIPLE@"
config.llvm_src_root = "@LLVM_MAIN_SRC_DIR@"
config.llvm_obj_root = "@LLVM_BINARY_DIR@"
config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"

View File

@ -13,7 +13,7 @@ config.llvm_plugin_ext = "@LLVM_PLUGIN_EXT@"
config.cross_project_tests_obj_root = "@CROSS_PROJECT_TESTS_BINARY_DIR@"
config.cross_project_tests_src_root = "@CROSS_PROJECT_TESTS_SOURCE_DIR@"
config.host_triple = "@LLVM_HOST_TRIPLE@"
config.target_triple = "@TARGET_TRIPLE@"
config.target_triple = "@LLVM_TARGET_TRIPLE@"
config.is_msvc = lit.util.pythonize_bool("@MSVC@")
config.llvm_enabled_projects = "@LLVM_ENABLE_PROJECTS@".split(";")

View File

@ -10,7 +10,7 @@ config.flang_obj_root = "@FLANG_BINARY_DIR@"
config.flang_src_root = "@FLANG_SOURCE_DIR@"
config.flang_libs_dir = "@LLVM_LIBRARY_OUTPUT_INTDIR@"
config.flang_tools_dir = "@LLVM_RUNTIME_OUTPUT_INTDIR@"
config.target_triple = "@TARGET_TRIPLE@"
config.target_triple = "@LLVM_TARGET_TRIPLE@"
config.python_executable = "@Python3_EXECUTABLE@"
# Support substitution of the tools and libs dirs with user parameters. This is

View File

@ -10,7 +10,7 @@ config.flang_obj_root = "@FLANG_BINARY_DIR@"
config.flang_src_root = "@FLANG_SOURCE_DIR@"
config.flang_libs_dir = "@LLVM_LIBRARY_OUTPUT_INTDIR@"
config.flang_tools_dir = "@LLVM_RUNTIME_OUTPUT_INTDIR@"
config.target_triple = "@TARGET_TRIPLE@"
config.target_triple = "@LLVM_TARGET_TRIPLE@"
config.python_executable = "@Python3_EXECUTABLE@"
# Support substitution of the tools and libs dirs with user parameters. This is

View File

@ -10,7 +10,7 @@ config.lld_obj_root = "@LLD_BINARY_DIR@"
config.lld_src_root = "@LLD_SOURCE_DIR@"
config.lld_libs_dir = "@LLD_LIBS_DIR@"
config.lld_tools_dir = "@LLD_TOOLS_DIR@"
config.target_triple = "@TARGET_TRIPLE@"
config.target_triple = "@LLVM_TARGET_TRIPLE@"
config.python_executable = "@Python3_EXECUTABLE@"
# Support substitution of the tools and libs dirs with user parameters. This is

View File

@ -12,7 +12,7 @@ config.errc_messages = "@LLVM_LIT_ERRC_MESSAGES@"
config.lld_obj_root = "@LLD_BINARY_DIR@"
config.lld_libs_dir = "@LLD_LIBS_DIR@"
config.lld_tools_dir = "@LLD_TOOLS_DIR@"
config.target_triple = "@TARGET_TRIPLE@"
config.target_triple = "@LLVM_TARGET_TRIPLE@"
config.python_executable = "@Python3_EXECUTABLE@"
config.have_zlib = @LLVM_ENABLE_ZLIB@
config.have_libxar = @LLVM_HAVE_LIBXAR@

View File

@ -16,7 +16,7 @@ config.host_os = "@HOST_OS@"
config.host_triple = "@LLVM_HOST_TRIPLE@"
config.shared_libs = @LLVM_ENABLE_SHARED_LIBS@
config.llvm_use_sanitizer = "@LLVM_USE_SANITIZER@"
config.target_triple = "@TARGET_TRIPLE@"
config.target_triple = "@LLVM_TARGET_TRIPLE@"
config.lldb_build_directory = "@LLDB_TEST_BUILD_DIRECTORY@"
config.python_executable = "@Python3_EXECUTABLE@"
config.lua_executable = "@Lua_EXECUTABLE@"

View File

@ -133,7 +133,7 @@ if(TARGET clang)
endif()
if (LLDB_BUILT_STANDALONE)
set(LLVM_HOST_TRIPLE ${TARGET_TRIPLE})
set(LLVM_HOST_TRIPLE ${LLVM_TARGET_TRIPLE})
endif()
add_lldb_test_dependency(

View File

@ -13,7 +13,7 @@ config.lldb_tools_dir = "@LLDB_TOOLS_DIR@"
# Since it comes from the command line, it may have backslashes which
# should not need to be escaped.
config.lldb_lit_tools_dir = r"@LLDB_LIT_TOOLS_DIR@"
config.target_triple = "@TARGET_TRIPLE@"
config.target_triple = "@LLVM_TARGET_TRIPLE@"
config.python_executable = "@Python3_EXECUTABLE@"
config.have_zlib = @LLVM_ENABLE_ZLIB@
config.lldb_enable_lzma = @LLDB_ENABLE_LZMA@

View File

@ -8,7 +8,7 @@ config.llvm_build_mode = "@LLVM_BUILD_MODE@"
config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@"
config.lldb_obj_root = "@LLDB_BINARY_DIR@"
config.lldb_src_root = "@LLDB_SOURCE_DIR@"
config.target_triple = "@TARGET_TRIPLE@"
config.target_triple = "@LLVM_TARGET_TRIPLE@"
config.python_executable = "@Python3_EXECUTABLE@"
# Support substitution of the tools and libs dirs with user parameters. This is

View File

@ -8,7 +8,7 @@ config.llvm_build_mode = "@LLVM_BUILD_MODE@"
config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@"
config.lldb_obj_root = "@LLDB_BINARY_DIR@"
config.lldb_src_root = "@LLDB_SOURCE_DIR@"
config.target_triple = "@TARGET_TRIPLE@"
config.target_triple = "@LLVM_TARGET_TRIPLE@"
config.python_executable = "@Python3_EXECUTABLE@"
# Support substitution of the tools and libs dirs with user parameters. This is

View File

@ -742,7 +742,13 @@ endif()
set(LLVM_DEFAULT_TARGET_TRIPLE "${LLVM_DEFAULT_TARGET_TRIPLE_default}" CACHE STRING
"Default target for which LLVM will generate code." )
set(TARGET_TRIPLE "${LLVM_DEFAULT_TARGET_TRIPLE}")
if (TARGET_TRIPLE)
message(WARNING "TARGET_TRIPLE is deprecated and will be removed in a future release. "
"Please use LLVM_DEFAULT_TARGET_TRIPLE instead.")
set(LLVM_TARGET_TRIPLE "${TARGET_TRIPLE}")
else()
set(LLVM_TARGET_TRIPLE "${LLVM_DEFAULT_TARGET_TRIPLE}")
endif()
message(STATUS "LLVM host triple: ${LLVM_HOST_TRIPLE}")
message(STATUS "LLVM default target triple: ${LLVM_DEFAULT_TARGET_TRIPLE}")

View File

@ -1671,11 +1671,11 @@ function(configure_lit_site_cfg site_in site_out)
string(CONCAT LIT_SITE_CFG_IN_HEADER "${LIT_SITE_CFG_IN_HEADER}"
"import os\n"
"target_env = \"${LLVM_TARGET_TRIPLE_ENV}\"\n"
"config.target_triple = config.environment[target_env] = os.environ.get(target_env, \"${TARGET_TRIPLE}\")\n"
"config.target_triple = config.environment[target_env] = os.environ.get(target_env, \"${LLVM_TARGET_TRIPLE}\")\n"
)
# This is expanded to; config.target_triple = ""+config.target_triple+""
set(TARGET_TRIPLE "\"+config.target_triple+\"")
set(LLVM_TARGET_TRIPLE "\"+config.target_triple+\"")
endif()
if (ARG_PATHS)

View File

@ -77,7 +77,7 @@ function(llvm_create_cross_target project_name target_name toolchain buildtype)
-DLLVM_TARGET_IS_CROSSCOMPILE_HOST=TRUE
-DLLVM_TARGETS_TO_BUILD="${targets_to_build_arg}"
-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="${experimental_targets_to_build_arg}"
-DLLVM_DEFAULT_TARGET_TRIPLE="${TARGET_TRIPLE}"
-DLLVM_DEFAULT_TARGET_TRIPLE="${LLVM_TARGET_TRIPLE}"
-DLLVM_TARGET_ARCH="${LLVM_TARGET_ARCH}"
-DLLVM_ENABLE_PROJECTS="${llvm_enable_projects_arg}"
-DLLVM_EXTERNAL_PROJECTS="${llvm_external_projects_arg}"

View File

@ -37,7 +37,7 @@ set(LLVM_TARGETS_WITH_JIT @LLVM_TARGETS_WITH_JIT@)
@all_llvm_lib_deps@
set(TARGET_TRIPLE "@TARGET_TRIPLE@")
set(LLVM_TARGET_TRIPLE "@LLVM_TARGET_TRIPLE@")
set(LLVM_HOST_TRIPLE "@LLVM_HOST_TRIPLE@")

View File

@ -75,7 +75,7 @@ function(builtin_default_target compiler_rt_path)
set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR_default ON)
# AIX should fold 32-bit & 64-bit arch libraries into a single archive.
if (TARGET_TRIPLE MATCHES "aix")
if (LLVM_TARGET_TRIPLE MATCHES "aix")
set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR_default OFF)
endif()
@ -84,7 +84,7 @@ function(builtin_default_target compiler_rt_path)
DEPENDS ${ARG_DEPENDS}
CMAKE_ARGS -DLLVM_LIBRARY_OUTPUT_INTDIR=${LLVM_LIBRARY_DIR}
-DLLVM_RUNTIME_OUTPUT_INTDIR=${LLVM_TOOLS_BINARY_DIR}
-DLLVM_DEFAULT_TARGET_TRIPLE=${TARGET_TRIPLE}
-DLLVM_DEFAULT_TARGET_TRIPLE=${LLVM_TARGET_TRIPLE}
-DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=${LLVM_ENABLE_PER_TARGET_RUNTIME_DIR_default}
-DCMAKE_C_COMPILER_WORKS=ON
-DCMAKE_ASM_COMPILER_WORKS=ON
@ -95,7 +95,7 @@ function(builtin_default_target compiler_rt_path)
DARWIN
SANITIZER
USE_TOOLCHAIN
TARGET_TRIPLE ${TARGET_TRIPLE}
TARGET_TRIPLE ${LLVM_TARGET_TRIPLE}
${EXTRA_ARGS})
endfunction()
@ -232,7 +232,7 @@ function(runtime_default_target)
set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR_default ON)
# AIX should fold 32-bit & 64-bit arch libraries into a single archive.
if (TARGET_TRIPLE MATCHES "aix")
if (LLVM_TARGET_TRIPLE MATCHES "aix")
set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR_default OFF)
endif()
@ -242,7 +242,7 @@ function(runtime_default_target)
# Builtins were built separately above
CMAKE_ARGS -DCOMPILER_RT_BUILD_BUILTINS=Off
-DLLVM_INCLUDE_TESTS=${LLVM_INCLUDE_TESTS}
-DLLVM_DEFAULT_TARGET_TRIPLE=${TARGET_TRIPLE}
-DLLVM_DEFAULT_TARGET_TRIPLE=${LLVM_TARGET_TRIPLE}
-DLLVM_ENABLE_PROJECTS_USED=${LLVM_ENABLE_PROJECTS_USED}
-DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=${LLVM_ENABLE_PER_TARGET_RUNTIME_DIR_default}
-DLLVM_BUILD_TOOLS=${LLVM_BUILD_TOOLS}
@ -261,7 +261,7 @@ function(runtime_default_target)
${SUB_CHECK_TARGETS}
${SUB_INSTALL_TARGETS}
USE_TOOLCHAIN
TARGET_TRIPLE ${TARGET_TRIPLE}
TARGET_TRIPLE ${LLVM_TARGET_TRIPLE}
${EXTRA_ARGS})
endfunction()

View File

@ -3,7 +3,7 @@
import sys
config.host_triple = "@LLVM_HOST_TRIPLE@"
config.target_triple = "@TARGET_TRIPLE@"
config.target_triple = "@LLVM_TARGET_TRIPLE@"
config.llvm_src_root = path(r"@LLVM_SOURCE_DIR@")
config.llvm_obj_root = path(r"@LLVM_BINARY_DIR@")
config.llvm_tools_dir = path(r"@LLVM_TOOLS_DIR@")

View File

@ -35,7 +35,7 @@ write_lit_config("lit_site_cfg") {
"LLVM_HOST_TRIPLE=$llvm_current_triple",
"LLVM_LIT_TOOLS_DIR=", # Intentionally empty, matches cmake build.
"LLVM_TOOLS_DIR=" + rebase_path("$root_out_dir/bin"),
"TARGET_TRIPLE=$llvm_target_triple",
"LLVM_TARGET_TRIPLE=$llvm_target_triple",
"Python3_EXECUTABLE=$python_path",
]

View File

@ -14,7 +14,7 @@ template("write_lit_config") {
rebase_path(get_label_info("//clang-tools-extra", "target_out_dir")),
"CLANG_TOOLS_SOURCE_DIR=" + rebase_path("//clang-tools-extra"),
"LLVM_LIBS_DIR=", # needed only for shared builds
"TARGET_TRIPLE=$llvm_target_triple",
"LLVM_TARGET_TRIPLE=$llvm_target_triple",
]
if (host_os == "win") {
# See comment for Windows solink in llvm/utils/gn/build/toolchain/BUILD.gn

View File

@ -25,7 +25,7 @@ template("write_lit_config") {
"LLVM_LIBS_DIR=", # needed only for shared builds
"LLVM_SOURCE_DIR=" + rebase_path("//llvm", dir),
"LLVM_TOOLS_DIR=" + rebase_path("$root_out_dir/bin", dir),
"TARGET_TRIPLE=$llvm_target_triple",
"LLVM_TARGET_TRIPLE=$llvm_target_triple",
]
if (host_os == "win") {
# See comment for Windows solink in llvm/utils/gn/build/toolchain/BUILD.gn

View File

@ -25,7 +25,7 @@ template("write_lit_cfg") {
"LLVM_SOURCE_DIR=" + rebase_path("//llvm"),
"LLVM_TOOLS_DIR=" + rebase_path("$root_out_dir/bin"),
"Python3_EXECUTABLE=$python_path",
"TARGET_TRIPLE=$llvm_target_triple",
"LLVM_TARGET_TRIPLE=$llvm_target_triple",
]
values += invoker.extra_values
}

View File

@ -24,7 +24,7 @@ template("write_lit_cfg") {
"LLVM_SOURCE_DIR=" + rebase_path("//llvm"),
"LLVM_TOOLS_DIR=" + rebase_path("$root_out_dir/bin"),
"Python3_EXECUTABLE=$python_path",
"TARGET_TRIPLE=$llvm_target_triple",
"LLVM_TARGET_TRIPLE=$llvm_target_triple",
]
values += invoker.extra_values
}

View File

@ -72,7 +72,7 @@ write_lit_config("lit_site_cfg") {
"LLVM_VERSION_SUFFIX=git",
"Python3_EXECUTABLE=$python_path",
"TARGETS_TO_BUILD=$llvm_targets_to_build_string",
"TARGET_TRIPLE=$llvm_target_triple",
"LLVM_TARGET_TRIPLE=$llvm_target_triple",
"LLVM_LIBCXX_USED=0",

View File

@ -3,7 +3,7 @@
import sys
config.host_triple = "@LLVM_HOST_TRIPLE@"
config.target_triple = "@TARGET_TRIPLE@"
config.target_triple = "@LLVM_TARGET_TRIPLE@"
config.llvm_src_root = "@LLVM_SOURCE_DIR@"
config.llvm_obj_root = "@LLVM_BINARY_DIR@"
config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"

View File

@ -3,7 +3,7 @@
import sys
config.host_triple = "@LLVM_HOST_TRIPLE@"
config.target_triple = "@TARGET_TRIPLE@"
config.target_triple = "@LLVM_TARGET_TRIPLE@"
config.llvm_src_root = "@LLVM_SOURCE_DIR@"
config.llvm_obj_root = "@LLVM_BINARY_DIR@"
config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"

View File

@ -11,7 +11,7 @@ config.polly_obj_root = "@POLLY_BINARY_DIR@"
config.polly_lib_dir = "@POLLY_LIB_DIR@"
config.enable_shared = @ENABLE_SHARED@
config.shlibdir = "@SHLIBDIR@"
config.target_triple = "@TARGET_TRIPLE@"
config.target_triple = "@LLVM_TARGET_TRIPLE@"
config.enable_gpgpu_codegen = "@GPU_CODEGEN@"
config.llvm_polly_link_into_tools = "@LLVM_POLLY_LINK_INTO_TOOLS@"
config.has_unittests = @POLLY_GTEST_AVAIL@

View File

@ -6,7 +6,7 @@ config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
config.llvm_libs_dir = "@LLVM_LIBS_DIR@"
config.polly_obj_root = "@POLLY_BINARY_DIR@"
config.polly_lib_dir = "@POLLY_LIB_DIR@"
config.target_triple = "@TARGET_TRIPLE@"
config.target_triple = "@LLVM_TARGET_TRIPLE@"
config.enable_gpgpu_codegen = "@GPU_CODEGEN@"
config.llvm_polly_link_into_tools = "@LLVM_POLLY_LINK_INTO_TOOLS@"
config.targets_to_build = "@TARGETS_TO_BUILD@"
@ -15,7 +15,7 @@ config.extra_paths = "@POLLY_TEST_EXTRA_PATHS@".split(";")
## Check the current platform with regex
import re
EAT_ERR_ON_X86 = ' '
if (re.match(r'^x86_64*', '@TARGET_TRIPLE@') == None) :
if (re.match(r'^x86_64*', '@LLVM_TARGET_TRIPLE@') == None) :
EAT_ERR_ON_X86 = '|| echo \"error is eaten\"'
for arch in config.targets_to_build.split():