Skip to content

Commit e49dd4a

Browse files
steve@obrien.ccelsteveogrande
authored andcommitted
Committing regenerated files
1 parent ad64ad8 commit e49dd4a

File tree

2 files changed

+20
-9
lines changed

2 files changed

+20
-9
lines changed

llvm/utils/gn/build/sync_source_lists_from_cmake.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@ def git_out(args):
6161
gn_files = git_out(["ls-files", "*BUILD.gn"]).splitlines()
6262

6363
# Matches e.g. | "foo.cpp",|, captures |foo| in group 1.
64-
gn_cpp_re = re.compile(r'^\s*"([^$"]+\.(?:cpp|c|h|mm|S))",$', re.MULTILINE)
64+
gn_cpp_re = re.compile(r'^\s*"([^$"]+\.(?:cpp|c|h|S))",$', re.MULTILINE)
6565
# Matches e.g. | bar_sources = [ "foo.cpp" ]|, captures |foo| in group 1.
6666
gn_cpp_re2 = re.compile(
67-
r'^\s*(?:.*_)?sources \+?= \[ "([^$"]+\.(?:cpp|c|h|mm|S))" ]$', re.MULTILINE
67+
r'^\s*(?:.*_)?sources \+?= \[ "([^$"]+\.(?:cpp|c|h|S))" ]$', re.MULTILINE
6868
)
6969
# Matches e.g. | foo.cpp|, captures |foo| in group 1.
70-
cmake_cpp_re = re.compile(r"^\s*([A-Za-z_0-9./-]+\.(?:cpp|c|h|mm|S))$", re.MULTILINE)
70+
cmake_cpp_re = re.compile(r"^\s*([A-Za-z_0-9./-]+\.(?:cpp|c|h|S))$", re.MULTILINE)
7171

7272
changes_by_rev = defaultdict(lambda: defaultdict(lambda: defaultdict(list)))
7373

@@ -108,12 +108,6 @@ def get_sources(source_re, text):
108108

109109
gn_cpp = get_sources(gn_cpp_re, open(gn_file).read())
110110
gn_cpp |= get_sources(gn_cpp_re2, open(gn_file).read())
111-
112-
sources_file = os.path.join(os.path.dirname(gn_file), "sources.gni")
113-
if os.path.exists(sources_file):
114-
gn_cpp |= get_sources(gn_cpp_re, open(sources_file).read())
115-
gn_cpp |= get_sources(gn_cpp_re2, open(sources_file).read())
116-
117111
cmake_cpp = get_sources(cmake_cpp_re, open(cmake_file).read())
118112

119113
if gn_cpp == cmake_cpp:

llvm/utils/gn/build/toolchain/BUILD.gn

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,23 @@ template("unix_toolchain") {
7171
default_output_dir = "{{root_out_dir}}/lib"
7272
}
7373

74+
if (current_os == "ios" || current_os == "mac") {
75+
# gn < 1693 (e214b5d35898) doesn't support |frameworks|, requiring
76+
# frameworks to be listed in |libs|, but gn >= 1808 (3028c6a426a4) forbids
77+
# frameworks from appearing in |libs|. This assertion provides a helpful
78+
# cue to upgrade, and is much more user-friendly than the failure that
79+
# occurs when an older gn encounters |frameworks|.
80+
#
81+
# gn_version doesn’t actually exist in gn < 1709 (52cb644a3fb4), and
82+
# defined(gn_version) doesn't actually work as expected
83+
# (https://crbug.com/gn/183), so 1709 is the true minimum enforced by
84+
# this construct, and if gn_version is not available, this line will still
85+
# be blamed, making the resolution somewhat discoverable.
86+
assert(gn_version >= 1693,
87+
"Your GN is too old! " +
88+
"Update it, perhaps by running llvm/utils/gn/get.py")
89+
}
90+
7491
# Make these apply to all tools below.
7592
lib_switch = "-l"
7693
lib_dir_switch = "-L"

0 commit comments

Comments
 (0)