Fixed compilation with MSVC.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
|
||||
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
import requests
|
||||
from SCons.Script import *
|
||||
@@ -20,11 +21,15 @@ def versions(env: Environment, update: bool = False):
|
||||
continue
|
||||
result.append((int(match.groups()[0]), int(match.groups()[1]), int(match.groups()[2])))
|
||||
with open(versions_file, 'w') as f:
|
||||
json.dump(versions, f)
|
||||
json.dump(result, f)
|
||||
return result
|
||||
else:
|
||||
with open(versions_file, 'r') as f:
|
||||
return [tuple(v) for v in json.load(f)]
|
||||
try:
|
||||
with open(versions_file, 'r') as f:
|
||||
return [tuple(v) for v in json.load(f)]
|
||||
except:
|
||||
print('boost_versions.json is empty or broken, redownloading.')
|
||||
return versions(env, update=True)
|
||||
|
||||
def dependencies(env: Environment, version) -> 'dict':
|
||||
return {}
|
||||
@@ -50,7 +55,12 @@ def cook(env: Environment, version) -> dict:
|
||||
libs.append(fname)
|
||||
else:
|
||||
for lib in set(env['BOOST_LIBS']):
|
||||
libs.append(env.FindLib(f'boost_{lib}', paths=build_result['LIBPATH']))
|
||||
if os.name == 'posix':
|
||||
libs.append(env.FindLib(f'boost_{lib}', paths=build_result['LIBPATH']))
|
||||
elif os.name == 'nt':
|
||||
libs.append(env.FindLib(f'libboost_{lib}-*', paths=build_result['LIBPATH'], use_glob=True))
|
||||
else:
|
||||
raise Exception('Boost not supported on this platform.')
|
||||
return {
|
||||
'CPPPATH': build_result['CPPPATH'],
|
||||
'LIBS': libs
|
||||
|
||||
Reference in New Issue
Block a user