[llvm] aed67a3 - [gn build] (manually) merge 8f766e382b77eef in a minimal way
Nico Weber via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 24 06:33:45 PDT 2020
Author: Nico Weber
Date: 2020-04-24T09:33:35-04:00
New Revision: aed67a3df755e76185f9e8b6086e29ac9131ff98
URL: https://github.com/llvm/llvm-project/commit/aed67a3df755e76185f9e8b6086e29ac9131ff98
DIFF: https://github.com/llvm/llvm-project/commit/aed67a3df755e76185f9e8b6086e29ac9131ff98.diff
LOG: [gn build] (manually) merge 8f766e382b77eef in a minimal way
Added:
llvm/utils/gn/secondary/llvm/tools/llvm-config/write_extension_dependencies.py
Modified:
llvm/utils/gn/secondary/llvm/tools/llvm-config/BUILD.gn
Removed:
################################################################################
diff --git a/llvm/utils/gn/secondary/llvm/tools/llvm-config/BUILD.gn b/llvm/utils/gn/secondary/llvm/tools/llvm-config/BUILD.gn
index 6c2ab6f457fc..5bc2427887d5 100644
--- a/llvm/utils/gn/secondary/llvm/tools/llvm-config/BUILD.gn
+++ b/llvm/utils/gn/secondary/llvm/tools/llvm-config/BUILD.gn
@@ -7,6 +7,15 @@ import("//llvm/utils/gn/build/libs/zlib/enable.gni")
import("//llvm/utils/gn/build/write_cmake_config.gni")
import("//llvm/version.gni")
+action("write_extension_dependencies") {
+ script = "//llvm/utils/gn/secondary/llvm/tools/llvm-config/write_extension_dependencies.py"
+ outputs = [ "$target_gen_dir/ExtensionDependencies.inc" ]
+ args = [
+ "-o",
+ rebase_path(outputs[0], root_build_dir),
+ ]
+}
+
write_cmake_config("BuildVariables.inc") {
input = "BuildVariables.inc.in"
output = "$target_gen_dir/BuildVariables.inc"
@@ -108,6 +117,7 @@ executable("llvm-config") {
deps = [
":BuildVariables.inc",
":LibraryDependencies.inc",
+ ":write_extension_dependencies",
"//llvm/include/llvm/Config:config",
"//llvm/include/llvm/Config:llvm-config",
"//llvm/lib/Support",
diff --git a/llvm/utils/gn/secondary/llvm/tools/llvm-config/write_extension_dependencies.py b/llvm/utils/gn/secondary/llvm/tools/llvm-config/write_extension_dependencies.py
new file mode 100644
index 000000000000..1ebe95ea35ac
--- /dev/null
+++ b/llvm/utils/gn/secondary/llvm/tools/llvm-config/write_extension_dependencies.py
@@ -0,0 +1,30 @@
+#!/usr/bin/env python
+r"""Writes ExtensionDepencencies.inc."""
+
+from __future__ import print_function
+
+import argparse
+import os
+import re
+import sys
+
+
+def main():
+ parser = argparse.ArgumentParser(description=__doc__)
+ parser.add_argument('-o', '--output', required=True,
+ help='output file')
+ args = parser.parse_args()
+
+ source = """\
+#include <array>
+struct ExtensionDescriptor {
+ const char* Name;
+ const char* const RequiredLibraries[1 + 1];
+};
+std::array<ExtensionDescriptor, 0> AvailableExtensions{};
+"""
+ open(args.output, 'w').write(source)
+
+
+if __name__ == '__main__':
+ sys.exit(main())
More information about the llvm-commits
mailing list