Skip to content

Commit

Permalink
Merge pull request #2139 from ken-matsui/support-building-libninja-re…
Browse files Browse the repository at this point in the history
…2c-on-configure-py

Support building `libninja-re2c.a` on `configure.py`
  • Loading branch information
jhasse authored Aug 22, 2022
2 parents e17d594 + 8e0af08 commit 864f7b5
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,16 +493,27 @@ def has_re2c():
"changes to src/*.in.cc will not affect your build.")
n.newline()

n.comment('Core source files all build into ninja library.')
cxxvariables = []
if platform.is_msvc():
cxxvariables = [('pdb', 'ninja.pdb')]

n.comment('Generate a library for `ninja-re2c`.')
re2c_objs = []
for name in ['depfile_parser', 'lexer']:
re2c_objs += cxx(name, variables=cxxvariables)
if platform.is_msvc():
n.build(built('ninja-re2c.lib'), 'ar', re2c_objs)
else:
n.build(built('libninja-re2c.a'), 'ar', re2c_objs)
n.newline()

n.comment('Core source files all build into ninja library.')
objs.extend(re2c_objs)
for name in ['build',
'build_log',
'clean',
'clparser',
'debug_flags',
'depfile_parser',
'deps_log',
'disk_interface',
'dyndep',
Expand All @@ -512,7 +523,6 @@ def has_re2c():
'graph',
'graphviz',
'json',
'lexer',
'line_printer',
'manifest_parser',
'metrics',
Expand Down

0 comments on commit 864f7b5

Please sign in to comment.