| 1 |
# SPDX-License-Identifier: Apache-2.0 |
| 2 |
# Copyright 2014-2016 The Meson development team |
| 3 |
|
| 4 |
from __future__ import annotations |
| 5 |
|
| 6 |
import typing as T |
| 7 |
|
| 8 |
from .vs2010backend import Vs2010Backend |
| 9 |
from ..mesonlib import MesonException |
| 10 |
|
| 11 |
if T.TYPE_CHECKING: |
| 12 |
from ..build import Build |
| 13 |
|
| 14 |
class Vs2012Backend(Vs2010Backend): |
| 15 |
|
| 16 |
name = 'vs2012' |
| 17 |
|
| 18 |
def __init__(self, build: T.Optional[Build]): |
| 19 |
super().__init__(build) |
| 20 |
self.vs_version = '2012' |
| 21 |
self.sln_file_version = '12.00' |
| 22 |
self.sln_version_comment = '2012' |
| 23 |
|
| 24 |
def detect_toolset(self) -> None: |
| 25 |
if self.environment is not None: |
| 26 |
# TODO: we assume host == build |
| 27 |
comps = self.environment.coredata.compilers.host |
| 28 |
if comps and all(c.id == 'intel-cl' for c in comps.values()): |
| 29 |
c = list(comps.values())[0] |
| 30 |
if c.version.startswith('19'): |
| 31 |
self.platform_toolset = 'Intel C++ Compiler 19.0' |
| 32 |
else: |
| 33 |
# We don't have support for versions older than 2019 right now. |
| 34 |
raise MesonException('There is currently no support for ICL before 19, patches welcome.') |
| 35 |
if self.platform_toolset is None: |
| 36 |
self.platform_toolset = 'v110' |