Chuck Blake | 8 Jun 15:23 2010
Picon
Picon

[Cython] line-directives support for Distutils build_ext

Hey, guys.  I did this a long time ago, but it patches cleanly against the
cython-devel tip (at least yesterday's tip).

There was some discussion of what the default should be for the #line/#file
directives Robert added.  This is a hopefully non-contentious addition to
support pushing that decision to higher levels of the build system.

All this patch does is add pyrex_line_directives to support that.  It's
an analogue of the extra attributes .pyrex_include_dirs going with -I,
or .pyrex_cplus going with the --cplus command option, etc.

This allows you to add .pyrex_line_directives to Extension() objects in
your setup.py.  The appropriate command option is then added to the
invocations of cython for those extensions, as it is for the -I/--cplus/..
options.

--------------------------------------------------------------------------
diff -r dd29215de4a0 Cython/Distutils/build_ext.py
--- a/Cython/Distutils/build_ext.py	Mon Jun 07 11:06:45 2010 -0700
+++ b/Cython/Distutils/build_ext.py	Mon Jun 07 16:45:43 2010 -0400
 <at>  <at>  -36,6 +36,8  <at>  <at> 
          "generate C++ source files"),
         ('pyrex-create-listing', None,
          "write errors to a listing file"),
+        ('pyrex-line-directives', None,
+         "emit source line directives"),
         ('pyrex-include-dirs=', None,
          "path to the Cython include files" + sep_by),
         ('pyrex-c-in-temp', None,
 <at>  <at>  -45,13 +47,14  <at>  <at> 
(Continue reading)

Lisandro Dalcin | 9 Jun 02:56 2010
Picon

Re: [Cython] line-directives support for Distutils build_ext

On 8 June 2010 10:23, Chuck Blake <cb <at> pdos.csail.mit.edu> wrote:
> Hey, guys.  I did this a long time ago, but it patches cleanly against the
> cython-devel tip (at least yesterday's tip).
>
> There was some discussion of what the default should be for the #line/#file
> directives Robert added.  This is a hopefully non-contentious addition to
> support pushing that decision to higher levels of the build system.
>
> All this patch does is add pyrex_line_directives to support that.  It's
> an analogue of the extra attributes .pyrex_include_dirs going with -I,
> or .pyrex_cplus going with the --cplus command option, etc.
>
> This allows you to add .pyrex_line_directives to Extension() objects in
> your setup.py.  The appropriate command option is then added to the
> invocations of cython for those extensions, as it is for the -I/--cplus/..
> options.
>
> --------------------------------------------------------------------------
> diff -r dd29215de4a0 Cython/Distutils/build_ext.py
> --- a/Cython/Distutils/build_ext.py     Mon Jun 07 11:06:45 2010 -0700
> +++ b/Cython/Distutils/build_ext.py     Mon Jun 07 16:45:43 2010 -0400
>  <at>  <at>  -36,6 +36,8  <at>  <at> 
>          "generate C++ source files"),
>         ('pyrex-create-listing', None,
>          "write errors to a listing file"),
> +        ('pyrex-line-directives', None,
> +         "emit source line directives"),
>         ('pyrex-include-dirs=', None,
>          "path to the Cython include files" + sep_by),
>         ('pyrex-c-in-temp', None,
(Continue reading)


Gmane