Choose correct libprotobuf build for current msvc version on Windows.
authorNicholas Hastings <skamonkey@gmail.com>
Fri Feb 28 20:44:10 2014 -0500 (2014-02-28)
changeset 42654e7e7b18ae2b
parent 4264 7cfd2b41f336
child 4266 b6060fd93236
Choose correct libprotobuf build for current msvc version on Windows.
core/AMBuilder
     1.1 --- a/core/AMBuilder	Fri Feb 28 20:43:07 2014 -0500
     1.2 +++ b/core/AMBuilder	Fri Feb 28 20:44:10 2014 -0500
     1.3 @@ -34,10 +34,21 @@
     1.4      elif builder.target_platform == 'mac':
     1.5        lib_path = os.path.join(sdk.path, 'lib', 'osx32', 'release', 'libprotobuf.a')
     1.6      elif builder.target_platform == 'windows':
     1.7 +      msvc_ver = int(compiler.cxx.version)
     1.8 +      vs_year = ''
     1.9 +      if msvc_ver == 1800:
    1.10 +        vs_year = '2013'
    1.11 +      elif msvc_ver == 1700:
    1.12 +        vs_year = '2012'
    1.13 +      elif msvc_ver == 1600:
    1.14 +        vs_year = '2010'
    1.15 +      else:
    1.16 +        raise Exception('Cannot find libprotobuf for MSVC version "' + compiler.cxx.version + '"')
    1.17 +
    1.18        if 'DEBUG' in compiler.defines:
    1.19 -        lib_path = os.path.join(sdk.path, 'lib', 'win32', 'debug', 'vs2010', 'libprotobuf.lib')
    1.20 +        lib_path = os.path.join(sdk.path, 'lib', 'win32', 'debug', 'vs' + vs_year, 'libprotobuf.lib')
    1.21        else:
    1.22 -        lib_path = os.path.join(sdk.path, 'lib', 'win32', 'release', 'vs2010', 'libprotobuf.lib')
    1.23 +        lib_path = os.path.join(sdk.path, 'lib', 'win32', 'release', 'vs' + vs_year, 'libprotobuf.lib')
    1.24      compiler.linkflags.insert(0, binary.Dep(lib_path))
    1.25  
    1.26    binary.sources += [