better workaround for unsupported GDAL framework linking on osx
This commit is contained in:
parent
9d351be091
commit
3b295143bc
1 changed files with 12 additions and 9 deletions
11
SConstruct
11
SConstruct
|
@ -521,14 +521,17 @@ def parse_config(context, config, checks='--libs --cflags'):
|
|||
parsed = False
|
||||
if ret:
|
||||
try:
|
||||
if 'gdal-config' in cmd:
|
||||
env.ParseConfig(cmd)
|
||||
# hack for potential -framework GDAL syntax
|
||||
# which will not end up being added to env['LIBS']
|
||||
# and thus breaks knowledge below that gdal worked
|
||||
if 'gdal-config' in cmd:
|
||||
num_libs = len(env['LIBS'])
|
||||
env.ParseConfig(cmd)
|
||||
if not num_libs > env['LIBS']:
|
||||
# TODO - upgrade our scons logic to support Framework linking
|
||||
if env['PLATFORM'] == 'Darwin':
|
||||
value = call(cmd,silent=True)
|
||||
if value and '-framework GDAL' in value:
|
||||
env['LIBS'].append('gdal')
|
||||
if os.path.exists('/Library/Frameworks/GDAL.framework/unix/lib'):
|
||||
env['LIBPATH'].insert(0,'/Library/Frameworks/GDAL.framework/unix/lib')
|
||||
if 'GDAL' in env.get('FRAMEWORKS',[]):
|
||||
env["FRAMEWORKS"].remove("GDAL")
|
||||
|
|
Loading…
Reference in a new issue