Re: adding text to compile line
Bill Deegan <[email protected]> Fri, 2 Feb 2024 09:00:39 -0800
| Newsgroups | gmane.comp.programming.tools.scons.user |
|---|---|
| Message-ID | <CAEyG4CHcGWv8bjPYboiTOxehsNp=mGY63Hb4VWvws-sEGmSLWw@mail.gmail.com> |
Good call Mats. Pre-coffee I didn't think of this.. ;) On Fri, Feb 2, 2024 at 8:59 AM Mats Wichmann <[email protected]> wrote: > On 2/2/24 01:25, daggs via Scons-users wrote: > > Greetings Bill, > > I'll try it, just for the heck of it but it isn't a valid solution as I > > cannot ask multiple devs to make that change in their scons. > > the question is, can I remove them using the std python code? > > one of the main features we use is take the compile line and run it > > manually so we don't need to run the entire build just to test one line. > > these "addons" will wreck havoc in bash > > You don't have to patch scons, you can try it this way: > > In the top dir of your project, create a site_scons directory, and put a > site_init.py into it containing this: > > # monkeypatch strfunction() to print a prefix > > > import SCons.Action > from SCons.Subst import SUBST_CMD > > def my_strfunction(self, target, source, env, executor=None, overrides: > bool = False) -> str: > if self.cmdstr is None: > return None > if self.cmdstr is not SCons.Action._null: > if executor: > c = env.subst(self.cmdstr, SUBST_CMD, executor=executor, > overrides=overrides) > else: > c = env.subst(self.cmdstr, SUBST_CMD, target, source, > overrides=overrides) > if c: > return c > cmd_list, ignore, silent = self.process(target, source, env, > executor, overrides=overrides) > if silent: > return '' > return "PREFIX: " + SCons.Action._string_from_cmd_list(cmd_list[0]) > > SCons.Action.CommandAction.strfunction = my_strfunction > > > > _______________________________________________ > Scons-users mailing list > [email protected] > https://pairlist4.pair.net/mailman/listinfo/scons-users > _______________________________________________ Scons-users mailing list [email protected] https://pairlist4.pair.net/mailman/listinfo/scons-users