Skip to content

Commit

Permalink
MAINT: add src/private in build_dir to include search paths
Browse files Browse the repository at this point in the history
allows generating headers like npy_partition.h with the code generator
  • Loading branch information
juliantaylor committed Oct 14, 2013
1 parent 681025d commit 10ce5b2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 562 deletions.
1 change: 1 addition & 0 deletions numpy/core/bento.info
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Library:
src/npymath/halffloat.c
CompiledLibrary: npysort
Sources:
src/private/npy_partition.h.src
src/npysort/quicksort.c.src,
src/npysort/mergesort.c.src,
src/npysort/heapsort.c.src,
Expand Down
19 changes: 15 additions & 4 deletions numpy/core/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,10 @@ def generate_config_h(ext, build_dir):

def generate_numpyconfig_h(ext, build_dir):
"""Depends on config.h: generate_config_h has to be called before !"""
# put private include directory in build_dir on search path
# allows using code generation in headers headers
config.add_include_dirs(join(build_dir, "src", "private"))

target = join(build_dir, header_dir, '_numpyconfig.h')
d = os.path.dirname(target)
if not os.path.exists(d):
Expand Down Expand Up @@ -697,10 +701,17 @@ def get_mathlib_info(*args):

# This library is created for the build but it is not installed
config.add_library('npysort',
sources = [join('src', 'npysort', 'quicksort.c.src'),
join('src', 'npysort', 'mergesort.c.src'),
join('src', 'npysort', 'heapsort.c.src'),
join('src', 'npysort', 'selection.c.src')])
sources=[join('src', 'npysort', 'quicksort.c.src'),
join('src', 'npysort', 'mergesort.c.src'),
join('src', 'npysort', 'heapsort.c.src'),
join('src','private', 'npy_partition.h.src'),
join('src', 'npysort', 'selection.c.src')],
deps=[join('src', 'npysort', 'quicksort.c'),
join('src', 'npysort', 'mergesort.c'),
join('src', 'npysort', 'heapsort.c'),
join('src', 'private', 'npy_partition.h'),
join('src', 'npysort', 'selection.c')],
include_dirs=[])


#######################################################################
Expand Down
Loading

0 comments on commit 10ce5b2

Please sign in to comment.