Aim: Add include-local to the groveller.
Behaviour: - uses #include "name.h" rather than #include <name.h> - expects the header file to be local to the wrapper/groveler specification file. This file is copied to the cache dir (with the generated c file) so it can be used in the build.
Reason: This allows us to wrap single header libraries simply by making a wrapper spec containing
(include-local "some_header_lib.h")
I'd love to hear some thoughts on this. I'm happy to get this done if it's approved.
Regards Chris
On Sun, Sep 11, 2016 at 11:42 AM, Chris Bagley chris.bagley@gmail.com wrote:
(include-local "some_header_lib.h")
I'd love to hear some thoughts on this. I'm happy to get this done if it's approved.
Makes sense. If we were starting from scratch perhaps we could have (include "<foo.h>") and (include "foo.h") instead. (include ""foo.h"") would be strange, right?
Anyway, include-local seems like the way to go.
Cheers,
On Sun, Sep 11, 2016 at 11:42 AM, Chris Bagley chris.bagley@gmail.com wrote:
(include-local "some_header_lib.h")
I'd love to hear some thoughts on this. I'm happy to get this done if it's approved.
Makes sense. If we were starting from scratch perhaps we could have (include "<foo.h>") and (include "foo.h") instead. (include ""foo.h"") would be strange, right?
Anyway, include-local seems like the way to go.
I think it's better for the groveler to add the source directory to the include path, so that the distinction doesn't matter.
with grovel.c being
<<< #include <foo.h>
cc -I/path/to/sources/ grovel.c
will then search for foo.c first in /path/to/sources/ and then in the default system include path.
Thanks guys, I like fe[nl]ix's idea too, I will check that out. Also I thing I'm going to use asdf paths to specify the location of the header file. This will mean the file will have to be defined as a :static-file but that sounds sensible.
Will probably make this next week as this one is booked up with work stuff.
On 13 September 2016 at 13:58, Stelian Ionescu sionescu@cddr.org wrote:
On Sun, Sep 11, 2016 at 11:42 AM, Chris Bagley chris.bagley@gmail.com wrote:
(include-local "some_header_lib.h")
I'd love to hear some thoughts on this. I'm happy to get this done if it's approved.
Makes sense. If we were starting from scratch perhaps we could have (include "<foo.h>") and (include "foo.h") instead. (include ""foo.h"") would be strange, right?
Anyway, include-local seems like the way to go.
I think it's better for the groveler to add the source directory to the include path, so that the distinction doesn't matter.
with grovel.c being
<<< #include <foo.h>
cc -I/path/to/sources/ grovel.c
will then search for foo.c first in /path/to/sources/ and then in the default system include path.
-- Stelian Ionescu a.k.a. fe[nl]ix Quidquid latine dictum sit, altum videtur.
On Tue, Sep 13, 2016 at 2:52 PM, Chris Bagley chris.bagley@gmail.com wrote:
I like fe[nl]ix's idea too
Me too.
I have this working now. I based it's branch on the grovel & wrapper caching one. So I'll hold off submitting that PR until we work out if this one is ok https://github.com/cffi/cffi/pull/102
On 13 September 2016 at 16:00, Luís Oliveira luismbo@gmail.com wrote:
On Tue, Sep 13, 2016 at 2:52 PM, Chris Bagley chris.bagley@gmail.com wrote:
I like fe[nl]ix's idea too
Me too.
-- Luís Oliveira http://kerno.org/~luis/