On 2022/04/24 17:27, Rafael Sadowski wrote: > On Sun Apr 24, 2022 at 12:46:35PM +0100, Stuart Henderson wrote: > > On 2022/04/24 12:33, Rafael Sadowski wrote: > > > - CFLAGS, CXXFLAGS, LDFLAGS > > > cmake.port.mk now respects C/CXX/LD flags. With is CMAKE_*_FLAGS_* is > > > obsolete. > > > > I am 100% happy with doing this for CFLAGS/CXXFLAGS. Those are supported > > by other ports modules (autoconf, etc) and already partly supported by > > cmake module?. > > +1 > > > > > LDFLAGS not so much. Nothing else in ports infrastructure supports > > this. It is used in some ports but that's as an individual thing > > within those ports. It is not something that the user can set in the > > same way they can override CFLAGS/CXXFLAGS during a build. > > > > (Not saying it would be a bad thing to support it more widely, but having > > it honoured automatically in cmake but not in say meson and autoconf > > seems like asking for trouble). > > > I understand! > How else would we pass it? By CONFIGURE_ENV = LDFLAGS="-L${LOCALBASE}/lib"? > x11/gnome sets it by MODGNOME_LDFLAGS and then in CONFIGURE_ENV.
Something like MODCMAKE_LDFLAGS would make a lot more sense to me. If cmake.port.mk doesn't have a default value for this (unlike gnome.port.mk which automatically sets -L) then I would only set LDFLAGS iff MODCMAKE_LDFLAGS is set (i.e. avoid setting LDFLAGS=<empty> just leave it unset in that case). > I would prefer CONFIGURE_ENV = LDFLAGS="-L${LOCALBASE}/lib" in cmake. No > hard opinions here. I'm in two minds about this :) > > Also this gets rid of the distinction betweed CMAKE_SHARED_LINKER_FLAGS, > > CMAKE_MODULE_LINKER_FLAGS, CMAKE_EXE_LINKER_FLAGS - is that a good idea? > > If you do that, you have already lost as a porter. Only upstream can do this. > IMHO that was always an anti-pattern in the ports tree. Ah I was missing that the added -L flags were due to changes in cmake 3.23 - I was trying to make sense of why you needed to add them and one possible reason I thought was that maybe setting LDFLAGS is causing cmake to override existing config in the other *_LINKER_FLAGS variables. > New reworked diff: I will try and get an i386 test bulk started in the next few days with whatever diff is current for this at the time.