python: fix HAS_WEB_SERVER ifdef guard in AddonModuleXbmcwsgi.i #6795
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.
This fixes an issue brought up in http://trac.kodi.tv/ticket/15849. The generated python API code for the WSGI module, which can only be used through the webserver, is currently compiled independent of the
HAS_WEB_SERVER
define because the respective#endif
is added before the generated code.Swig supports "code insertion blocks" (see http://www.swig.org/Doc2.0/SWIGDocumentation.html#SWIG_nn40) to place code from the interface description file into specific places in the generated code. Unfortunately SWIG doesn't support inserting code after the generated code. Therefore I'm using a non-standard insertion code called
footer
(the opposite of the existingheader
).@jimfcarroll: Please let me know if you can think of a better way to do this. Ideally the interface file would never be processed and the problematic code never generated in which case we wouldn't need the ifdef guard in the first place. Unfortuantely we execute
codegenerator.mk
inbootstrap
where we have no clue about any configure flags/options and available libraries etc.