[gn build] (manually) port 505ddb6b74 (remove Unit/lit.site.cfg.py)

This commit is contained in:
Nico Weber 2022-05-19 15:18:56 -04:00
parent 505ddb6b74
commit e0b98902a2
2 changed files with 32 additions and 51 deletions

View File

@ -6,11 +6,12 @@ import("//llvm/utils/gn/build/libs/zlib/enable.gni")
import("//llvm/utils/gn/build/write_cmake_config.gni") import("//llvm/utils/gn/build/write_cmake_config.gni")
import("lld_lit_site_cfg_files.gni") import("lld_lit_site_cfg_files.gni")
# The bits common to writing lit.site.cfg.py.in and Unit/lit.site.cfg.py.in. write_cmake_config("lit_site_cfg") {
template("write_lit_cfg") { # Fully-qualified instead of relative for LIT_SITE_CFG_IN_HEADER.
write_cmake_config(target_name) { input = "//lld/test/lit.site.cfg.py.in"
input = invoker.input output = lld_lit_site_cfg_file
output = invoker.output dir = get_path_info(output, "dir")
values = [ values = [
"LIT_SITE_CFG_IN_HEADER=## Autogenerated from $input, do not edit", "LIT_SITE_CFG_IN_HEADER=## Autogenerated from $input, do not edit",
"LLD_BINARY_DIR=" + "LLD_BINARY_DIR=" +
@ -26,25 +27,14 @@ template("write_lit_cfg") {
"LLVM_TOOLS_DIR=" + rebase_path("$root_out_dir/bin"), "LLVM_TOOLS_DIR=" + rebase_path("$root_out_dir/bin"),
"Python3_EXECUTABLE=$python_path", "Python3_EXECUTABLE=$python_path",
"LLVM_TARGET_TRIPLE=$llvm_target_triple", "LLVM_TARGET_TRIPLE=$llvm_target_triple",
]
values += invoker.extra_values
}
}
write_lit_cfg("lit_site_cfg") {
# Fully-qualified instead of relative for LIT_SITE_CFG_IN_HEADER.
input = "//lld/test/lit.site.cfg.py.in"
output = lld_lit_site_cfg_file
dir = get_path_info(output, "dir")
extra_values = [
"LLD_DEFAULT_LD_LLD_IS_MINGW=0", "LLD_DEFAULT_LD_LLD_IS_MINGW=0",
"LLVM_BUILD_EXAMPLES=0", "LLVM_BUILD_EXAMPLES=0",
"LLVM_BYE_LINK_INTO_TOOLS=0", "LLVM_BYE_LINK_INTO_TOOLS=0",
] ]
if (host_os == "win") { if (host_os == "win") {
extra_values += [ values += [
"LLVM_LIT_ERRC_MESSAGES=no such file or directory;is a directory;" + "LLVM_LIT_ERRC_MESSAGES=no such file or directory;is a directory;" +
"invalid argument;permission denied", "invalid argument;permission denied",
"LLVM_ENABLE_PLUGINS=0", "LLVM_ENABLE_PLUGINS=0",
@ -53,7 +43,7 @@ write_lit_cfg("lit_site_cfg") {
"SHLIBDIR=" + rebase_path("$root_out_dir/bin", dir), "SHLIBDIR=" + rebase_path("$root_out_dir/bin", dir),
] ]
} else { } else {
extra_values += [ values += [
"LLVM_LIT_ERRC_MESSAGES=", "LLVM_LIT_ERRC_MESSAGES=",
"LLVM_ENABLE_PLUGINS=1", "LLVM_ENABLE_PLUGINS=1",
"SHLIBDIR=" + rebase_path("$root_out_dir/lib", dir), "SHLIBDIR=" + rebase_path("$root_out_dir/lib", dir),
@ -61,59 +51,51 @@ write_lit_cfg("lit_site_cfg") {
} }
if (host_os == "mac") { if (host_os == "mac") {
extra_values += [ "SHLIBEXT=.dylib" ] values += [ "SHLIBEXT=.dylib" ]
} else if (host_os == "win") { } else if (host_os == "win") {
extra_values += [ "SHLIBEXT=.dll" ] values += [ "SHLIBEXT=.dll" ]
} else { } else {
extra_values += [ "SHLIBEXT=.so" ] values += [ "SHLIBEXT=.so" ]
} }
if (llvm_enable_dia_sdk) { if (llvm_enable_dia_sdk) {
extra_values += [ "LLVM_ENABLE_DIA_SDK=1" ] values += [ "LLVM_ENABLE_DIA_SDK=1" ]
} else { } else {
extra_values += [ "LLVM_ENABLE_DIA_SDK=0" ] # Must be 0. values += [ "LLVM_ENABLE_DIA_SDK=0" ] # Must be 0.
} }
if (llvm_enable_libxar) { if (llvm_enable_libxar) {
extra_values += [ "LLVM_HAVE_LIBXAR=1" ] values += [ "LLVM_HAVE_LIBXAR=1" ]
} else { } else {
extra_values += [ "LLVM_HAVE_LIBXAR=0" ] # Must be 0. values += [ "LLVM_HAVE_LIBXAR=0" ] # Must be 0.
} }
if (llvm_enable_libxml2) { if (llvm_enable_libxml2) {
extra_values += [ "LLVM_ENABLE_LIBXML2=1" ] values += [ "LLVM_ENABLE_LIBXML2=1" ]
} else { } else {
extra_values += [ "LLVM_ENABLE_LIBXML2=0" ] # Must be 0. values += [ "LLVM_ENABLE_LIBXML2=0" ] # Must be 0.
} }
if (llvm_enable_zlib) { if (llvm_enable_zlib) {
extra_values += [ "LLVM_ENABLE_ZLIB=1" ] values += [ "LLVM_ENABLE_ZLIB=1" ]
} else { } else {
extra_values += [ "LLVM_ENABLE_ZLIB=0" ] # Must be 0. values += [ "LLVM_ENABLE_ZLIB=0" ] # Must be 0.
} }
if (current_cpu == "x64" || current_cpu == "arm64" || if (current_cpu == "x64" || current_cpu == "arm64" ||
current_cpu == "ppc64") { current_cpu == "ppc64") {
extra_values += [ "CMAKE_SIZEOF_VOID_P=8" ] values += [ "CMAKE_SIZEOF_VOID_P=8" ]
} else { } else {
extra_values += [ "CMAKE_SIZEOF_VOID_P=4" ] values += [ "CMAKE_SIZEOF_VOID_P=4" ]
} }
} }
write_lit_cfg("lit_unit_site_cfg") {
# Fully-qualified instead of relative for LIT_SITE_CFG_IN_HEADER.
input = "//lld/test/Unit/lit.site.cfg.py.in"
output = lld_lit_unit_site_cfg_file
extra_values = [ "LLVM_BUILD_MODE=." ]
}
# This target should contain all dependencies of check-lld. # This target should contain all dependencies of check-lld.
# //:default depends on it, so that ninja's default target builds all # //:default depends on it, so that ninja's default target builds all
# prerequisites for check-lld but doesn't run check-lld itself. # prerequisites for check-lld but doesn't run check-lld itself.
group("test") { group("test") {
deps = [ deps = [
":lit_site_cfg", ":lit_site_cfg",
":lit_unit_site_cfg",
"//lld/tools/lld:symlinks", "//lld/tools/lld:symlinks",
"//llvm/tools/dsymutil", "//llvm/tools/dsymutil",
"//llvm/tools/llc", "//llvm/tools/llc",

View File

@ -30,7 +30,6 @@ write_cmake_config("llvm-lit") {
"//clang/test:lit_site_cfg", "//clang/test:lit_site_cfg",
"//clang/test:lit_unit_site_cfg", "//clang/test:lit_unit_site_cfg",
"//lld/test:lit_site_cfg", "//lld/test:lit_site_cfg",
"//lld/test:lit_unit_site_cfg",
"//lldb/test:lit_api_site_cfg", "//lldb/test:lit_api_site_cfg",
"//lldb/test:lit_shell_site_cfg", "//lldb/test:lit_shell_site_cfg",
"//lldb/test:lit_site_cfg", "//lldb/test:lit_site_cfg",