Commit Graph

252 Commits

Author SHA1 Message Date
Ben Boeckel 366b25e62e ast-grep: simplify cmHasLiteral{Suf,Pre}fix with char literals 2025-11-20 12:14:14 -05:00
Brad King 06178da668 VS: Add include_external_msproject detection of .wapproj type
It is a Windows Application Packaging Project.

Issue: #27392
2025-11-18 11:18:17 -05:00
Brad King f49b0e6759 IWYU: Update for Debian 13 CI job
`include-what-you-use` diagnostics, in practice, are specific to
the environment's compiler and standard library.  Update includes
to satisfy IWYU for our CI job under Debian 13.  Some patterns:

* Types named in virtual `override` signatures no longer require
  includes since the overridden signature already names them.

* A function argument's type needs to be included even if its constructor
  is called only by implicit conversion.  For example, constructing a
  `std::function` from a lambda now requires `<functional>`.

* Some prior mysterious `<type_traits>` inclusions are no longer required.
2025-11-12 14:54:16 -05:00
Brad King 6ebf21a360 VS: Restore support for Intel Fortran projects
Refactoring in commit 3882718872 (VS: Decouple solution generation from
`.sln` file format, 2025-09-15, v4.2.0-rc1~154^2~3) accidentally dropped
Fortran targets from the generated VS Solution.

Fixes: #27346
2025-10-29 11:55:53 -04:00
Brad King c6934e0928 Merge topic 'vs-sdk-style-platform-override'
4ebedf246d VS: Fix SLNs for DOTNET_SDK targets with VS_GLOBAL_PlatformTarget

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Steven Boswell <ulatekh@yahoo.com>
Merge-request: !11247
2025-09-30 09:57:09 -04:00
Brad King 4747b64fff VS: Restore include_external_msproject type detection
Refactoring in commit 3882718872 (VS: Decouple solution generation from
`.sln` file format, 2025-09-15) accidentally left out automatic
detection of the external project type id from its file extension.
2025-09-29 16:47:46 -04:00
Jelle 4ebedf246d VS: Fix SLNs for DOTNET_SDK targets with VS_GLOBAL_PlatformTarget
By default, .NET SDK-style projects build for "Any CPU", so we generate
solution files accordingly.  Although CMake does not model per-target
architectures, some projects set the `VS_GLOBAL_PlatformTarget` property
on `DOTNET_SDK` targets in order to compile for a specific architecture.
Fix generated solution files to account for the architecture override.

Issue: #23513
2025-09-29 12:25:01 -04:00
Brad King e6aa7742b0 VS: Generate .slnx files for VS 2026
Since the `Visual Studio 18 2026` generator is new, we can switch
to the `.slnx` file format without changing behavior for users of
VS 2022 and older.

Fixes: #25887
2025-09-18 12:00:01 -04:00
Brad King d32b78f139 cmGlobalVisualStudio7Generator: Factor out computation of path to .sln 2025-09-18 11:56:37 -04:00
Brad King 6a77c80834 cmGlobalVisualStudioGenerator: Consolidate solution generation methods 2025-09-17 09:40:23 -04:00
Brad King 6b1c101410 cmGlobalVisualStudioGenerator: Adopt more solution generation methods 2025-09-17 09:40:22 -04:00
Brad King 3882718872 VS: Decouple solution generation from .sln file format
Rewrite `.sln` generation using a structured intermediate representation.

Issue: #25887
2025-09-17 09:40:07 -04:00
Brad King 76266f9df6 cmGlobalVisualStudioGenerator: Adopt some solution generation methods
All versions of VS we still support use the Solution model.
2025-09-16 11:33:13 -04:00
Brad King cd46d8ec84 Merge branch 'backport-vs2026' into vs2026 2025-09-15 11:33:57 -04:00
Brad King 3392b371e2 VS: Add Visual Studio 18 2026 generator
Closes: #27213
2025-09-15 11:31:02 -04:00
Brad King 7f0883ac04 VS: Remove unused generator code
VS 15 and above do not have an "Express Edition".
2025-09-10 17:01:12 -04:00
Ben Boeckel 08f1a0fbc6 cmLocalGenerator: get the configuration when building object paths
Install locations can be per-configuration, so this information is
necessary for this call. Plumb it through; usage will follow in the next
commit.
2025-09-09 09:58:07 -04:00
Brad King d48a9e1111 Merge topic 'vs-cleanup'
a5cb4fe1c6 cmGlobalVisualStudioGenerator: Remove unused code left from VS 7.1

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11149
2025-09-05 09:40:38 -04:00
Brad King a5cb4fe1c6 cmGlobalVisualStudioGenerator: Remove unused code left from VS 7.1
Since commit c94f1bcf92 (Drop Visual Studio 7 .NET 2003 generator,
2017-04-19, v3.9.0-rc1~248^2) we no longer need special solution-level
target dependencies.  We use `LinkLibraryDependencies` instead.
2025-09-04 12:30:02 -04:00
Brad King 54e7008e2d Merge topic 'vs-cleanup'
78d9564d50 cmGlobalVisualStudio7Generator: Inline short method at only call site
034cc29b89 cmGlobalVisualStudio7Generator: Constify .sln write methods
5004602715 cmGlobalVisualStudio7Generator: Factor folder collection out of write method
6ae4ed30d9 cmGlobalVisualStudio7Generator: Factor target collection out of write method
5582eb292e cmGlobalVisualStudio7Generator: Update outdated comment
2297ba9399 cmGlobalVisualStudio7Generator: Remove redundant C++ modules check
ccbd61dd53 cmGlobalVisualStudio7Generator: Remove unused member
93e34a5e0e cmGlobalGenerator: Constify GetTargetDirectDepends
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11130
2025-09-02 10:56:09 -04:00
Brad King 034cc29b89 cmGlobalVisualStudio7Generator: Constify .sln write methods 2025-09-01 15:25:19 -04:00
Ben Boeckel c651b0e002 objects: implement installation naming strategies 2025-08-16 09:18:44 -04:00
Ben Boeckel b82a74d918 generators: use GetSupportDirectory() in more places 2025-05-23 11:39:53 +02:00
Ben Boeckel aaeaeff258 cmGlobalVisualStudioGenerator: simplify target dir construction
The components checked for `.empty()` are never actually empty.
2025-05-22 17:02:53 +02:00
Kitware Robot 1772622772 LICENSE: Replace references to Copyright.txt with LICENSE.rst
```
git grep -lz 'Copyright.txt or https://cmake.org/licensing ' |
  while IFS= read -r -d $'\0' f ; do
    sed -i '/Copyright.txt or https:\/\/cmake.org\/licensing / {
              s/Copyright.txt/LICENSE.rst/
            }' "$f" ; done
```
2025-03-03 10:43:35 -05:00
Kitware Robot 0b96ae1f6a Revise C++ coding style using clang-format with "east const"
Run the `clang-format.bash` script to update all our C and C++ code to a
new style defined by `.clang-format`, now with "east const" enforcement.
Use `clang-format` version 18.

* 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.

Issue: #26123
2025-01-23 13:09:50 -05:00
Brad King 381c446ff7 VS: Remove support for appending a platform to the generator name
Compatibility with CMake versions prior to 3.1 is no longer supported.

Fixes: #26481
2025-01-21 08:08:22 -05:00
Alex Turbov bc8621d999 Fix: A lot of typos in code found by typos
Yet another great code spellchecker: https://github.com/crate-ci/typos/

(Will be added later as a `pre-commit` hook)
2025-01-12 18:49:34 +04:00
Garrett Campbell 9ed178f9d8 Add generator-agnostic DEBUGGER_WORKING_DIRECTORY target property
Generalize the `VS_DEBUGGER_WORKING_DIRECTORY` property.

Issue: #16478
2024-12-09 10:47:10 -05:00
Brad King 241f923a6f Drop Visual Studio 12 2013 generator
This generator has been deprecated since CMake 3.28.  Remove it.
2024-08-28 14:13:05 -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
Vitaly Stakhovsky 1a49b439a5 Source: Use cmValue::IsOn and IsOff
Speed up a bit by calling members directly.
2024-03-17 19:05:37 -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 2409f62d18 strings: simplify streaming sequences 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 df6a3aff27 Merge topic 'vs-sdk-selection'
a4d532e998 VS: Restore Windows SDK selection with platform in generator name

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8583
2023-06-23 10:52:49 -04:00
Brad King a4d532e998 VS: Restore Windows SDK selection with platform in generator name
Refactoring in commit e259063b0a (VS: Defer Windows SDK selection until
CMAKE_GENERATOR_PLATFORM is known, 2023-03-31, v3.27.0-rc1~206^2~5)
accidentally dropped the Windows SDK selection code path for VS
generators named with the old-style platform suffix.

Fixes: #25007
2023-06-22 11:22:08 -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
scivision 7b0a629693 Source: use C++11 nullptr 2023-02-14 14:34:03 -05:00
Kyle Edwards 480b363724 cmCustomCommand: Refactor custom command-specific policy values
Many custom commands are created by CMake itself rather than by
the user. These custom commands should always have their policies
set to NEW, and user-created custom commands should have their
policy values set only from the state snapshot. In addition, we
want to genericize the mechanism of recording a policy at the time
of custom command creation.

Add a CM_FOR_EACH_CUSTOM_COMMAND_POLICY macro to genericize
custom command policies. Use this to define all custom command
policies. Make all such policies NEW instead of WARN by default.
Remove individual policy modifier methods and add a single method
that records relevant values from a cmStateSnapshot. Remove the
no longer needed explicit policy settings from synthesized custom
commands.
2023-02-06 15:04:16 -05:00
Ben Boeckel 362d6cd234 clang-tidy: fix modernize-raw-string-literal lints 2022-11-29 12:39:45 -05:00
Ben Boeckel 27f5ce07cc clang-tidy: fix performance-unnecessary-value-param 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 83d685ee1b clang-tidy: fix modernize-use-equals-default lints 2022-11-29 12:39:29 -05:00
Werner, Joerg f3c918ef1b cmGlobalVisualStudioGenerator: Fix compiling as C++20 in VS 2022
Adding missing narrow string conversion.
2022-10-21 11:01:16 -04: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
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
Sumit Bhardwaj 11b8366e55 VS: Introduce IsInSolution to check whether a target is in sln file
Previously, different versions of VS Generators checked whether a target
was in .sln file or not by checking whether the target was to be written
to build system or not.

As we move `ZERO_CHECK.vcxproj` to `.proj`, we want to exclude those
files from being written to `.sln` files too. This commit introduces
`IsInSolution()` at `cmGlobalVisualStudioGenerator` level which can be
customized at specific versioned Generator when needed.
2022-02-12 12:09:09 -05:00
Sumit Bhardwaj a88f98b3be Make cmGlobalVisualStudioGenerator::VSVersion enum class 2022-01-25 11:25:18 -08:00