stevedlawrence commented on a change in pull request #422:
URL: https://github.com/apache/incubator-daffodil/pull/422#discussion_r498364697
##########
File path: daffodil-runtime2/src/main/c/common_runtime.c
##########
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
Review comment:
A thought, instead of having this cc plugin and putting code in
src/main/c/ to compile everything into a static lib, what if we instead just
put these c/h files in src/main/resources/, and don't actually compile them as
part of the sbt build. Instead when we generate code for a DFDL schema, we just
copy these files out of the jar and then compile them along with the generate
files? This removes any complexity in the sbt config about cc or libraries or
anything, and just treats the static stuff like normal resources, making the
sbt config much simpler.
Downside is it would perhaps take a little longer to compile generated code
since every schema will need to compile these same files, but perhaps the
compilation is fast enough? And I suspect as this is made to support more
complex schemas, the size of the generated code will outnumber the size of the
static stuff. And if compilation time was an issue, the compiling part of this
code generator could separately build the static lib and cache it for reuse for
other DFDL schemas.
Another downisde is that you can't easily compile and test just the static
parts, but I figure the bulk of testing needs to be done with the generated
code to ensure correctness, which will implicitly test the static code.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]