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
|
parsed = False
|
||||||
if ret:
|
if ret:
|
||||||
try:
|
try:
|
||||||
|
if 'gdal-config' in cmd:
|
||||||
|
env.ParseConfig(cmd)
|
||||||
# hack for potential -framework GDAL syntax
|
# hack for potential -framework GDAL syntax
|
||||||
# which will not end up being added to env['LIBS']
|
# which will not end up being added to env['LIBS']
|
||||||
# and thus breaks knowledge below that gdal worked
|
# and thus breaks knowledge below that gdal worked
|
||||||
if 'gdal-config' in cmd:
|
# TODO - upgrade our scons logic to support Framework linking
|
||||||
num_libs = len(env['LIBS'])
|
if env['PLATFORM'] == 'Darwin':
|
||||||
env.ParseConfig(cmd)
|
value = call(cmd,silent=True)
|
||||||
if not num_libs > env['LIBS']:
|
if value and '-framework GDAL' in value:
|
||||||
env['LIBS'].append('gdal')
|
env['LIBS'].append('gdal')
|
||||||
|
if os.path.exists('/Library/Frameworks/GDAL.framework/unix/lib'):
|
||||||
env['LIBPATH'].insert(0,'/Library/Frameworks/GDAL.framework/unix/lib')
|
env['LIBPATH'].insert(0,'/Library/Frameworks/GDAL.framework/unix/lib')
|
||||||
if 'GDAL' in env.get('FRAMEWORKS',[]):
|
if 'GDAL' in env.get('FRAMEWORKS',[]):
|
||||||
env["FRAMEWORKS"].remove("GDAL")
|
env["FRAMEWORKS"].remove("GDAL")
|
||||||
|
|
Loading…
Reference in a new issue