1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-06-20 03:38:05 +08:00

25 Commits

Author SHA1 Message Date
Kyle Edwards
6051a49c78 Visual Studio: Add Android support 2020-06-24 08:41:09 -04:00
Justin Goshi
e219527a72 VS: Use StdOutEncoding for VS 16.7 Preview 3 and above
VS 16.6 added a `StdOutEncoding` setting for custom commands to tell
MSBuild that the output is encoded as UTF-8.  In commit bc877a7e94 (Add
support to indicate UTF-8 custom command pipe output encoding,
2020-04-08) CMake learned to add the setting in anticipation of the VS
16.6 release.  However, when 16.6 was released it had a bug in the
implementation of custom tasks with StdOutEncoding enabled that was
exposed by our test suite.  In commit 5058fb5401 (VS: Drop
StdOutEncoding with VS 16.6 pending investigation, 2020-05-29) we
disabled the setting pending investigation.

The problem is fixed in VS 16.7 Preview 3, so restore use of the
setting when a VS instance of at least that version is detected.

Fixes: #20769
2020-06-03 09:00:41 -04:00
Justin Goshi
8a7ad923a8 VS: Extract instance version from VS Installer 2020-06-03 08:58:29 -04:00
Marc Chevrier
a00960288b GlobalGenerator family: modernize memory management 2020-01-07 11:03:11 +01:00
Brad King
d8d4924d98 VS: Fix support for v142 toolset minor versions in VS 16.5+
The fix in commit 5117389931 (VS: Fix support for v142 toolset minor
versions, 2019-10-01, v3.16.0-rc1~32^2) worked around a bug in VS's
placement of toolset files.   VS 16.5 will fix that bug and restore the
original pattern for locations of toolset files.  Update our logic to
look for both possibilities.

Issue: #19779
2019-12-12 11:28:34 -05:00
Brad King
5117389931 VS: Fix support for v142 toolset minor versions
When using `-T v142,version=14.22` the `.props` file location is
different starting with version `14.20` than it was in `14.16` and
below.  Adapt the path based on the version.

Fixes: #19779
2019-10-01 11:39:38 -04:00
Brad King
7d77607d10 Merge topic 'vs2019-wow64'
5c50eeaffc VS: Fix x64 host recognition by x86 cmake process

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3102
2019-03-15 10:19:01 -04:00
Brad King
5c50eeaffc VS: Fix x64 host recognition by x86 cmake process
In commit 57e48f16f2 (VS: Add Visual Studio 16 2019 generator,
2019-01-09, v3.14.0-rc1~150^2) and commit 0fd742a6ff (VS: Teach VS 2019
generator to select host tools matching host arch, 2019-01-28,
v3.14.0-rc1~63^2) we intended to select the `x64` target architecture
and `x64` host tools by default on x64 host machines.  Fix detection
of a x64 host when CMake itself is a 32-bit x86 process.

The KWSys SystemInformation `Is64Bits` member is not set correctly,
which led to this bug.  Pending investigation on the KWSys side,
simply test ourselves via `IsWow64Process`.
2019-03-14 13:19:18 -04:00
Brad King
1b8c5a0c35 Merge topic 'revert-vs-msbuild-arch'
f3cedf381e VS: Revert "Use MSBuild matching toolset host architecture"

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3090
2019-03-13 10:08:57 -04:00
Brad King
f3cedf381e VS: Revert "Use MSBuild matching toolset host architecture"
Revert commit da402a081b (VS: Use MSBuild matching toolset host
architecture, 2019-01-28, v3.14.0-rc1~50^2).  Multiple people have
reported that the 64-bit `amd64/msbuild` tool fails in cases that the
32-bit `msbuild` works.  Drop our change pending further investigation
and hopefully a fix to VS.

Fixes: #18904, #19037
Issue: #18219
2019-03-12 12:53:06 -04:00
Vitaly Stakhovsky
c9d2e1cee0 Fix missing override 2019-03-04 19:55:31 -05:00
Brad King
4dab8e69bd VS: Tell VS 2019 to use Windows SDK 8.1 explicitly when needed
VS 2019 does not default to the 8.1 SDK as VS 2017 and VS 2015 did.
When `CMAKE_SYSTEM_VERSION` is 8.1 or lower, select the 8.1 SDK
explicitly.

Fixes: #18927
2019-02-19 09:31:50 -05:00
Brad King
5c26e3c5e3 VS: Fix validation of Windows 8.1 SDK
The check added by commit 0a29a31161 (VS2017: Verify Windows 8.1 SDK
before using it, 2017-04-25, v3.8.1~2^2) used the wrong path to
`windows.h` within the SDK, leading to it never being detected.

Fixes: #18923
2019-02-14 08:25:26 -05:00
Brad King
da402a081b VS: Use MSBuild matching toolset host architecture
VS 2017 and VS 2019 provide `amd64/MSBuild.exe` variants next to
their `MSBuild.exe` tools.  When the 64-bit host toolchain is
selected (e.g. via `host=x64`), select the 64-bit MSBuild too.

Fixes: #18219
2019-01-29 09:11:00 -05:00
Brad King
0fd742a6ff VS: Teach VS 2019 generator to select host tools matching host arch
This generator is new so we can introduce the long-desired behavior
of selecting ``host=x64`` tools by default on x64 hosts.
2019-01-28 12:58:21 -05:00
Brad King
bf774e521b VS: Remove stray semicolons from VS 2019 implementation 2019-01-28 11:22:31 -05:00
Brad King
626c51f47b VS: Update for Visual Studio 2019 Preview 2
The toolset is now called `v142`.  Use matching flag tables.

Fixes: #18834
2019-01-24 13:49:25 -05:00
Brad King
8bba458ea5 Add global generator factory method to get default platform name 2019-01-18 12:30:19 -05:00
Brad King
818df52c48 Add global generator factory method to get list of known platforms
Add a `cmGlobalGeneratorFactory::GetKnownPlatforms` method to return
a list of known possible values for `CMAKE_GENERATOR_PLATFORM`.
Implement the method for each generator by referencing the list of
possible values documented in `Help/generator/*.rst` for it.

Co-Author: Julien Jomier <julien.jomier@kitware.com>
2019-01-18 12:29:53 -05:00
Brad King
8144b00e32 Split global generator factory list with and without platforms
Replace `cmGlobalGeneratorFactory::GetGenerators` with a pair of methods
to split the list of generator names into those that have platforms in
the name and those that do not.
2019-01-18 12:29:53 -05:00
Brad King
b70c0aed5c VS: Factor out helper function to compute host platform name 2019-01-18 12:29:53 -05:00
Bruno Manganelli
cc2a5261f8 Factor out enum MessageType into dedicated header
Reduce the number of files relying on `cmake.h`.
2019-01-16 08:16:31 -05:00
Brad King
57e48f16f2 VS: Add Visual Studio 16 2019 generator
Add this generator *without* support for specifying the target
architecture in the generator name.  cmake-gui will be taught
to provide a field for this, and command-line builds can use -A.

Also, teach this generator to select a default target architecture
based on the host architecture.

Fixes: #18689
Inspired-by: Egor Pugin <egor.pugin@gmail.com>
2019-01-11 11:04:51 -05:00
Brad King
bdef729646 VS: Parameterize VS 2017 generator to support future versions 2019-01-11 10:37:41 -05:00
Brad King
68d316e0cf VS: Rename VS 2017 generator sources to be version-independent
Rename `cmGlobalVisualStudio{15 => Versioned}Generator`.  Rename
`Factory` to `Factory15` since that part still needs to be
version-specific.
2019-01-11 10:37:39 -05:00