Skip to content

Commit

Permalink
Properly handle the dependency on libfitsio.a, via a hack.
Browse files Browse the repository at this point in the history
  • Loading branch information
rainwoodman committed Oct 23, 2015
1 parent 9ce6db2 commit 5c4dfa8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def initialize_options(self):
self.cfitsio_dir = 'cfitsio%s' % self.cfitsio_version
self.cfitsio_build_dir = os.path.join('build', self.cfitsio_dir)
self.cfitsio_zlib_dir = os.path.join(self.cfitsio_build_dir,'zlib')

build_ext.initialize_options(self)
self.link_objects = []
self.extra_link_args = []
Expand All @@ -34,8 +35,6 @@ def finalize_options(self):

build_ext.finalize_options(self)

self.force = True

if self.use_system_fitsio:
# Include bz2 by default? Depends on how system cfitsio was built.
# FIXME: use pkg-config to tell if bz2 shall be included ?
Expand Down Expand Up @@ -71,6 +70,11 @@ def build_extensions(self):

self.compiler.set_link_objects(link_objects)

# Ultimate hack: append the .a files to the dependency list
# so they will be properly rebuild if cfitsio source is updated.
for ext in self.extensions:
ext.depends += link_objects

# call the original build_extensions

build_ext.build_extensions(self)
Expand Down

0 comments on commit 5c4dfa8

Please sign in to comment.