Add Visual Studio 2012/2013 backends (#8803)
* backends: Add a Visual Studio 2013 backend This is more-or-less a quick port from the VS2015 backend, except that we update the Visual Studio version strings and toolset versions accordingly. Also correct the generator string for Visual Studio 2015 in mesonbuild/cmake/common.py. * backend: Add VS2012 backend Similar to what we did for Visual Studio 2013, add a Visual Studio 2012 backend. * vs2010backend.py: Implement `link_whole:` if needed We actually need Visual Studio 2015 Update 2 to use `/WHOLEARCHIVE:`, which is what we are currently using for `link_whole:` on Visual Studio. For Visual Studio versions before that, we need to expand from the static targets that were indicated by `link_whole:`, and any of the sub-dependent targets that were pulled in via the dependent target's `link_whole:`. This wil ensure `link_whole:` would actually work in such cases. * vs2010backend.py: Handle objects from generated sources Unforunately, we can't use backends.determine_ext_objs() reliably, as the Visual Studio backends handle this differently. * vs2010backend.py: Fix generating VS2010 projects Visual Studio 2010 (at least the Express Edition) does not set the envvar %VisualStudioVersion% in its command prompt, so fix generating VS2010 projects by taking account into this, so that we can determine the location of vcvarsall.bat correctly. * whole archive test: Disable on vs2012/2013 backends too The Visual Studio 2012/2013 IDE has problems handling the items that would be generated from this test case, so skip this test when using --backend=vs[2012|2013]. This test does work for the Ninja backend when VS2012 or VS2013 is used, though. Consolidate this error message with XCode along with the vs2010 backend. * docs: Add the new vs2012 and vs2013 backends Let people know that we have backends for vs2012 and 2013. Also let people know that generating Visual Studio 2010 projects have been fixed and the pre-vs2015 backends now handle the `link_whole:` project option.pull/8921/head
parent
7588dbc587
commit
edfe24178d
10 changed files with 144 additions and 16 deletions
@ -0,0 +1,15 @@ |
||||
## New `vs2012` and `vs2013` backend options |
||||
|
||||
Adds the ability to generate Visual Studio 2012 and 2013 projects. This is an |
||||
extension to the existing Visual Studio 2010 projects so that it is no longer |
||||
required to manually upgrade the generated Visual Studio 2010 projects. |
||||
|
||||
Generating Visual Studio 2010 projects has also been fixed since its developer |
||||
command prompt does not provide a `%VisualStudioVersion%` envvar. |
||||
|
||||
## Developer environment |
||||
|
||||
Expand the support for the `link_whole:` project option for pre-Visual Studio 2015 |
||||
Update 2, where previously Visual Studio 2015 Update 2 or later was required for |
||||
this, for the Ninja backend as well as the vs2010 (as well as the newly-added |
||||
vs2012 and vs2013 backends). |
@ -0,0 +1,38 @@ |
||||
# Copyright 2014-2016 The Meson development team |
||||
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); |
||||
# you may not use this file except in compliance with the License. |
||||
# You may obtain a copy of the License at |
||||
|
||||
# http://www.apache.org/licenses/LICENSE-2.0 |
||||
|
||||
# Unless required by applicable law or agreed to in writing, software |
||||
# distributed under the License is distributed on an "AS IS" BASIS, |
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
# See the License for the specific language governing permissions and |
||||
# limitations under the License. |
||||
|
||||
from .vs2010backend import Vs2010Backend |
||||
from ..mesonlib import MesonException |
||||
from ..interpreter import Interpreter |
||||
from ..build import Build |
||||
import typing as T |
||||
|
||||
|
||||
class Vs2012Backend(Vs2010Backend): |
||||
def __init__(self, build: T.Optional[Build], interpreter: T.Optional[Interpreter]): |
||||
super().__init__(build, interpreter) |
||||
self.name = 'vs2012' |
||||
self.vs_version = '2012' |
||||
if self.environment is not None: |
||||
# TODO: we assume host == build |
||||
comps = self.environment.coredata.compilers.host |
||||
if comps and all(c.id == 'intel-cl' for c in comps.values()): |
||||
c = list(comps.values())[0] |
||||
if c.version.startswith('19'): |
||||
self.platform_toolset = 'Intel C++ Compiler 19.0' |
||||
else: |
||||
# We don't have support for versions older than 2019 right now. |
||||
raise MesonException('There is currently no support for ICL before 19, patches welcome.') |
||||
if self.platform_toolset is None: |
||||
self.platform_toolset = 'v110' |
@ -0,0 +1,38 @@ |
||||
# Copyright 2014-2016 The Meson development team |
||||
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); |
||||
# you may not use this file except in compliance with the License. |
||||
# You may obtain a copy of the License at |
||||
|
||||
# http://www.apache.org/licenses/LICENSE-2.0 |
||||
|
||||
# Unless required by applicable law or agreed to in writing, software |
||||
# distributed under the License is distributed on an "AS IS" BASIS, |
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
# See the License for the specific language governing permissions and |
||||
# limitations under the License. |
||||
|
||||
from .vs2010backend import Vs2010Backend |
||||
from ..mesonlib import MesonException |
||||
from ..interpreter import Interpreter |
||||
from ..build import Build |
||||
import typing as T |
||||
|
||||
|
||||
class Vs2013Backend(Vs2010Backend): |
||||
def __init__(self, build: T.Optional[Build], interpreter: T.Optional[Interpreter]): |
||||
super().__init__(build, interpreter) |
||||
self.name = 'vs2013' |
||||
self.vs_version = '2013' |
||||
if self.environment is not None: |
||||
# TODO: we assume host == build |
||||
comps = self.environment.coredata.compilers.host |
||||
if comps and all(c.id == 'intel-cl' for c in comps.values()): |
||||
c = list(comps.values())[0] |
||||
if c.version.startswith('19'): |
||||
self.platform_toolset = 'Intel C++ Compiler 19.0' |
||||
else: |
||||
# We don't have support for versions older than 2019 right now. |
||||
raise MesonException('There is currently no support for ICL before 19, patches welcome.') |
||||
if self.platform_toolset is None: |
||||
self.platform_toolset = 'v120' |
Loading…
Reference in new issue