[zeromq-dev] Fighting between zproto and zproject.

Brett Viren bv at bnl.gov
Fri Oct 11 23:53:04 CEST 2019


Hi,

I'm rather confused about what should be generating headers and source
when both zproto and zproject are used.

Trying three ways:

1:
  (rm all generated source and headers)
  gsl project.xml

2:
  (rm all generated source and headers)
  gsl project.xml
  make code  

3:
  (rm all generated source and headers)
  gsl project.xml
  (rm generated src/*_{client,server,proto}*.{inc,hpp,cpp}
  cd src && gsl *.xml

It's the last that seems to produce the best code.

The source generated by just "gsl project.xml" lacks some of the
niceties of the version that "cd src && gsl *.xml" provides such as more
contents in the initial private structs.

I found this past message which seems to speak to the issue:

  https://zeromq-dev.zeromq.narkive.com/uiD9AXgS/czmq-code-generation

Should #3 be what is baked into "make code"?

Or, is it that a new project supposed to do a one-time explicit

  cd src && gsl *.xml

then rely on the fact that subsequent "make code" will not rewrite the
source?


A minor secondary problem is that "make code" causes the "proto" header
to be generated by zproject while zproto's version has a nice comment
block describing all the messages.


So, I think that the Makemodule.am file should change from:

code:
	cd $(srcdir)/src; gsl -topdir:.. -zproject:1 -q zperf_msg.xml
	cd $(srcdir)/src; gsl -topdir:.. -zproject:1 -q zperf_server.xml
	cd $(srcdir)/src; gsl -topdir:.. -zproject:1 -q zperf_client.xml
	cd $(srcdir); gsl -target:- project.xml

to:

code:
	cd $(srcdir); gsl -target:- project.xml
	cd $(srcdir)/src; gsl -topdir:.. -q zperf_msg.xml
	cd $(srcdir)/src; gsl -topdir:.. -q zperf_server.xml
	cd $(srcdir)/src; gsl -topdir:.. -q zperf_client.xml


(where "zperf" is my project)


Thanks,
-Brett.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20191011/86ce9b9a/attachment.sig>


More information about the zeromq-dev mailing list