godot-cpp
godot-cpp copied to clipboard
Make build system more friendly when it's no longer top-level
This PR aims to address #1334 at least partially. With the changes:
- When the
profile=some_file.pyis given as argument, that file can be placed alongside the extension SConstruct directory rather than within the godot-cpp. Without the changed script, in order to keep thesome_file.pywith the extension then the argument must be changed toprofile=../some_file.py(in other words, the path would have to be relative to godot-cpp SConstruct) - Some lines that don't do anything were removed.
- Warning message of unknown SCons arguments are given only when godot-cpp SConstruct is running as top level script. If an extension author wishes to output that kind of warning it must be done within extension SConstruct, which becomes top-level.
A side note here. I kept the original profile=... logic of accepting file name without .py extension. However I have noticed that when this is the case, SCons generate a binary file with the exact same name of the profile file, but without any extension. As an example, if there is a release.py and the argument is given as profile=release, then a release file will be created. I was unable to track down what/where this thing happens.
I like the idea behind this functionality! We don't want to show the "unknown variables" message when used in another project that defines it's own variables. However, I think we'll need someone who is more in tune with the build system to say if this is done in the right way.
@Faless @adamscott What do you think?