2 """Generate Abseil compile compile option configs. 4 Usage: <path_to_absl>/copts/generate_copts.py 6 The configs are generated from copts.py. 11 from copts
import COPT_VARS
17 "GENERATED! DO NOT MANUALLY EDIT THIS FILE.",
"",
18 "(1) Edit absl/copts/copts.py.",
19 "(2) Run `python <path_to_absl>/copts/generate_copts.py`." 24 return [item
for sublist
in lists
for item
in sublist]
28 return path.join(path.dirname(__file__), filename)
34 """Style object for CMake copts file.""" 40 return "list(APPEND " + name
49 return "GENERATED_AbseilCopts.cmake" 53 """Style object for Starlark copts file.""" 65 docstring_quotes =
"\"\"\"" 66 return docstring_quotes +
"\n".join(
70 return "GENERATED_copts.bzl" 74 """Copt file generation.""" 76 make_line =
lambda s:
" \"" + s +
"\"" + style.separator()
77 external_str_list = [make_line(s)
for s
in arg_list]
81 [style.list_introducer(name)],
83 [style.list_closer()]))
87 """Creates a generated copt file using the given style object. 90 style: either StarlarkStyle() or CMakeStyle() 93 f.write(style.docstring())
95 for var_name, arg_list
in sorted(COPT_VARS.items()):
97 f.write(
copt_list(var_name, arg_list, style))
102 raise RuntimeError(
"generate_copts needs no command line args")
108 if __name__ ==
"__main__":
def list_introducer(self, name)
def generate_copt_file(style)
def copt_list(name, arg_list, style)
def list_introducer(self, name)
def relative_filename(filename)