Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SCons] Add support to import custom variables from parent SConstruct #1196

Closed

Conversation

adamscott
Copy link
Member

Makes parent SConstruct able to apply their custom.py values to the main SConstruct file.

Otherwise, even if the parent SConstruct has use_llvm = True, the main SConstruct file will ignore it unless you manually add use_llvm=yes in the command line.

@adamscott adamscott requested a review from a team as a code owner July 30, 2023 16:25
@adamscott adamscott changed the title Add support to import custom variables from parent SConstruct [SCons] Add support to import custom variables from parent SConstruct Jul 30, 2023
@adamscott adamscott added enhancement This is an enhancement on the current functionality topic:buildsystem Related to the buildsystem or CI setup labels Jul 30, 2023
@adamscott adamscott added this to the 4.x milestone Jul 30, 2023
@adamscott adamscott force-pushed the add-local-custom-support branch from 6b3a1bc to a1af1e8 Compare July 30, 2023 16:27
@dsnopek
Copy link
Collaborator

dsnopek commented Aug 7, 2023

Thanks!

However, since the parent SConstruct can already pass in it's own env, is this really needed? Like, couldn't you do something like:

env = Environment(tools=["default"], PLATFORM="")
Export('env')
SConscript("godot-cpp/SConstruct")

This seems to overlap with what was added in PR #1170

@adamscott
Copy link
Member Author

Closing that PR, will do another one.

@adamscott adamscott closed this Aug 17, 2023
@adamscott
Copy link
Member Author

adamscott commented Aug 17, 2023

Thanks!

However, since the parent SConstruct can already pass in it's own env, is this really needed? Like, couldn't you do something like:

env = Environment(tools=["default"], PLATFORM="")
Export('env')
SConscript("godot-cpp/SConstruct")

I tested out and it doesn't work. What custom.py sets up is variables to be picked up by opts.Add commands. Then, the value truly retained by scons is not the variables set by "custom.py", but the options set.

So, when we are passing env, it doesn't actually contain the values of the local "custom.py", hence the need to pass "customs" as an exported value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
archived enhancement This is an enhancement on the current functionality topic:buildsystem Related to the buildsystem or CI setup
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants