Commit Graph

179 Commits

Author SHA1 Message Date
Eduard Voronkin
e42881422f FASTBuild: optimize try_compile builds
The generator does a lot of tricks in order to make the "rebuild-bff"
target up-to-date immediately after the generation. We can skip all of
those during "TryCompile" runs, which should reduce configure time.
2025-10-22 17:32:48 -07: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
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
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
78d9564d50 cmGlobalVisualStudio7Generator: Inline short method at only call site 2025-09-01 15:25:19 -04:00
Brad King
034cc29b89 cmGlobalVisualStudio7Generator: Constify .sln write methods 2025-09-01 15:25:19 -04:00
Brad King
5004602715 cmGlobalVisualStudio7Generator: Factor folder collection out of write method 2025-09-01 15:25:19 -04:00
Brad King
6ae4ed30d9 cmGlobalVisualStudio7Generator: Factor target collection out of write method 2025-09-01 15:25:18 -04:00
Brad King
5582eb292e cmGlobalVisualStudio7Generator: Update outdated comment 2025-09-01 15:25:18 -04:00
Brad King
ccbd61dd53 cmGlobalVisualStudio7Generator: Remove unused member 2025-09-01 15:25:18 -04:00
Daniel Pfeifer
ee1c32b6d7 source: Pass cmBuildOptions by value 2025-07-30 11:55:34 -04: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
Lauri Vasama
0bb13ba0e6 VS: Add support for Visual Studio solution items
Files listed in the `VS_SOLUTION_ITEMS` directory property of a project
directory are added as solution items in the 'Solution Items' solution
directory.

If `source_group` is applied to the files listed in `VS_SOLUTION_ITEMS`,
solution groups matching the names of the source groups are created
outside of the default 'Solution Items' group.  If not items are placed
into the default group, it is not created.

Solution items added to subprojects are not included in the top-level
project.

Closes: #26409
2024-11-22 09:12:19 -05:00
Lauri Vasama
f1bcb7276a VS: Refactor solution folder creation
* Add cmVisualStudioFolder struct containing names of projects within
  that folder.
* Separate folder creation out of WriteTargetsToSolution into a new
  CreateSolutionFolders function.
2024-11-20 18:10:25 +02: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
Ben Boeckel
5b16a0e568 cmGlobalVisualStudio7Generator: make SupportsCxxModuleDyndep protected
The generator target will want to ask this question when determining
whether C++ modules are supported or not.
2022-12-01 08:33:43 -05:00
Ben Boeckel
27e37b8a5a clang-tidy: fix modernize-use-override lints 2022-11-29 12:39:29 -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
Ben Boeckel
386465bf83 cmTarget: add support for C++ module fileset types
C++ modules have two variants which are of importance to CMake:

  - `CXX_MODULES`: interface modules (those using `export module M;`,
    `export module M:part;`, or `module M:internal_part;`)
  - `CXX_MODULE_HEADER_UNITS`: importable header units

Creating C++ modules or partitions are *not* supported in any other
source listing. This is because the source files must be installed (so
their scope matters), but not part of usage requirements (what it means
for a module source to be injected into a consumer is not clear at this
moment). Due to the way `FILE_SET` works with scopes, they are a perfect
fit as long as `INTERFACE` is not allowed (which it is not).
2022-06-16 10:28:34 -04:00
Brad King
6ab2c40c17 cmGlobalVisualStudio7Generator: Drop unused method
Since commit f47b4f68a9 (Drop Visual Studio 7 generator for VS .NET
2002, 2016-03-10, v3.6.0-rc1~268^2), the `WriteTargetDepends` method has
not been used.
2022-02-12 12:08:44 -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
Marc Chevrier
cc56dc7468 Rename cmProp in cmValue 2021-09-21 17:14:04 +02:00
Marc Chevrier
5a2a275bb4 Refactor: reduce cmToCStr usage 2021-08-19 10:49:30 +02: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
Kyle Edwards
7abc3d61ac Ninja Multi-Config: Fix issue with framework dependencies and Autogen
Fixes: #20345
2020-02-17 08:24:57 -05:00
Vitaly Stakhovsky
bbc07e4561 Source: use std::string in place of const char* 2020-01-29 14:31:01 -05:00
Marc Chevrier
36c8cae2e8 cmLocalGenerator: modernize memory management 2019-12-10 00:24:06 +01:00
Kitware Robot
ed98209ddc Revise include order using clang-format-6.0
Run the `clang-format.bash` script to update our C and C++ code to a new
include order `.clang-format`.  Use `clang-format` version 6.0.
2019-10-01 12:26:36 -04:00
Kitware Robot
54e9d38c28 Refactor: Convert all instances of CMAKE_BUILD_WITH_CMAKE to CMAKE_BOOTSTRAP 2019-08-09 10:41:44 -04:00
Vitaly Stakhovsky
23e8364aed Source: std::string related cleanup 2019-05-15 10:20:05 -04:00
Sebastian Holtermann
735c6f39d9 Fix invalid ///! doxygen comment line starts
In various places `///!` was used to start a comment line.  This is not valid
Doygen syntax.  This patch replaces `///!` comment starts with `//!`.
2019-03-31 11:27:12 +02:00
Bartosz Kosiorek
324d18bb34 cmake: Teach --build mode to support multiple targets
Fixes: #16136
2019-03-05 08:55:28 -05:00
Robert Maynard
1a45266cb5 cmGlobalGenerator: Add a class that represent the build command
This refactors a std::vector<std::string> into a class so that
we can extend the features to represent things such as multiple
chained commands in the future.
2019-01-25 08:20:02 -05:00
Brad King
89cc3d432b VS: Move platform name members to top-level global generator
We no longer support any VS versions that pre-date support for
multiple platforms (target architectures).
2019-01-10 09:38:35 -05:00
Brad King
40a732800d VS: Clarify global generator constructor interface
Make the constructors protected since they should be produced through
factories.  Also rename `platform{ => InGenerator}Name` to clarify
the meaning of the argument.
2019-01-10 09:38:35 -05:00
Brad King
163cc8bbdd VS: Convert WriteSLNHeader to non-virtual lookup table 2019-01-10 07:52:51 -05:00
Vitaly Stakhovsky
77d83568e0 cmGlobalVisualStudioGenerator::GetIDEVersion(): const added 2019-01-02 08:25:49 -05:00
Brad King
b83fe27d8d fileapi: Report cmake generator in reply index file 2018-12-12 06:40:10 -05:00
Brad King
a6e02f881d add_dependencies: Track backtraces internally
Record backtraces for "utility" dependencies created by
`add_dependencies` calls.
2018-10-18 08:10:55 -04:00
Kitware Robot
d7204e649e Revise C++ coding style using clang-format-6.0
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 6.0.

* 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.
2018-06-01 09:53:42 -04:00
Florian Maushart
1ab3881ec9 cmake: Add options for parallel builds to --build mode
While we already support `cmake --build . -- -j`, the options after `--`
are specific to the native build tool.  Add new options `--parallel
[<N>]` and `-j [<N>]` to abstract this and map to the proper option
for the native build tool.
2018-05-25 09:42:20 -04:00
Vitaly Stakhovsky
cfe4e2db1f VS: Use 'override' keyword for overridden methods in generator classes
The corresponding 'virtual' removed.
2017-12-15 21:17:49 -05:00
Brad King
0b33aee48b Use C++11 override instead of CM_OVERRIDE
We now require C++11 support including `override`.  Drop use of
the old compatibility macro.  Convert references as follows:

    git grep -l CM_OVERRIDE -- '*.h' '*.hxx' '*.cxx' |
      xargs sed -i 's/CM_OVERRIDE/override/g'
2017-09-15 10:06:41 -04:00