mirror of https://github.com/python/cpython.git
If freezing with the -O option, the optimized bytecode files are
used. It is useful to implicitly set the -O flag in the frozen application. (Sjoerd Mullender)
This commit is contained in:
parent
df1940717d
commit
1abfb9c0f5
|
@ -14,12 +14,16 @@
|
||||||
};
|
};
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
# if __debug__ == 0 (i.e. -O option given), set Py_OptimizeFlag in frozen app.
|
||||||
default_entry_point = """
|
default_entry_point = """
|
||||||
int
|
int
|
||||||
main(argc, argv)
|
main(argc, argv)
|
||||||
int argc;
|
int argc;
|
||||||
char **argv;
|
char **argv;
|
||||||
{
|
{
|
||||||
|
""" + ((not __debug__ and """
|
||||||
|
Py_OptimizeFlag++;
|
||||||
|
""") or "") + """
|
||||||
PyImport_FrozenModules = _PyImport_FrozenModules;
|
PyImport_FrozenModules = _PyImport_FrozenModules;
|
||||||
return Py_FrozenMain(argc, argv);
|
return Py_FrozenMain(argc, argv);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue