FLTK logo

Re: [fltk.coredev] Re: RFC: introduce public config header <FL/fl_config.h>

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.coredev  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: Re: RFC: introduce public config header <FL/fl_config.h> Albrecht Schlosser Aug 29, 2021  
 
On 8/29/21 6:41 PM duncan wrote:

there are some reasons why I believe we should have a public header that reflects some build option dependent macros.
. . .
This header would be included by <FL/Fl.H> and help to solve several issues. . . . .

Stupid question perhaps, but why generate an <FL/fl_config.h> that's included in <FL/Fl.H> ?
Can't configure/CMake add these items directly into the top of <FL/Fl.H> ?

Not a stupid question. Well, there are some reasons.

(1) It would make things more complicated than necessary. We need two different input files that have to be prepared in parallel (logically consistent) as source for the generation. configure and CMake need different input to generate the same output. You'll see what I mean if you compare configh.cmake.in and configh.in.

(2) The syntax of the input file for configure prohibits to mix constant #define statements (as in Fl.H) with input to the generator source. It would be at least the very hard to maintain.

(3) The generated file(s) must be in a different directory than the original source files (CMake out of source build). Although we could manage this for a complete header file Fl.H it seems better manageable (to me) to split this.

(4) One thing I mentioned in my original post was to enable a special feature for CMake users when building their own projects. This feature requires to parse a file by CMake code to get the FLTK version. This is an option I'm planning for the near future. It's less error prone to parse a very short file than a much longer one.

(5) It's always been that way (with abi-version.h). No, that's a joke. But seriously, what I've seen in other libs is that they also provide a (short) config header rather than one header file including "everything".

Point (1) should be enough. I wrote the other points only to emphasize that I believe it's not thinking further about it. But thanks for the question anyway.

Finally my proposal will (a) extend and rename abi-version.h to fl_config.h or (b) rename and extend it, whatever you like. ;-)

PS: Duncan, your vote as long time FLTK dev would be appreciated as well. Thanks.

--
You received this message because you are subscribed to the Google Groups "fltk.coredev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkcoredev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkcoredev/ccd81a1b-e7fc-cb61-1678-c9901ba22b4b%40online.de.
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.