1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-06-15 00:21:09 +08:00

29 Commits

Author SHA1 Message Date
Ben Boeckel
1f507580a1 cmGlobalGenerator: give context about module queries
Some queries are merely investigating support in order to change
behavior. Let the method know so that any internal errors can be skipped
over.
2023-11-01 09:52:13 -04:00
Brad King
bba1a23da9 VS: Consolidate Windows SDK major version selection dispatch
Make logic choosing between Windows 10 SDKs and the Windows 8.1 SDK
easier to follow by consolidating it in the VS 14 generator.  The only
information we need from VS 15+ generators is whether the 8.1 SDK is
installed.
2023-08-10 09:33:20 -04:00
Ben Boeckel
0183e1bca3 cxxmodules: remove CMAKE_EXPERIMENTAL_CXX_MODULE_DYNDEP variable
It is now subsumed by the UUID setting completely.
2023-06-01 14:43:26 -04:00
Brad King
406a103318 VS: Add support for C++ module internal partitions in VS 17.6 and newer
VS 17.6 now implements `ScanSourceforModuleDependencies` using the same
`cl /scanDependencies` scanner that our Ninja generator uses.  It can
distinguish module internal partitions from module interface units based
on their content.  Switch from `CompileAsCppModule` to `CompileAsCpp`
for `CXX_MODULES` sources so that MSBuild can scan and classify them.
2023-05-17 11:59:24 -04:00
Brad King
e259063b0a VS: Defer Windows SDK selection until CMAKE_GENERATOR_PLATFORM is known
Prepare to teach `CMAKE_GENERATOR_PLATFORM` to affect SDK selection.
2023-04-05 12:06:22 -04:00
Brad King
5ce0f03cce VS: Add a variable to report the Visual Studio version build number
VS 2017 and above come with a Visual Studio Installer tool that tracks
four-component Visual Studio version numbers.  We already detect the VS
version number because it is needed to make some generation decisions.
Provide the number to projects in a `CMAKE_VS_VERSION_BUILD_NUMBER`
variable so they can use it similarly.

Fixes: #24230
2022-12-07 17:49:04 -05:00
Ben Boeckel
9ee7ee1fc2 cmGlobalVisualStudioVersionedGenerator: check for C++ module support 2022-12-01 08:33:43 -05:00
Ben Boeckel
fce359c5de cmGlobalVisualStudioVersionedGenerator: support dyndep in VS2022 and up 2022-12-01 08:33:43 -05:00
NAKAMURA Takumi
0e58a5ea07 Source: Fix possible IWYU warnings in Windows generators 2021-11-20 00:50:33 +09:00
Brad King
ec8d37b3b1 VS: Support version specification in CMAKE_GENERATOR_INSTANCE 2021-10-29 11:52:58 -04:00
Brad King
8e6d930e8c VS: Parse comma-separated fields from CMAKE_GENERATOR_INSTANCE 2021-10-29 11:52:58 -04:00
Brad King
9eaf0932af cmGlobalVisualStudioVersionedGenerator: Fix repeating SetGeneratorInstance
Fix logic added by commit 8917b8512f
(cmGlobalVisualStudioVersionedGenerator: Allow repeating
SetGeneratorInstance, 2021-10-20) to avoid repeating work.
2021-10-26 14:07:07 -04:00
Brad King
6999b87133 cmGlobalVisualStudio10Generator: Add method to find MSBuild early
Add a way to find MSBuild before the main `FindMakeProgram` code path
has executed.
2021-10-20 13:00:25 -04:00
Brad King
8917b8512f cmGlobalVisualStudioVersionedGenerator: Allow repeating SetGeneratorInstance 2021-10-20 13:00:25 -04:00
Brad King
c46b265839 VS: Add Visual Studio 17 2022 generator
Fixes: #22339
2021-06-25 12:45:44 -04:00
Gustavo Varo
9ba99a1203 VS: Add support for Utf8Enconding when using VS 16.10+
On VS 16.10 Preview 2 or above, generate `UseUtf8Encoding`
instead of `StdOutEncoding=UTF-8` in `.vcxproj` files.

Fixes: #22032
2021-06-17 13:44:22 -04:00
Brad King
3fd65f5ca6 VS: Compare VS instance versions as strings
This makes the values more readable.
2021-06-17 07:54:48 -04:00
Brad King
aabc3ca47d cmGlobalVisualStudio10Generator: Adopt GetVSInstanceVersion method
Port from `cmGlobalVisualStudioVersionedGenerator`.
2021-06-16 13:22:32 -04:00
Brad King
58a50a3a0a VS: Fix '-T version=14.28' under VS 16.9
CMake accepts the toolset version that is default in the current VS
version by matching the name later VS versions will use for the SxS
props files.  It predicts the future name based on the first two
components of the current VS version's default toolset.  However, this
heuristic breaks naming the VS 16.8 toolset version 14.28 under VS 16.9
because the latter's default toolset version is 14.28.29910, which did
not increment the second version component (unprecedented in VS).

Fix this by always using the requested version's SxS props file when it
exists, even if it matches the first two components of the current VS
version's default toolset.  Also add a special case for the name VS
16.10 will use for VS 16.9's default toolset, so that it can be used
with VS 16.9 too.

Fixes: #21922
2021-03-12 08:36:40 -05:00
jonathan molinatto
1e67482daf VS: Generalize Win10 max SDK version to all VS generators
The `CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM` variable added in
CMake 3.19 by commit ba497111f6 (VS: Add option for custom Win10 SDK
version maximum, 2020-08-20, v3.19.0-rc1~262^2) was documented as if it
worked for all generators but implemented only to override CMake's
builtin default for the VS 2015 max SDK version.  Generalize the
variable to set a custom max SDK version for later VS versions too.

Fixes: #21720
2021-01-20 14:46:34 -05:00
Kitware Robot
bdca8b01d2 Modernize: Use #pragma once in all header files
#pragma once is a widely supported compiler pragma, even though it is
not part of the C++ standard. Many of the issues keeping #pragma once
from being standardized (distributed filesystems, build farms, hard
links, etc.) do not apply to CMake - it is easy to build CMake on a
single machine. CMake also does not install any header files which can
be consumed by other projects (though cmCPluginAPI.h has been
deliberately omitted from this conversion in case anyone is still using
it.) Finally, #pragma once has been required to build CMake since at
least August 2017 (7f29bbe6 enabled server mode unconditionally, which
had been using #pragma once since September 2016 (b13d3e0d)). The fact
that we now require C++11 filters out old compilers, and it is unlikely
that there is a compiler which supports C++11 but does not support
#pragma once.
2020-09-03 09:30:21 -04:00
jonathan molinatto
ba497111f6 VS: Add option for custom Win10 SDK version maximum
Since commit 83ddc4d289 (VS: Do not select a Windows SDK too high for
current VS version, 2017-08-07, v3.13.0-rc1~72^2~2) we enforce a maximum
SDK version for the VS 2015 generator.  The blog post linked in the
original commit is no longer available, but it can be seen here:

* https://web.archive.org/web/20190108032520/https://blogs.msdn.microsoft.com/chuckw/2018/10/02/windows-10-october-2018-update/

In particular, it states:

> VS 2015 Users: The Windows 10 SDK (15063, 16299, 17134, 17763)
> is officially only supported for VS 2017.

However, in some circumstances a higher version can be used.

Add a `CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM` to override the
generator's default maximum SDK version.

Fixes: #20633
2020-08-25 15:27:38 -04:00
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
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