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_cmake_config.gni` file to suit clspv build
# structure.
import("//build_overrides/clspv.gni")
# based on llvm/utils/gn/build/write_cmake_config.gni
# This file introduces a templates for calling write_cmake_config.py.
#
# write_cmake_config behaves like CMake's configure_file(), but runs at build
# time, not at generator time. See write_cmake_config.py for details.
#
# Parameters:
#
# input (required) [string]
#
# output (required) [string]
#
# values (required) [list of strings]
# Each entry is a '='-separated key-value pair used for substitution.
#
# Example use:
#
# write_cmake_config("attributes_compat_func_gen") {
# input = "Version.inc.in"
# output = "$root_gen_dir/clang/include/clang/Basic/Version.inc",
# values = [
# "CLANG_VERSION=$llvm_version",
# ]
# }
template("write_cmake_config") {
assert(defined(invoker.input), "must set 'input' in $target_name")
assert(defined(invoker.output), "must set 'output' in $target_name")
assert(defined(invoker.values), "must set 'values' in $target_name")
action(target_name) {
script = "//$clspv_llvm_dir/llvm/utils/gn/build/write_cmake_config.py"
sources = [ invoker.input ]
outputs = [ invoker.output ]
args = [
"-o",
rebase_path(outputs[0], root_build_dir),
rebase_path(sources[0], root_build_dir),
] + invoker.values
forward_variables_from(invoker,
[
"configs",
"deps",
"public_configs",
"public_deps",
"visibility",
])
}
}