Created
February 23, 2018 20:01
-
-
Save bdbaddog/1ddedecdfd13f6193c173e511e895b1f to your computer and use it in GitHub Desktop.
How to add to SConscript namespace
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
env=Environment() | |
SConscript('src/SConscript',exports='env') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SCons.Script | |
def my_stuff(): | |
print("BLAH") | |
SCons.Script.my_stuff = my_stuff |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Import('env') | |
my_stuff() | |
Yes that would work, but the user will have little control in being able to selection parts being added or not add to there build when using SCons. The suggestion I made means the user can add it or remove it at the point the Sconstruct is read in.
Ideally having a SCons extension API to allow control over what extensions get loaded or not would probably be better
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I wonder if:
Would do what you want.. Then you'd add all the symbols you want available as attributes to the passed object.