diff options
Diffstat (limited to 'llvm/utils/gn/secondary/clang/test/BUILD.gn')
| -rw-r--r-- | llvm/utils/gn/secondary/clang/test/BUILD.gn | 51 |
1 files changed, 21 insertions, 30 deletions
diff --git a/llvm/utils/gn/secondary/clang/test/BUILD.gn b/llvm/utils/gn/secondary/clang/test/BUILD.gn index 0d805bdbe6a..5929eec3353 100644 --- a/llvm/utils/gn/secondary/clang/test/BUILD.gn +++ b/llvm/utils/gn/secondary/clang/test/BUILD.gn @@ -3,24 +3,15 @@ import("//clang/lib/StaticAnalyzer/Frontend/enable.gni") import("//llvm/lib/Target/targets.gni") import("//llvm/triples.gni") import("//llvm/utils/gn/build/libs/zlib/enable.gni") +import("//llvm/utils/gn/build/write_cmake_config.gni") import("clang_lit_site_cfg_files.gni") template("write_lit_config") { - action(target_name) { - script = "//llvm/utils/gn/build/write_cmake_config.py" - - sources = [ - invoker.input, - ] - outputs = [ - invoker.output, - ] - args = [ - "-o", - rebase_path(outputs[0], root_out_dir), - rebase_path(sources[0], root_out_dir), - - "LIT_SITE_CFG_IN_HEADER=## Autogenerated from ${sources[0]}, do not edit", + write_cmake_config(target_name) { + input = invoker.input + output = invoker.output + values = [ + "LIT_SITE_CFG_IN_HEADER=## Autogenerated from $input, do not edit", "CLANG_BINARY_DIR=" + rebase_path(get_label_info("//clang", "target_out_dir")), "CLANG_SOURCE_DIR=" + rebase_path("//clang"), @@ -34,11 +25,11 @@ template("write_lit_config") { ] if (host_os == "win") { # See comment for Windows solink in llvm/utils/gn/build/toolchain/BUILD.gn - args += [ "SHLIBDIR=" + rebase_path("$root_out_dir/bin") ] + values += [ "SHLIBDIR=" + rebase_path("$root_out_dir/bin") ] } else { - args += [ "SHLIBDIR=" + rebase_path("$root_out_dir/lib") ] + values += [ "SHLIBDIR=" + rebase_path("$root_out_dir/lib") ] } - args += invoker.extra_args + values += invoker.extra_values } } @@ -47,7 +38,7 @@ write_lit_config("lit_site_cfg") { input = "//clang/test/lit.site.cfg.py.in" output = clang_lit_site_cfg_file - extra_args = [ + extra_values = [ "CLANG_ANALYZER_WITH_Z3=", # Must be empty, not 0. "CLANG_BUILD_EXAMPLES=0", "CLANG_DEFAULT_CXX_STDLIB=", # Empty string means "default value" here. @@ -69,35 +60,35 @@ write_lit_config("lit_site_cfg") { ] if (clang_enable_arcmt) { - extra_args += [ "CLANG_ENABLE_ARCMT=1" ] + extra_values += [ "CLANG_ENABLE_ARCMT=1" ] } else { - extra_args += [ "CLANG_ENABLE_ARCMT=0" ] + extra_values += [ "CLANG_ENABLE_ARCMT=0" ] } if (clang_enable_static_analyzer) { - extra_args += [ "CLANG_ENABLE_STATIC_ANALYZER=1" ] + extra_values += [ "CLANG_ENABLE_STATIC_ANALYZER=1" ] } else { - extra_args += [ "CLANG_ENABLE_STATIC_ANALYZER=0" ] + extra_values += [ "CLANG_ENABLE_STATIC_ANALYZER=0" ] } if (llvm_enable_zlib) { - extra_args += [ "HAVE_LIBZ=1" ] + extra_values += [ "HAVE_LIBZ=1" ] } else { - extra_args += [ "HAVE_LIBZ=0" ] # Must be 0. + extra_values += [ "HAVE_LIBZ=0" ] # Must be 0. } if (host_cpu == "x64") { - extra_args += [ "HOST_ARCH=x86_64" ] + extra_values += [ "HOST_ARCH=x86_64" ] } else { assert(false, "unimplemented host_cpu " + host_cpu) } if (host_os == "mac") { - extra_args += [ "LLVM_PLUGIN_EXT=.dylib" ] + extra_values += [ "LLVM_PLUGIN_EXT=.dylib" ] } else if (host_os == "win") { - extra_args += [ "LLVM_PLUGIN_EXT=.dll" ] + extra_values += [ "LLVM_PLUGIN_EXT=.dll" ] } else { - extra_args += [ "LLVM_PLUGIN_EXT=.so" ] + extra_values += [ "LLVM_PLUGIN_EXT=.so" ] } } @@ -105,7 +96,7 @@ write_lit_config("lit_unit_site_cfg") { # Fully-qualified instead of relative for LIT_SITE_CFG_IN_HEADER. input = "//clang/test/Unit/lit.site.cfg.py.in" output = clang_lit_unit_site_cfg_file - extra_args = [ "LLVM_BUILD_MODE=." ] + extra_values = [ "LLVM_BUILD_MODE=." ] } # This target should contain all dependencies of check-clang. |

