[Scons-users] configuration file
Bill Deegan
bill at baddogconsulting.com
Wed Jun 1 18:56:34 EDT 2016
Neal,
You might want to look at the manpage for site_init.py (and site_scons
directory)
http://scons.org/doc/production/HTML/scons-man.html
This is a file which is evaluated into SCons by default when SCons is
launched.
SCons will check several different locations for the file.
See snippet from manpage below.
I think this should fit your usage exactly?
-Bill
The default set of *site_scons* dirs used when --site-dir is not specified
depends on the system platform, as follows. Note that the directories are
examined in the order given, from most generic to most specific, so the
last-executed site_init.py file is the most specific one (which gives it
the chance to override everything else), and the dirs are prepended to the
paths, again so the last dir examined comes first in the resulting path.
Windows:
%ALLUSERSPROFILE/Application Data/scons/site_scons
%USERPROFILE%/Local Settings/Application Data/scons/site_scons
%APPDATA%/scons/site_scons
%HOME%/.scons/site_scons
./site_scons
Mac OS X:
/Library/Application Support/SCons/site_scons
/opt/local/share/scons/site_scons (for MacPorts)
/sw/share/scons/site_scons (for Fink)
$HOME/Library/Application Support/SCons/site_scons
$HOME/.scons/site_scons
./site_scons
Solaris:
/opt/sfw/scons/site_scons
/usr/share/scons/site_scons
$HOME/.scons/site_scons
./site_scons
Linux, HPUX, and other Posix-like systems:
/usr/share/scons/site_scons
$HOME/.scons/site_scons
./site_scons
On Wed, Jun 1, 2016 at 4:31 AM, Neal Becker <ndbecker2 at gmail.com> wrote:
> I need to alter my build depending on the setup, and decided the easiest
> thing in to have a 'site.cfg' file that sets some variables (basically sets
> paths for things)
>
> For now I've added to my SConscript:
> exec (open('site.cfg').read())
>
> Is there a preferred way to accomplish this with scons?
>
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20160601/d50393b4/attachment-0001.html>
More information about the Scons-users
mailing list