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: Build modules in seperate env. #14626

Merged
merged 1 commit into from
Dec 13, 2017
Merged

Conversation

27thLiz
Copy link
Contributor

@27thLiz 27thLiz commented Dec 13, 2017

No description provided.

@27thLiz
Copy link
Contributor Author

27thLiz commented Dec 13, 2017

There's still one module left using the main env: svg.
That one seems to do some linker tricks

godot/modules/svg/SCsub

Lines 17 to 28 in b110813

# Needs to be appended to arrive after libscene in the linker call,
# but we don't want it to arrive *after* system libs, so manual hack
# LIBS contains first SCons Library objects ("SCons.Node.FS.File object")
# and then plain strings for system library. We insert between the two.
inserted = False
for idx, linklib in enumerate(env["LIBS"]):
if isbasestring(linklib): # first system lib such as "X11", otherwise SCons lib object
env["LIBS"].insert(idx, lib)
inserted = True
break
if not inserted:
env.Append(LIBS=[lib])

Not quite sure what that does exactly, so I decided not to touch it for now.

@akien-mga
Copy link
Member

akien-mga commented Dec 13, 2017

There's still one module left using the main env: svg.
That one seems to do some linker tricks

The comment is misleading as it was copy pasted from the freetype module without edit (

lib = env.add_library("freetype_builtin", thirdparty_sources)
# Needs to be appended to arrive after libscene in the linker call,
# but we don't want it to arrive *after* system libs, so manual hack
# LIBS contains first SCons Library objects ("SCons.Node.FS.File object")
# and then plain strings for system library. We insert between the two.
inserted = False
for idx, linklib in enumerate(env["LIBS"]):
if isbasestring(linklib): # first system lib such as "X11", otherwise SCons lib object
env["LIBS"].insert(idx, lib)
inserted = True
break
if not inserted:
env.Append(LIBS=[lib])
env.Append(CCFLAGS=['-DFT2_BUILD_LIBRARY'])
if (env['target'] != 'release'):
env.Append(CCFLAGS=['-DZLIB_DEBUG'])
), it should actually mention libeditor and not libscene. The idea is that this module is needed by the editor (
#ifdef SVG_ENABLED
), and based on the build order defined in

godot/SConstruct

Lines 449 to 461 in bf05309

# build subdirs, the build order is dependent on link order.
SConscript("core/SCsub")
SConscript("servers/SCsub")
SConscript("scene/SCsub")
SConscript("editor/SCsub")
SConscript("drivers/SCsub")
SConscript("platform/SCsub")
SConscript("modules/SCsub")
SConscript("main/SCsub")
SConscript("platform/" + selected_platform + "/SCsub") # build selected platform
it might be tricky. I haven't checked if it's actually needed here though.

@akien-mga akien-mga merged commit 1c0007b into godotengine:master Dec 13, 2017
@27thLiz 27thLiz deleted the module_env branch December 13, 2017 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants