Re: Should contrib modules install .h files?
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andrew Gierth <andrew@tao11.riddles.org.uk>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>,
pgsql-hackers@postgresql.org
Date: 2018-08-01T02:44:32Z
Lists: pgsql-hackers
Andrew Gierth <andrew@tao11.riddles.org.uk> writes: > "Peter" == Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes: > Peter> I'm missing some guidance what an extension using those headers > Peter> is supposed to do. How does it get the right -I options? > If your extension is relying on pg11+, or you have checked the pg > version when constructing the makefile, you can just do: > PG_CPPFLAGS += -I$(includedir_server)/extension/hstore > and #include "hstore.h" will work. I remain of the opinion that it'd be smarter to do PG_CPPFLAGS += -I$(includedir_server)/extension then #include "hstore/hstore.h" This way requires fewer -I options and is far more robust against header name conflicts. regards, tom lane
Commits
-
Fix out-of-tree build for transform modules.
- f1ca5a654d5d 11.0 landed
- 60f6756f9225 12.0 landed
-
Provide for contrib and pgxs modules to install include files.
- df163230b92b 12.0 landed
- d06eebce5fa4 11.0 landed