xref: /llvm-project/llvm/utils/gn/secondary/compiler-rt/gen_version_script.gni (revision b1985dd74de8c5c0d9eeec0a912ad3f42d0b2c0a)
1import("//compiler-rt/target.gni")
2
3template("gen_version_script") {
4  if (current_os != "mac" && current_os != "win") {
5    action(target_name) {
6      script = "//compiler-rt/lib/sanitizer_common/scripts/gen_dynamic_list.py"
7      sources = [ invoker.extra ]
8      deps = invoker.libs
9      outputs = [ invoker.output ]
10      args = [
11        "--version-list",
12        "--extra",
13        rebase_path(invoker.extra, root_build_dir),
14      ]
15      foreach(lib_name, invoker.lib_names) {
16        args += [ rebase_path(
17                "$crt_current_out_dir/libclang_rt.$lib_name$crt_current_target_suffix.a",
18                root_build_dir) ]
19      }
20      args += [
21        "--nm-executable",
22        "nm",
23        "-o",
24        rebase_path(invoker.output, root_build_dir),
25      ]
26    }
27  } else {
28    source_set(target_name) {
29    }
30    not_needed(invoker,
31               [
32                 "extra",
33                 "lib_names",
34                 "libs",
35                 "output",
36               ])
37  }
38}
39