Extract Flang's runtime library to use the LLVM_ENABLE_RUNTIME mechanism. It will only become active when `LLVM_ENABLE_RUNTIMES=flang-rt` is used, which also changes the `FLANG_INCLUDE_RUNTIME` to `OFF` so the old runtime build rules do not conflict. This also means that unless `LLVM_ENABLE_RUNTIMES=flang-rt` is passed, nothing changes with the current build process. Motivation: * Consistency with LLVM's other runtime libraries (compiler-rt, libc, libcxx, openmp offload, ...) * Allows compiling the runtime for multiple targets at once using the LLVM_RUNTIME_TARGETS configuration options * Installs the runtime into the compiler's per-target resource directory so it can be automatically found even when cross-compiling Also see RFC discussion at https://discourse.llvm.org/t/rfc-use-llvm-enable-runtimes-for-flangs-runtime/80826
40 lines
1.8 KiB
Python
40 lines
1.8 KiB
Python
@LIT_SITE_CFG_IN_HEADER@
|
|
|
|
import sys
|
|
import lit.util
|
|
|
|
config.llvm_tools_dir = lit_config.substitute("@LLVM_TOOLS_DIR@")
|
|
config.llvm_shlib_dir = lit_config.substitute(path(r"@SHLIBDIR@"))
|
|
config.llvm_plugin_ext = "@LLVM_PLUGIN_EXT@"
|
|
config.target_triple = "@LLVM_TARGET_TRIPLE@"
|
|
config.llvm_target_triple_env = "@LLVM_TARGET_TRIPLE_ENV@"
|
|
config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@"
|
|
config.errc_messages = "@LLVM_LIT_ERRC_MESSAGES@"
|
|
config.flang_obj_root = "@FLANG_BINARY_DIR@"
|
|
config.flang_tools_dir = lit_config.substitute("@FLANG_TOOLS_DIR@")
|
|
config.flang_intrinsic_modules_dir = "@FLANG_INTRINSIC_MODULES_DIR@"
|
|
config.flang_llvm_tools_dir = "@CMAKE_BINARY_DIR@/bin"
|
|
config.flang_test_triple = "@FLANG_TEST_TARGET_TRIPLE@"
|
|
config.flang_examples = @LLVM_BUILD_EXAMPLES@
|
|
config.python_executable = "@PYTHON_EXECUTABLE@"
|
|
config.flang_standalone_build = @FLANG_STANDALONE_BUILD@
|
|
config.has_plugins = @LLVM_ENABLE_PLUGINS@
|
|
config.linked_bye_extension = @LLVM_BYE_LINK_INTO_TOOLS@
|
|
config.osx_sysroot = path(r"@CMAKE_OSX_SYSROOT@")
|
|
config.targets_to_build = "@TARGETS_TO_BUILD@"
|
|
config.default_sysroot = "@DEFAULT_SYSROOT@"
|
|
config.have_openmp_rtl = ("@LLVM_TOOL_OPENMP_BUILD@" == "TRUE") or ("openmp" in "@LLVM_ENABLE_RUNTIMES@".lower().split(";"))
|
|
if "openmp" in "@LLVM_ENABLE_RUNTIMES@".lower().split(";"):
|
|
config.openmp_module_dir = "@CMAKE_BINARY_DIR@/runtimes/runtimes-bins/openmp/runtime/src"
|
|
else:
|
|
config.openmp_module_dir = None
|
|
config.flang_runtime_f128_math_lib = "@FLANG_RUNTIME_F128_MATH_LIB@"
|
|
config.have_ldbl_mant_dig_113 = "@HAVE_LDBL_MANT_DIG_113@"
|
|
config.flang_include_runtime = lit.util.pythonize_bool("@FLANG_INCLUDE_RUNTIME@")
|
|
|
|
import lit.llvm
|
|
lit.llvm.initialize(lit_config, config)
|
|
|
|
# Let the main config do the real work.
|
|
lit_config.load_config(config, "@FLANG_SOURCE_DIR@/test/lit.cfg.py")
|