From 9e193f4d7f27de64ed87de3012200399199cc193 Mon Sep 17 00:00:00 2001 From: Daniel Marth Date: Mon, 21 Jan 2019 12:20:42 +0100 Subject: [PATCH] handle additional linker arguments correctly --- setup.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 77987e4..110a3ab 100644 --- a/setup.py +++ b/setup.py @@ -27,6 +27,7 @@ import sys import os import os.path as path +import shlex CLASSIFIERS = """\ Development Status :: 5 - Production/Stable @@ -61,7 +62,9 @@ def _find_args(pat, env): library_dirs = _find_args('-l', 'LIBRARY_DIRS') szip_installed = 'SZIP' in os.environ compress = 'NO_COMPRESS' not in os.environ -extra_link_args = os.environ.get('LINK_ARGS', '') +extra_link_args = None +if "LINK_ARGS" in os.environ: + extra_link_args = shlex.split(os.environ["LINK_ARGS"]) msg = 'Cannot proceed without the HDF4 library. Please ' \ @@ -148,7 +151,7 @@ def _find_args(pat, env): include_dirs = include_dirs, extra_compile_args = extra_compile_args, library_dirs = library_dirs, - extra_link_args=[extra_link_args], + extra_link_args=extra_link_args, libraries = libraries, )