Skip to content

Commit

Permalink
[build] Enable PYTHONOPTIMIZE for linux
Browse files Browse the repository at this point in the history
If I build for Pi using unified buuld from Ubuntu, then python doesn't work
/opt/xbmc-bcm/xbmc-dbg/arm-linux-gnueabihf/arm-linux-gnueabihf/lib/python2.6

contains the .pyo files, but not the .py files.

Enabling PYTHONOPTIMIZE is required for the .pyo files to be used.
Do this by default on linux platforms. (It also gives a small performance benefit)
  • Loading branch information
popcornmix committed Feb 15, 2015
1 parent 26a1503 commit 980b312
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion xbmc/interfaces/python/XBPython.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,8 @@ bool XBPython::OnScriptInitialized(ILanguageInvoker *invoker)


// Darwin packs .pyo files, we need PYTHONOPTIMIZE on in order to load them.
#if defined(TARGET_DARWIN)
// linux built with unified builds only packages the pyo files so need it
#if defined(TARGET_DARWIN) || defined(TARGET_LINUX)
setenv("PYTHONOPTIMIZE", "1", 1);
#endif
// Info about interesting python envvars available
Expand Down

0 comments on commit 980b312

Please sign in to comment.