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

261 Commits

Author SHA1 Message Date
Brad King
4f8d39cb59 Merge topic 'vs-17.11'
dfe0f3f358 VS: Fix '-T version=14.4x' under VS 17.1x

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9622
2024-06-24 10:19:44 -04:00
Brad King
dfe0f3f358 VS: Fix '-T version=14.4x' under VS 17.1x
Starting with VS 17.10 the v143 toolset reserves versions `14.30`
through `14.49`.  This is the first time that the first three digits of
the version do not match the toolset name.  Extend the special case from
commit d256581bb0 (VS: Fix '-T version=14.40' under VS 17.10 preview 1,
2024-02-19, v3.29.0-rc2~10^2) to cover the entire reserved version range.
2024-06-24 08:47:33 -04:00
Brad King
03c31b0395 Drop Visual Studio 9 2008 generator
This generator has been deprecated since CMake 3.27.  Remove it.
2024-05-08 10:37:34 -04:00
Brad King
88c70dde34 cmGlobalVisualStudioGenerator: Use member 'Version' more directly 2024-05-08 10:37:34 -04:00
Brad King
d256581bb0 VS: Fix '-T version=14.40' under VS 17.10 preview 1
VS 17.10 preview 1 comes with toolset `v143` version `14.40`.  This is
the first time that the first three digits of the version do not match
the toolset name.  Add a special case to map version `14.40` back to
toolset `v143`.
2024-02-20 06:23:34 -05:00
Brad King
3a7fbd04c8 VS: Verify toolset version= field format more strictly
In commit 5f13168419 (VS: Add option to select the version of the
toolset used by VS 2017, 2018-05-19, v3.12.0-rc1~38^2) we added logic to
verify that the toolset version, such as `14.35`, matches the toolset
name, such as `v143`.  Clarify the logic to not construct a temporary
nonsensical toolset name like `v1435`.  Also verify the format of the
toolset version more strictly, e.g., to reject `14.350` earlier.
Previously the latter example was only rejected by the `.props` file not
existing.
2024-02-19 12:06:48 -05:00
Brad King
43d218d970 VS: Add support for using Intel oneAPI Fortran compiler in .vfproj files
Add a `fortran={ifort,ifx}` field to `CMAKE_GENERATOR_TOOLSET` to
specify which Intel Fortran compiler to use.

Fixes: #25427
2023-11-22 10:22:12 -05:00
Richard Dzenis
899376d070 VS: Allow specifying VCTools version with the ClangCL toolset
Visual Studio supports specifying both:

    <PlatformToolset>ClangCL</PlatformToolset>
    <VCToolsVersion>14.32.31326</VCToolsVersion>

Fixes: #25189
2023-08-16 15:02:54 -04:00
Brad King
661e005a0e Merge topic 'vs-sdk-selection'
d5118ed2e5 Merge branch 'backport-vs-sdk-selection' into vs-sdk-selection
89b611ab32 VS: Select latest Windows SDK even when targeting Windows 8.1 and below
ae97d82e83 VS: Teach CMAKE_GENERATOR_PLATFORM to support Windows 8.1 SDK selection
15ff89654b VS: Teach CMAKE_GENERATOR_PLATFORM to use Windows 10 SDKs for older versions
bba1a23da9 VS: Consolidate Windows SDK major version selection dispatch
209973e510 VS: Do not print empty Windows SDK version when none is selected
ec6dd77053 Tests: Remove redundant condition in RunCMake.GeneratorPlatform test
4776a584ad Help: Add 3.27 release note on VS default SDK selection

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8697
2023-08-10 11:27:48 -04:00
Brad King
d5118ed2e5 Merge branch 'backport-vs-sdk-selection' into vs-sdk-selection 2023-08-10 10:00:53 -04:00
Brad King
15ff89654b VS: Teach CMAKE_GENERATOR_PLATFORM to use Windows 10 SDKs for older versions
Honor an explicit `version=` field selecting a Windows 10 SDK regardless
of the Windows target version.

Issue: #25170
2023-08-10 09:34:50 -04:00
Ben Boeckel
ec5f1c489a cmCryptoHash: prefer to cmSystemTools::ComputeStringMD5
The latter call is no longer post-bootstrap only since 596439b1bb
(cmCustomCommandGenerator: Add option to transform depfile, 2020-10-05)
via !5325. Convert callers to just use `cmCryptoHash` directly and
remove the bootstrap guard.
2023-08-08 13:22:13 -04:00
Ben Boeckel
d4144b9c0a strings: use emplace_back with cmStrCat arguments 2023-07-27 20:15:51 -04:00
Ben Boeckel
809248a0c9 strings: use character literals where possible 2023-07-27 20:00:59 -04:00
Ben Boeckel
7137b17835 cmStrCat: use in Windows-specific sources 2023-07-27 20:00:59 -04:00
Ben Boeckel
a5ba00bdf8 strings: combine string literals where possible 2023-07-27 19:10:39 -04:00
Ben Boeckel
3f1378fbca strings: compare to static string_view instances in Windows-only code 2023-07-27 19:10:39 -04:00
Brad King
536c1de1d4 Drop Visual Studio 11 2012 generator
This generator has been deprecated since CMake 3.25.  Remove it.
2023-06-13 14:20:48 -04:00
Brad King
2f3d945f83 VS: Add CMAKE_GENERATOR_PLATFORM field to control Windows SDK selection
Add a `version=` field to explicitly control the SDK version selection
without relying on `CMAKE_SYSTEM_VERSION`.

Fixes: #16713
2023-04-05 12:06:22 -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
Ivan Zinkevich
33c15ae2b9 VS: Build custom commands concurrently when possible
Enable the `BuildInParallel` setting in VS project files when supported.

Fixes: #18405
2023-01-23 10:38:07 -05:00
Kitware Robot
33abef7416 Revise C++ coding style using clang-format-15
Run the `clang-format.bash` script to update all our C and C++ code to a
new style defined by `.clang-format`.  Use `clang-format` version 15.

* If you reached this commit for a line in `git blame`, re-run the blame
  operation starting at the parent of this commit to see older history
  for the content.

* See the parent commit for instructions to rebase a change across this
  style transition commit.

Fixes: #24315
2023-01-18 16:20:47 -05:00
Ben Boeckel
362d6cd234 clang-tidy: fix modernize-raw-string-literal lints 2022-11-29 12:39:45 -05:00
Ben Boeckel
d64adb9267 clang-tidy: fix readability-string-compare lints 2022-11-29 12:39:45 -05:00
Ben Boeckel
a805a897a8 clang-tidy: fix bugprone-parent-virtual-call lints 2022-11-29 12:39:45 -05:00
Ben Boeckel
4deab0a75c clang-tidy: fix readability-braces-around-statements lints 2022-11-29 12:39:45 -05:00
Ben Boeckel
b72c45e39f clang-tidy: fix readability-else-after-return lints 2022-11-29 12:39:29 -05:00
Ben Boeckel
07172aa31e clang-tidy: fix readability-redundant-string-cstr lints 2022-11-29 12:39:29 -05:00
Ben Boeckel
c61ece5c40 clang-tidy: fix modernize-use-auto lints 2022-11-29 12:39:29 -05:00
Ben Boeckel
64c0702f91 clang-tidy: fix readability-static-accessed-through-instance lints 2022-11-29 12:39:29 -05:00
Brad King
48db261e69 cmake --build: Use both inter- and intra-project parallelism with msbuild
Since commit 1ab3881ec9 (cmake: Add options for parallel builds to
--build mode, 2018-04-14, v3.12.0-rc1~42^2), `cmake --build --parallel`
has added two options to the msbuild command line:

* `/m` enables inter-project parallelism in msbuild.
* `/p:CL_MPCount=1` suppresses intra-project parallelism in cl.

The latter was used to avoid `O(N^2)` compilation threads on `N`
processors.  In practice however, projects often have many source files
in a few targets, so `--parallel` actually reduces parallelism.

Drop the latter option to restore intra-project parallelism.
Users can always add `-- /p:CL_MPCount=1` themselves.

Fixes: #20564
2022-11-16 09:38:41 -05:00
Ilia K
3166547cf6 ASM_MARMASM: Add support for Microsoft ARM assembler language
https://learn.microsoft.com/en-us/cpp/assembler/arm/arm-assembler-reference

Fixes: #23999
2022-11-09 10:22:46 -05:00
Brad King
8d6f015d59 Drop Visual Studio 10 2010 generator
This generator has been deprecated since CMake 3.22.  Remove it.
2022-09-26 15:43:04 -04:00
Nicholas Sinlock
f972e4fd3a cmVSGenerator: Add support for two-part toolset versions for Visual Studio
Enables the Global Visual Studio Versioned Generator to use two-part toolset versions,
if only one toolset has that version number. For example, (14.32 is specified when
14.32.32142 and 14.32.23242 are installed). This change also add a unique return code
and message if a two-part version is used when multiple matching versions are present.

Fixes: #23933
2022-09-02 14:41:37 -07:00
Brad King
289932ded0 VS: Revert "Write ZERO_CHECK.proj for VS19 and above"
Revert commit a334f1b906 (VS: Write ZERO_CHECK.proj for VS19 and above,
2021-12-24, v3.24.0-rc1~607^2) and a supporting change from
commit 7219988b00 (VS: Exclude ZERO_CHECK.proj from .sln for
include_external_msproject, 2022-07-15, v3.24.0-rc4~1^2).

The change was made to support `dotnet` tooling in addition to
`msbuild`.  However, not having `ZERO_CHECK` in the `.sln` breaks common
interactive workflows.  Revert the change for now.  Later it can be
re-introduced behind some kind of option that enables `dotnet` support.

Fixes: #23726
Issue: #20227
2022-07-22 12:54:20 -04:00
Sumit Bhardwaj
7219988b00 VS: Exclude ZERO_CHECK.proj from .sln for include_external_msproject
In `cmGlobalVisualStudio7Generator::WriteTargetsToSolution`, we skip
writing `ZERO_CHECK.proj` to solution file as the check in
`cmGlobalVisualStudioGenerator::IsInSolution` returns `false` for
`ZERO_CHECK`. However, we write ZERO_CHECK to ProjectDependencies for
external projects as there are no checks in
`cmGlobalVisualStudio71Generator::WriteExternalProject`.

Similar to `cmGlobalVisualStudioGenerator::IsInSolution`, we introduce
`IsDepInSolution(const std::string&)` which excludes `ZERO_CHECK.proj`
from being added to sln file for the cases where we have `ZERO_CHECK.proj`.

Fixes: #23708
2022-07-20 08:51:38 -04:00
FeRD (Frank Dana)
98a10290a8 cmSystemTools: Fix 'ErrorOccurred' spelling
Rename the booleans 's_ErrorOccured' and 's_FatalErrorOccured' to
's_ErrorOccurred' and 's_FatalErrorOccurred', respectively.

Rename the getters and setters to 'Get[Fatal]ErrorOccurred' and
'Set[Fatal]ErrorOccurred', and fix all uses across the codebase.
2022-06-13 09:05:24 -04:00
Sumit Bhardwaj
a334f1b906 VS: Write ZERO_CHECK.proj for VS19 and above
For VS 19 and above, switch the format of project file to
`VsProjectType::proj` for ZERO_CHECK target. The `ZERO_CHECK.proj`
consists of primitive MSBuild commands only and has no dependency on any
other targets or props files. This proj file is written as a
`ProjectReference` for other targets, but is not written to the sln
file.
2022-02-20 16:47:36 -08:00
Brad King
4313c5acbc VS: Revert "Write ZERO_CHECK.proj for VS19 and above"
Revert commit 925da7d428 (VS: Write ZERO_CHECK.proj for VS19 and above,
2021-12-24).  Although its commit message was mistakenly not updated, it
implemented the change for VS 2017 and below too.  Since it was merged,
I've discovered several subtle failures in nightly testing with VS 2017.
Revert the change pending further investigation.
2022-02-17 11:23:02 -05:00
Brad King
731bdec8b9 Merge topic 'vs-package-restore-docs'
d92469e572 Help: Clarify how package resolve mode is intended to be used
f320a31087 cmake --build: prioritize --resolve-package-references over preset

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6984
2022-02-16 09:41:03 -05:00
Carsten Rudolph
f320a31087 cmake --build: prioritize --resolve-package-references over preset
Fixes: #23224
2022-02-15 10:20:02 -05:00
Sumit Bhardwaj
925da7d428 VS: Write ZERO_CHECK.proj for VS19 and above
Use VsProjectType::proj as the file format for ZERO_CHECK and write
ZERO_CHECK.proj as a msbuild dependency for other projects.
2022-02-12 12:09:09 -05:00
Florian Schweiger
5cdd774d51 VS: Handle build target correct for .NET SDK style projects with Any CPU
* Extend Visual Studio solution parser for reading build target
* Map solution build target to project build target (especially for Any CPU)
* Use C++ <optional> template instead of pointer return value for cmSlnData::GetProjectByGUID
2022-02-07 13:08:37 +01:00
Sumit Bhardwaj
a88f98b3be Make cmGlobalVisualStudioGenerator::VSVersion enum class 2022-01-25 11:25:18 -08:00
Carsten Rudolph
9aa7831f05 Presets: add resolve packages setting to build presets. 2022-01-22 06:35:41 -05:00
Carsten Rudolph
b2f8f0bb87 cmGlobalVisualStudio10Generator: Auto restore NuGet packages. 2022-01-22 06:35:41 -05:00
Carsten Rudolph
193b8fca52 cmBuildOptions: Split build arguments into separate object. 2022-01-22 06:35:38 -05:00
NAKAMURA Takumi
0e58a5ea07 Source: Fix possible IWYU warnings in Windows generators 2021-11-20 00:50:33 +09:00
Brad King
f97f8537f3 VS: Model a default target framework
Add fields to the VS generator to select a target framework.
Migrate the existing default for VS 12 .NET CF for Windows CE.

Report the values in `CMAKE_VS_*` variables and use them for
the CSharp compiler id project too.

Issue: #22849
2021-11-06 06:08:54 -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