Hash :
cd56b248
Author :
Date :
2023-12-08T15:36:17
third_party/clspv: Add GN build files The clspv project uses CMake for build. Adding support for GN build in here. The build is currently setup to generate linux/x86 and android/arm64 artifacts for now and relevant gn files are placed in `third_party/clspv` location. Bug: angleproject:8369 Change-Id: Iec7ef1916617a8b8a93324ff7302f89bd571b814 Signed-off-by: Gowtham Tammana <g.tammana@samsung.com> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5106594 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
# Modified `llvm/utils/gn/build/write_vcsrevision.gni` file to suit clspv build
# structure.
import("//build_overrides/clspv.gni")
# This file introduces a templates for calling write_vcsrevision.py.
#
# Parameters:
#
# header (required) [string]
#
# names (optional) [list of strings]
# Writes "$foo_REVISION" and "$foo_REPOSITORY" for each foo in names.
# Defaults to [ "LLVM" ]
declare_args() {
# If this is set to true, VCSRevision.h is updated after every git commit.
# That's technically correct, but results in rebuilds after every commit.
# If it's false (default), VCSRevision.h will not contain a revision.
llvm_append_vc_rev = false
}
template("write_vcsrevision") {
assert(defined(invoker.header), "must set 'header' in $target_name")
action(target_name) {
script = "//$clspv_llvm_dir/llvm/utils/gn/build/write_vcsrevision.py"
header = invoker.header
if (defined(invoker.names)) {
names = invoker.names
} else {
names = [ "LLVM" ]
}
args = [ rebase_path(header, root_build_dir) ]
if (llvm_append_vc_rev) {
depfile = "$header.d"
args += [
"--write-git-rev",
"-d",
rebase_path(depfile, root_build_dir),
]
}
foreach(name, names) {
args += [ "--name=$name" ]
}
outputs = [ header ]
forward_variables_from(invoker,
[
"public_configs",
"visibility",
])
}
}