Skip to content

Commit 27d344d

Browse files
authored
[gn build] Port 7964b66 (#200914)
1 parent 659c3fb commit 27d344d

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

llvm/utils/gn/build/write_cmake_config.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ def main():
5353
if key in values:
5454
print('duplicate key "%s" in args' % key, file=sys.stderr)
5555
return 1
56+
if val.startswith("@file:"):
57+
file_path = val[len("@file:"):]
58+
with open(file_path) as f:
59+
val = f.read()
5660
values[key] = val.replace("\\n", "\n")
5761
unused_values = set(values.keys())
5862

llvm/utils/gn/secondary/llvm/lib/Transforms/IPO/BUILD.gn

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
1+
import("//llvm/utils/gn/build/write_cmake_config.gni")
2+
3+
write_cmake_config("write_instrumentor_variables") {
4+
input = "//llvm/include/llvm/Transforms/IPO/InstrumentorVariables.inc.in"
5+
output =
6+
"$root_gen_dir/llvm/include/llvm/Transforms/IPO/InstrumentorVariables.inc"
7+
values =
8+
[ "LLVM_INSTRUMENTOR_RUNTIME_HELPER=@file:" +
9+
rebase_path(
10+
"//llvm/include/llvm/Transforms/IPO/InstrumentorRuntimeHelper.h",
11+
root_build_dir) ]
12+
}
13+
114
static_library("IPO") {
215
output_name = "LLVMipo"
316
deps = [
17+
":write_instrumentor_variables",
418
"//llvm/lib/Analysis",
519
"//llvm/lib/Bitcode/Reader",
620
"//llvm/lib/Bitcode/Writer",

0 commit comments

Comments
 (0)