Add extension to configuration. Create and add an Extension instance to the ext_modules list. This method also takes the following optional keyword arguments that are passed on to the Extension constructor. Parameters ---------- name : str
(self,name,sources,**kw)
| 1440 | kw[k] = new_v |
| 1441 | |
| 1442 | def add_extension(self,name,sources,**kw): |
| 1443 | """Add extension to configuration. |
| 1444 | |
| 1445 | Create and add an Extension instance to the ext_modules list. This |
| 1446 | method also takes the following optional keyword arguments that are |
| 1447 | passed on to the Extension constructor. |
| 1448 | |
| 1449 | Parameters |
| 1450 | ---------- |
| 1451 | name : str |
| 1452 | name of the extension |
| 1453 | sources : seq |
| 1454 | list of the sources. The list of sources may contain functions |
| 1455 | (called source generators) which must take an extension instance |
| 1456 | and a build directory as inputs and return a source file or list of |
| 1457 | source files or None. If None is returned then no sources are |
| 1458 | generated. If the Extension instance has no sources after |
| 1459 | processing all source generators, then no extension module is |
| 1460 | built. |
| 1461 | include_dirs : |
| 1462 | define_macros : |
| 1463 | undef_macros : |
| 1464 | library_dirs : |
| 1465 | libraries : |
| 1466 | runtime_library_dirs : |
| 1467 | extra_objects : |
| 1468 | extra_compile_args : |
| 1469 | extra_link_args : |
| 1470 | extra_f77_compile_args : |
| 1471 | extra_f90_compile_args : |
| 1472 | export_symbols : |
| 1473 | swig_opts : |
| 1474 | depends : |
| 1475 | The depends list contains paths to files or directories that the |
| 1476 | sources of the extension module depend on. If any path in the |
| 1477 | depends list is newer than the extension module, then the module |
| 1478 | will be rebuilt. |
| 1479 | language : |
| 1480 | f2py_options : |
| 1481 | module_dirs : |
| 1482 | extra_info : dict or list |
| 1483 | dict or list of dict of keywords to be appended to keywords. |
| 1484 | |
| 1485 | Notes |
| 1486 | ----- |
| 1487 | The self.paths(...) method is applied to all lists that may contain |
| 1488 | paths. |
| 1489 | """ |
| 1490 | ext_args = copy.copy(kw) |
| 1491 | ext_args['name'] = dot_join(self.name, name) |
| 1492 | ext_args['sources'] = sources |
| 1493 | |
| 1494 | if 'extra_info' in ext_args: |
| 1495 | extra_info = ext_args['extra_info'] |
| 1496 | del ext_args['extra_info'] |
| 1497 | if isinstance(extra_info, dict): |
| 1498 | extra_info = [extra_info] |
| 1499 | for info in extra_info: |
no test coverage detected