1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00
llvm-mirror/utils/gn/build/symlink_or_copy.gni
Petr Hosek 0d2bd5df2b [gn] Rebase paths in symlink_or_copy against root_build_dir
We should be always rebasing paths against root_build_dir which is
the directory where scripts are run from, not root_out_dir which is
the current toolchain directory. The latter can result in invalid
paths when the action is being used from a non-default toolchain.

Differential Revision: https://reviews.llvm.org/D60330

llvm-svn: 357798
2019-04-05 19:13:54 +00:00

25 lines
670 B
Plaintext

# Creates a symlink (or, on Windows, copies).
# Args:
# source: Path to link to.
# output: Where to create the symlink.
template("symlink_or_copy") {
action(target_name) {
forward_variables_from(invoker, [ "deps" ])
# Make a stamp file the output to work around
# https://github.com/ninja-build/ninja/issues/1186
stamp =
"$target_gen_dir/" + get_path_info(invoker.output, "file") + ".stamp"
outputs = [
stamp,
]
script = "//llvm/utils/gn/build/symlink_or_copy.py"
args = [
"--stamp",
rebase_path(stamp, root_build_dir),
invoker.source,
rebase_path(invoker.output, root_build_dir),
]
}
}