| 422 | |
| 423 | |
| 424 | def get_ext_modules(options): |
| 425 | ext_modules = [Extension( |
| 426 | name=MODULE_NAME_NOEXT, |
| 427 | sources=["cefpython_py{pyver}.pyx".format(pyver=PYVERSION)], |
| 428 | |
| 429 | # Ignore the warning in the console: |
| 430 | # > C:\Python27\lib\distutils\extension.py:133: UserWarning: |
| 431 | # > Unknown Extension options: 'cython_directives' warnings.warn(msg) |
| 432 | cython_directives={ |
| 433 | # Any conversion to unicode must be explicit using .decode(). |
| 434 | "language_level": 2, # Yes, Py2 for all python versions. |
| 435 | "c_string_type": "bytes", |
| 436 | "c_string_encoding": "utf-8", |
| 437 | "profile": ENABLE_PROFILING, |
| 438 | "linetrace": ENABLE_LINE_TRACING, |
| 439 | }, |
| 440 | |
| 441 | language="c++", |
| 442 | |
| 443 | include_dirs=options["include_dirs"], |
| 444 | library_dirs=options["library_dirs"], |
| 445 | |
| 446 | # Static libraries only. Order is important, if library A depends on B, |
| 447 | # then B must be included before A. |
| 448 | libraries=options["libraries"], |
| 449 | |
| 450 | # When you put "./" in here, loading of libcef.so will only work when |
| 451 | # running scripts from the same directory that libcef.so resides in. |
| 452 | # runtime_library_dirs=[ |
| 453 | # './' |
| 454 | # ], |
| 455 | |
| 456 | extra_compile_args=options["extra_compile_args"], |
| 457 | extra_link_args=options["extra_link_args"], |
| 458 | |
| 459 | # Defining macros: |
| 460 | # define_macros = [("UNICODE","1"), ("_UNICODE","1"), ] |
| 461 | )] |
| 462 | return ext_modules |
| 463 | |
| 464 | |
| 465 | def compile_time_constants(): |