diff options
author | Joshua Haberman <jhaberman@gmail.com> | 2018-03-07 17:04:39 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-07 17:04:39 -0800 |
commit | 9dbe75a403cc501700bc785185af8cbca870a2cb (patch) | |
tree | 7b4716b894b488a414c6e57881fc2b6993392090 /tools/upbc.lua | |
parent | 681cf4279c152e60e67989b83134018c7058f874 (diff) | |
parent | cea737028f7d34e6415c0de5d34587245624db2b (diff) |
Merge pull request #102 from haberman/descriptor-in-core
Added google/protobuf/descriptor.upb.* to core.
Diffstat (limited to 'tools/upbc.lua')
-rw-r--r-- | tools/upbc.lua | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/tools/upbc.lua b/tools/upbc.lua index a538b1c..8ac4f73 100644 --- a/tools/upbc.lua +++ b/tools/upbc.lua @@ -77,28 +77,28 @@ for _, file in ipairs(files) do hfile:close() cfile:close() - end - - -- Write C API. - hfilename = outbase .. ".upb.h" - cfilename = outbase .. ".upb.c" - - if os.getenv("UPBC_VERBOSE") then - print("upbc:") - print(string.format(" source file=%s", src)) - print(string.format(" output file base=%s", outbase)) - print(string.format(" hfilename=%s", hfilename)) - print(string.format(" cfilename=%s", cfilename)) - end + else + -- Write C API. + hfilename = outbase .. ".upb.h" + cfilename = outbase .. ".upb.c" + + if os.getenv("UPBC_VERBOSE") then + print("upbc:") + print(string.format(" source file=%s", src)) + print(string.format(" output file base=%s", outbase)) + print(string.format(" hfilename=%s", hfilename)) + print(string.format(" cfilename=%s", cfilename)) + end - local hfile = assert(io.open(hfilename, "w"), "couldn't open " .. hfilename) - local cfile = assert(io.open(cfilename, "w"), "couldn't open " .. cfilename) + local hfile = assert(io.open(hfilename, "w"), "couldn't open " .. hfilename) + local cfile = assert(io.open(cfilename, "w"), "couldn't open " .. cfilename) - local happend = dump_cinit.file_appender(hfile) - local cappend = dump_cinit.file_appender(cfile) + local happend = dump_cinit.file_appender(hfile) + local cappend = dump_cinit.file_appender(cfile) - make_c_api.write_gencode(file, hfilename, happend, cappend) + make_c_api.write_gencode(file, hfilename, happend, cappend) - hfile:close() - cfile:close() + hfile:close() + cfile:close() + end end |