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

222 Commits

Author SHA1 Message Date
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
NAKAMURA Takumi
0e58a5ea07 Source: Fix possible IWYU warnings in Windows generators 2021-11-20 00:50:33 +09:00
NAKAMURA Takumi
c46b041a3b cmLocalGenerator: Simplify Add{Custom,Utility}Command 2021-11-18 12:02:38 -05:00
NAKAMURA Takumi
9b31a97748 cmCustomCommand: Move constructor arguments to individual setters
Make `cmCustomCommand` have just only default constructor.
Use each setter instead.  This follows the builder pattern.

Introduce `cc::SetOutputs(std::string output)`.
This will be used later, as substitution for `cc::SetOutputs({output})`.
2021-11-18 12:02:37 -05:00
Marc Chevrier
cc56dc7468 Rename cmProp in cmValue 2021-09-21 17:14:04 +02:00
Brad King
c46b265839 VS: Add Visual Studio 17 2022 generator
Fixes: #22339
2021-06-25 12:45:44 -04:00
Kyle Edwards
f01f10e8fb cmCustomCommand: Record value of CMP0116 at time of creation 2021-02-23 09:14:31 -05:00
Brad King
422d9a0ab2 Factor out generator checks for filtering out interface libraries
Add a `cmGeneratorTarget::IsInBuildSystem` helper method to tell
generators whether a target should participate in the generated build
system.
2020-07-23 13:31:44 -04:00
Vitaly Stakhovsky
eaad8072ee cmNonempty: Convenience inlines to check for non-empty string 2020-07-14 15:18:59 -04:00
Brad King
05e0ff3c73 Merge topic 'vs-sln-version-16'
b69010b719 VS: Fix .sln support for VS Version Selector with VS 2019

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4844
2020-06-03 06:03:43 -04:00
Brad King
b69010b719 VS: Fix .sln support for VS Version Selector with VS 2019
VS 2019 changed the naming pattern used by 2015 and 2017.

Fixes: #20783
2020-06-02 10:30:33 -04:00
Brad King
1174efb6f9 Merge topic 'vs-sln-version' into release-3.17
88ad02f1ec VS: Restore .sln support for VS Version Selector

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4765
2020-05-20 09:03:23 -04:00
Brad King
4dfc7846f4 Merge topic 'vs-sln-version'
88ad02f1ec VS: Restore .sln support for VS Version Selector

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4765
2020-05-20 09:03:23 -04:00
Brad King
88ad02f1ec VS: Restore .sln support for VS Version Selector
Since commit 3b51343ea1 (VS: Emit UTF-8 BOM for generated solution files,
2019-08-19, v3.16.0-rc1~237^2) the `.sln` file does not work with the
VS Version Selector.  Add a newline after the BOM to restore support.

Fixes: #20725
2020-05-19 08:24:37 -04:00
Vitaly Stakhovsky
36aba01223 cmGeneratorTarget::GetProperty: return cmProp 2020-04-29 10:59:39 -04:00
Justin Goshi
bc877a7e94 Add support to indicate UTF-8 custom command pipe output encoding
Adds a flag to indicate that pipe output from a custom command should be
interpreted as UTF-8 encoded. This change does not introduce a public
way to set the flag, but generators that create internally-generated
commands know if they are calling cmake, which uses UTF-8 pipes.

MSBuild added support for interpreting output of PreBuildEvent,
PreLinkEvent, PostBuildEvent, and CustomBuildStep as UTF-8. This change
will appear in Visual Studio 16.6 Preview 3. It is opt-in, and you need
to add the StdOutEncoding tag. MSBuild treats these as property bags so
if we emit the tag for earlier versions of Visual Studio it would be
safely ignored. This change emits the StdOutEncoding tag and sets it to
UTF-8 whenever the custom command UTF-8 pipe flag is set. This fixes
globalization issues when the output from cmake contained characters
that required MSBuild to interpret as UTF-8 before displaying them.
2020-04-13 12:54:47 -07:00
Vitaly Stakhovsky
aba23c747b cmMakefile::GetProperty: return cmProp 2020-04-01 10:56:34 -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
Daniel Eiband
777ceaea94 cmMakefile: Delay custom command creation
Move custom command creation to cmLocalGenerator and dispatch custom
commands in cmMakefile to generate time.  Generators add custom commands
using the new methods provided by cmLocalGenerator.

Issue: #12877
2019-11-24 20:32:43 +01:00
Daniel Eiband
96e5042e46 cmCustomCommand: Explicitly pass backtrace on construction 2019-11-24 20:13:23 +01:00
Marc Chevrier
f93385283f cmLocalGenerator: modernize memory management 2019-11-11 16:41:13 +01:00
Brad King
55a0bebdd3 VS: Add support for per-config sources
Since commit 97cc29c766 (VS: Teach generators how to mark per-config
source files, 2017-04-10, v3.9.0-rc1~268^2~2) the VS generators have
known how to generate per-config sources.  We've now converted most
other code paths to support per-config sources, so drop the check
that disallows it.

This leaves only per-config support for precompiled headers and unity
build transformations, but those are optional features that can be
addressed later.

Fixes: #18233
Issue: #19789
2019-10-17 14:05:39 -04:00
Brad King
bcaecf6bcd Teach check for single-language targets to consider all configurations 2019-10-17 14:03:54 -04: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
Brad King
dce58afd30 Merge branch 'backport-3.15-fix-EXCLUDE_FROM_ALL-subdir-all'
Resolve conflicts with changes since the 3.15 series:

* Convert `cmSystemTools::IsOn` => `cmIsOn`.
* Move one "EXCLUDE_FROM_ALL" target property logic fix to
  its new location in `cmMakefile::AddNewUtilityTarget`.
2019-09-30 09:34:57 -04:00
Brad King
05d7ca14e9 Merge branch 'backport-3.14-fix-EXCLUDE_FROM_ALL-subdir-all' 2019-09-30 09:19:21 -04:00
Brad King
b3b1c7bf3a Restore "all" target in subdirectories marked EXCLUDE_FROM_ALL
The "all" target in each directory is supposed to have targets from that
directory even if the directory itself is marked `EXCLUDE_FROM_ALL` in
its parent.  This was broken by commit dc6888573d (Pass EXCLUDE_FROM_ALL
from directory to targets, 2019-01-15, v3.14.0-rc1~83^2) which made the
participation of a target in "all" independent of context.  Revert much
of the logic change from that commit to restore the old behavior.  Then
re-implement the behavior intended by the commit to keep its test
working.  Extend the test to cover the old behavior too.

Fixes: #19753
2019-09-30 09:18:20 -04:00
Daniel Eiband
5a06efda05 cmMakefile: Remove AddUtilityCommand overload without byproducts 2019-09-26 10:04:03 -04:00
Daniel Eiband
f151a57705 cmMakefile: Move enumerations into new header
The enumerations will also be used in cmLocalGenerator.
2019-09-26 10:02:06 -04:00
Brad King
a29b8d285e Merge topic 'fix-vsmacro-access-violation'
7847fef510 VS: Fix access violation when calling Visual Studio macro

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3853
2019-09-26 09:49:56 -04:00