Re: Custom options for building extensions with --with--llvm - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Custom options for building extensions with --with--llvm
Date
Msg-id 20200924183734.hnvrmmjyn7wl662s@alap3.anarazel.de
Whole thread Raw
In response to Custom options for building extensions with --with--llvm  (Konstantin Knizhnik <k.knizhnik@postgrespro.ru>)
Responses Re: Custom options for building extensions with --with--llvm  (Konstantin Knizhnik <k.knizhnik@postgrespro.ru>)
List pgsql-hackers
Hi,

On 2020-09-24 19:15:22 +0300, Konstantin Knizhnik wrote:
> In my extension I want to define some custom options for compiler.
> I do it in the following way:
> 
> ifdef USE_DISK
> CUSTOM_COPT += -DIMCS_DISK_SUPPORT
> endif

Why aren't you adding it to PG_CPPFLAGS? That should work, and I think
that's what several contrib modules are using.

My understanding of CUSTOM_COPT is that it's for use in Makefile.custom,
not for contrib modules etc?


> I wonder is there any way to pass custom compile options to clang?
> Thanks in advance,

It probably wouldn't hurt to add COPT that to the respective rules in
Makefile.global.in in some way. Shouldn't be too hard to do, if you want
to write a patch. Probably just apply it to BITCODE_CFLAGS as well.

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: scram-sha-256 broken with FIPS and OpenSSL 1.0.2
Next
From: Pavel Stehule
Date:
Subject: Re: proposal: schema variables