[Scons-users] Unable to add -F flag to variables

Mats Wichmann mats at wichmann.us
Wed Feb 21 12:34:51 EST 2024


On 2/21/24 10:04, Paola Ferrario wrote:
> Hi all! I use scons to build a Geant4-based application.
> In the latest upgrade of Geant4 (v11.2.1), they added a -F flag to the cmake compilation of geant4, to deal with an error caused by Qt inMacOS systems.
> In my SConstruct file I collect the geant4 flags with ParseConfig and store them into a file with the Variables package, to be able to skip the part of checking dependencies every time. However, it seems that this -F flag is not written into that file, because when I try to compile a second time, I get the Qt error; however, if I do a clean and a compilation from scratch, it does work.
> Do you know if there’s a way to collect the path of that flag?

What is the -F for?

Generally speaking, when you want to pass a flag SCons doesn't know 
about through ParseConfig (actually ParseFlags is the active function 
for scanning the flags), you're on you own, which isn't ideal.  There 
are some schemes in the API for intercepting the flow through 
ParseConfig -> MergeFlags -> ParseFlags -> back to MergeFlags, but let's 
not go through that until we know it's needed.

ParseFlags does recognize a -F flag, which is uses to add the 
option-argument to the FRAMEWORKPATH construction variable, along the 
lines of this snip from the gcc documentation:

        -Fdir
            Add the framework directory dir to the head of the list of
            directories to be searched for header files.  These 
directories are
            interleaved with those specified by -I options and are 
scanned in a
            left-to-right order.

If this is not what you expect to happen, it may be some work since it 
already recognizes the flag and does something different...




More information about the Scons-users mailing list