[Scons-users] adding text to compile line

Mats Wichmann mats at wichmann.us
Fri Feb 2 16:35:36 EST 2024


On 1/21/24 05:40, daggs via Scons-users wrote:
> Greetings,
> 
> I want to add a prefix the compile line scons is displaying, is it possible?

this has been a lengthy thread, but I recall (without being able to find 
the relevant message) your objective was to capture the build lines in 
the midst of a lot of noise, so they could be used separately.  It would 
be remiss not to mention that SCons has support for two ways of doing 
that: the compilation database, and ninja build support.  In both forms, 
SCons can generate a file with information about the build.  The ninja 
form allows quick building with the ninja tool specifically, without 
going through the full SCons parse/examine sequence.  The compilation 
database is meant to feed external analysis tools (and some editors) who 
need more context about how a file will be used to be able to do 
complete analysis.  Maybe you might be able to make use of one of these.

Here, for example, is the compilation database output of a very simple 
build used in the testsuite:

[
     {
         "command": "/home/mats/.pyenv/versions/venv-system/bin/python 
mygcc.py cc -o test_main.o -c test_main.c",
         "directory": "/tmp/testcmd.1016192.7zudntn7",
         "file": "/tmp/testcmd.1016192.7zudntn7/test_main.c",
         "output": "/tmp/testcmd.1016192.7zudntn7/test_main.o"
     }
]





More information about the Scons-users mailing list