Allow enabling tinyexr module compilation in export templates#73003
Closed
Calinou wants to merge 2 commits intogodotengine:masterfrom
Closed
Allow enabling tinyexr module compilation in export templates#73003Calinou wants to merge 2 commits intogodotengine:masterfrom
Calinou wants to merge 2 commits intogodotengine:masterfrom
Conversation
5a23ac6 to
94a47fd
Compare
fire
previously approved these changes
Feb 10, 2023
akien-mga
reviewed
Feb 10, 2023
SConstruct
Outdated
Member
There was a problem hiding this comment.
Would it work to move this option to the tinyexr module's config.py, so we don't bloat the main script? I think modules support adding options, see the Mono module.
Member
Author
There was a problem hiding this comment.
I've pushed a second commit where I attempted this, but it fails when using target=template_release:
KeyError: 'tinyexr_export_templates':
File "/home/hugo/Documents/Git/godotengine/godot/SConstruct", line 794:
if config.can_build(env, selected_platform):
File "/home/hugo/Documents/Git/godotengine/godot/modules/tinyexr/config.py", line 2:
return env.editor_build or env["tinyexr_export_templates"]
File "/home/hugo/.local/opt/pyston/lib/python3.8-pyston2.3/site-packages/SCons/Environment.py", line 387:
return self._dict[key]
The option is listed in scons -h's output still.
After enabling the tinyexr module at build-time by passing the `tinyexr_export_templates=yes` SCons option, this makes it possible to use `Image.save_exr()` in export templates. When the module is enabled, `Image.load()` can also be used to load images in OpenEXR format. When tinyexr is enabled in an export template, binary size is about 100 KB larger (stripped on Linux x86_64). As a result, this remains disabled by default.
94a47fd to
71d60fa
Compare
akien-mga
reviewed
Sep 30, 2023
Comment on lines
+6
to
+17
| from SCons.Script import BoolVariable, Variables, Help | ||
|
|
||
| envvars = Variables() | ||
| envvars.Add( | ||
| BoolVariable( | ||
| "tinyexr_export_templates", | ||
| "Enable saving and loading OpenEXR images in export template builds (increases binary size)", | ||
| False, | ||
| ) | ||
| ) | ||
| envvars.Update(env) | ||
| Help(envvars.GenerateHelpText(env)) |
Member
There was a problem hiding this comment.
This isn't the correct way to do it, see akien-mga@e75da97 for an example.
Member
Author
|
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After enabling the tinyexr module at build-time by passing the
tinyexr_export_templates=yesSCons option, this makes it possible to useImage.save_exr()in export templates. When the module is enabled,Image.load()can also be used to load images in OpenEXR format.When tinyexr is enabled in an export template, binary size is about 100 KB larger (stripped on Linux x86_64). As a result, this remains disabled by default.