1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-06-11 00:23:40 +08:00

757 Commits

Author SHA1 Message Date
Brad King
ad22d0c1d0 Merge topic 'vs-non-built-file-item-metadata'
0723e04f7a VS: Add documentation for VS_SETTINGS and VS_SOURCE_SETTINGS_<tool>.
2ca1102f83 VS: Test VS_SETTINGS and VS_SOURCE_SETTINGS_<tool> properties.
f00e1b816d VS: Add VS_SOURCE_SETTINGS_<tool> target property
2ce42f281f VS: Add VS_SETTINGS source file property
53116d3942 VS: Use unordered_map to write HLSL settings.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4498
2020-03-30 13:28:19 -04:00
Rolf Eike Beer
94de927cab VS10Generator: avoid many string allocations 2020-03-24 17:50:42 +01:00
Rolf Eike Beer
48adc29721 replace "std::string::find(x) == 0" with cmHasPrefix() 2020-03-23 22:41:43 +01:00
Matt Davies
f00e1b816d VS: Add VS_SOURCE_SETTINGS_<tool> target property
VS_SOURCE_SETTINGS_<tool> is a list of key value pairs that get written as item
metadata for any file associated with <tool> for that target. The entire value
of VS_SOURCE_SETTINGS_<tool> is evaluated as a generator expression. VS_SETTINGS
can override settings specified in this property.
2020-03-20 16:16:58 +00:00
Matt Davies
2ce42f281f VS: Add VS_SETTINGS source file property
VS_SETTINGS is a list of key value pairs that get written as item
metadata for the associated non-built file. The entire value of
VS_SETTINGS is evaluated as a generator expression.
2020-03-20 16:16:58 +00:00
Matt Davies
53116d3942 VS: Use unordered_map to write HLSL settings. 2020-03-20 16:16:44 +00:00
Vitaly Stakhovsky
60f57d0dcc cmPropertyMap: Introduce cmProp as return type for GetProperty() functions
Currently properties are usually stored internally as `std::string`.
However, family of GetProperty() functions return them as `const char *` using `c_str()`.
The proposed `cmProp`, typedef'ed as `const std::string *` will expose properties
more naturally.
2020-03-13 13:32:17 -04:00
Kinan Mahdi
ac6b18cd90 CSharp: Add support for source groups with out-of-source builds
This also fixes support for multiple sources of the same name in
different directories.  Add a test for both problems.

Issue: #19505
2020-02-28 11:42:01 -05:00
Brad King
8752c1bd64 Merge branch 'backport-3.16-link-line-backtrace' 2020-02-10 16:17:03 -05:00
Brad King
e756328434 Propagate backtraces from LINK_LIBRARIES through to link line items
Since commit d4d0dd0f6a (cmLinkLineComputer: Add ComputeLinkLibs
overload with backtraces, 2019-09-13, v3.16.0-rc1~87^2~4), backtraces
have been collected by `ComputeLinkLibs` by looking back through the
link implementation libraries for one matching the text of the link line
item.  This is slow in projects with long link lines.

Instead, teach `cmComputeLinkDepends` and `cmComputeLinkInformation` to
carry backtrace information explicitly along with the text of each item.

Fixes: #20322
2020-02-10 16:11:38 -05:00
Brad King
4b1a6a4722 Merge topic 'vs-version-for-unity' into release-3.16
9135954e2f VS: Do not use native unity builds on VS 2017 versions less than 15.8

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4324
2020-02-05 08:33:50 -05:00
Brad King
4b062c77b3 Merge topic 'vs-version-for-unity'
9135954e2f VS: Do not use native unity builds on VS 2017 versions less than 15.8

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4324
2020-02-05 08:33:50 -05:00
Brad King
9135954e2f VS: Do not use native unity builds on VS 2017 versions less than 15.8
VS 2017 version 15.8 introduced support for unity builds implemented
in part by the `$(VCTargetsPath)/Microsoft.Cpp.Unity.targets` file.
Do not enable unity builds on VS 15 versions that do not have that file.

Fixes: #20284
2020-02-04 11:46:18 -05:00
Brad King
f972b929d6 Merge topic 'vs-16.4-custom-command-inputs' into release-3.16
58b0674687 VS: Tell VS 16.4 not to verify SYMBOLIC custom command inputs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4297
2020-01-29 10:36:40 -05:00
Brad King
92f04d3790 Merge topic 'vs-16.4-custom-command-inputs'
58b0674687 VS: Tell VS 16.4 not to verify SYMBOLIC custom command inputs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4297
2020-01-29 10:36:40 -05:00
Brad King
58b0674687 VS: Tell VS 16.4 not to verify SYMBOLIC custom command inputs
Extend the fix from commit 0578239d3a (VS: Tell VS 16.4 not to verify
SYMBOLIC custom command outputs, 2019-09-23, v3.15.4~2^2) to apply to
SYMBOLIC *inputs* too.  This is needed when there is a chain of custom
commands that use symbolic paths for ordering.

Fixes: #20179
2020-01-28 13:52:05 -05:00
Brad King
1f9321c683 Merge topic 'cuda_runtime_library_controls'
0d0145138f CUDA: Add abstraction for cuda runtime selection

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4178
2020-01-28 10:52:33 -05:00
Robert Maynard
0d0145138f CUDA: Add abstraction for cuda runtime selection
Fixes #17559
Replace our hard-coded default of cudart=static with a first-class abstraction to select the runtime library from an enumeration of logical names.
2020-01-27 16:02:26 -05:00
Brad King
0bf9589bf1 Merge topic 'csharp-no-valued-macros'
effd4d0569 CSharp: Do not pass definitions with values

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4267
2020-01-27 10:03:26 -05:00
Sumit Bhardwaj
effd4d0569 CSharp: Do not pass definitions with values
The Microsoft C# tooling does not accept definitions with values.
Filter them out.

Fixes: #19817
2020-01-24 14:43:37 -05:00
Joerg Bornemann
ae1e1909a1 VS: Add support for .NET Standard and .NET Core
Fixes: #20105
2020-01-24 09:11:05 -05:00
Brad King
37a30f228a Merge topic 'fix-vs-winrt-by-default'
557ea4614e VS: Change CMAKE_VS_WINRT_BY_DEFAULT to not implicitly enable WinRT
7bcef355bf Vs: Add test for VS_WINRT_BY_DEFAULT

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4127
2019-12-17 11:11:24 -05:00
Brad King
2d17101269 Merge topic 'vs-xml-improve'
d8f1736dcc cmVisualStudio10TargetGenerator: improve XML element generation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4140
2019-12-17 11:10:21 -05:00
Brad King
64e2891cbd Merge topic 'stdstring-target'
c34b4497f8 cmTarget: add std::string overloads

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4137
2019-12-17 11:09:20 -05:00
Petr Polezhaev
557ea4614e VS: Change CMAKE_VS_WINRT_BY_DEFAULT to not implicitly enable WinRT
Original behaviour would unconditionally enable WinRT for all projects
so source file flag generation code can acknowledge WinRT being present
and disable it for C language source files.  An unintentional result of
that approach is that WinRT is enabled for ALL projects, including C++
projects/source files with no way to disable it

Instead use `CMAKE_VS_WINRT_BY_DEFAULT` as a hint that the platform is
WinRT-by-default and set global `CompileAsWinRT` flag to `false` unless
it was explicitly requested by either `WINRT_COMPONENT` option or `/ZW`
compilation option - similar to what Windows Phone/Windows Store
platform logic does

In case WinRT compilation is enabled for a project by either of
aforementioned methods, C language source file override logic will still
kick in and disable CompileAsWinRT for C source files

Fixes: #20063
2019-12-16 13:46:59 -05:00
Brad King
dfbe8109b4 Merge topic 'pch-force-include' into release-3.16
c5c218fa0d PCH: Append pch header file to list of forced include files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4135
2019-12-16 10:04:03 -05:00
Brad King
fe7626da54 Merge topic 'pch-force-include'
c5c218fa0d PCH: Append pch header file to list of forced include files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4135
2019-12-16 10:04:03 -05:00
Vitaly Stakhovsky
d8f1736dcc cmVisualStudio10TargetGenerator: improve XML element generation
When an element is emitted, the newline will be printed first, not last
2019-12-15 10:08:17 -05:00
Vitaly Stakhovsky
c34b4497f8 cmTarget: add std::string overloads 2019-12-14 09:30:28 -05:00
Cristian Adam
c5c218fa0d PCH: Append pch header file to list of forced include files
Fixes: #20088
2019-12-13 15:21:27 +01:00
Brad King
fc99130752 Merge branch 'backport-unity-object-libraries' into unity-object-libraries 2019-12-08 11:21:38 -05:00
Cristian Adam
5ae07e7166 Unity: Generic source file handling for all generators 2019-12-07 15:44:31 +01:00
Brad King
cad199d4b2 Merge topic 'tag-std-string'
64843b1737 cmVisualStudio10TargetGenerator: use std::string for tag

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4026
2019-11-13 09:42:02 -05:00
Brad King
5b46bc3194 Merge topic 'unity-HEADER_FILE_ONLY'
9a5418320e Unity: Don't include sources with HEADER_FILE_ONLY property set

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4023
2019-11-12 09:51:16 -05:00
Cristian Adam
9a5418320e Unity: Don't include sources with HEADER_FILE_ONLY property set
Fixes: #19946
Fixes: #19947
Co-authored-by: Craig Scott <craig.scott@crascit.com>
2019-11-11 14:10:18 +01:00
Vitaly Stakhovsky
64843b1737 cmVisualStudio10TargetGenerator: use std::string for tag 2019-11-10 09:29:27 -05:00
Brad King
b34b4c5eac Merge topic 'vs-vctargetspath'
e7d57bc3c3 VS: Propagate CMAKE_VS_GLOBALS into custom targets
45b4b4b930 VS: Propagate CMAKE_VS_GLOBALS into compiler id projects
548e9051a4 VS: Add support to override VCTargetsPath through toolset
99e83d4235 cmake: Teach --build mode to load CMAKE_GENERATOR_TOOLSET

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3817
2019-10-18 09:01:48 -04:00
Alexander Boczar
548e9051a4 VS: Add support to override VCTargetsPath through toolset
Fixes: #19708
2019-10-15 13:28:45 -04:00
Charly Mourglia
89ff3ee779 VS: Add VS_DOTNET_DOCUMENTATION_FILE property
Add a `VS_DOTNET_DOCUMENTATION_FILE` target property to tell VS
generators to add a `DocumentationFile` setting in `.csproj` files.

Fixes: #19784
2019-10-15 11:44:55 -04:00
Cristian Adam
36ded610af PCH: Generate sources during Compute step 2019-10-09 13:50:25 +02:00
Brad King
83c1657ff7 Unity build: Generate sources during Compute step
The unity build sources need to be added for all generators.  Create
them during `cmGlobalGenerator::Compute` to avoid duplicating the calls
in every generator.  We already handle Qt autogen there too.

Issue: #19789
2019-10-03 14:55:22 -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
b4087a2353 Merge topic 'vs-ReferenceOutputAssembly-conditions'
4dc8c153ec Tests: Teach VSWinStorePhone to verify the content of generated xap
481070a78a Tests: Teach VSWinStorePhone to verify the content of generated appx/msix
acdb326610 VS: Do not reference output assemblies of targets with no output

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3778
2019-09-26 10:43:27 -04:00
Brad King
76ae4c5839 Merge topic 'vs-16.4-custom-commands'
0578239d3a VS: Tell VS 16.4 not to verify SYMBOLIC custom command outputs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3860
2019-09-25 12:39:14 -04:00
Brad King
0578239d3a VS: Tell VS 16.4 not to verify SYMBOLIC custom command outputs
VS 16.4 introduces an additional check on `CustomBuild` rules that warns
if the outputs of the command are not created.  However, CMake supports
marking outputs with the `SYMBOLIC` property to indicate that they will
not actually be generated.  That property is used by Makefile and Ninja
generators but has not been needed by the VS generators before.  Teach
the VS generator to disable `VerifyInputsAndOutputsExist` in custom
build rules that have a symbolic output.

Fixes: #19737
2019-09-24 10:41:20 -04:00
Daniel Eiband
7dcf9cb83c cmGeneratorExpression: Add cmGeneratorExpression::Evaluate utility
cmGeneratorExpression::Evaluate is a shortcut when only the evaluated string is
needed or an instance of cmCompiledGeneratorExpression cannot be cached.

Fixes: #19686
2019-09-23 21:19:15 +02:00
Marc Chevrier
c688b401d3 cmstd: Modernize CMake system headers
Provide a standardized way to handle the C++ "standard" headers
customized to be used with current CMake C++ standard constraints.
Offer under directory `cm` headers which can be used as direct
replacements of the standard ones.  For example:

    #include <cm/string_view>

can be used safely for CMake development in place of the `<string_view>`
standard header.

Fixes: #19491
2019-09-20 10:01:37 -04:00
Vedran Vujinovic
acdb326610 VS: Do not reference output assemblies of targets with no output
Our logic that sets `ReferenceOutputAssembly` in `ProjectReference` has
accumulated a series of conditions for different cases in which the
referenced target has no output.  Simplify the condition to check
`GetManagedType` directly for cases with no output.

This will explicitly turn off `ReferenceOutputAssembly` in
`ProjectReference` for utility (i.e. `add_custom_target`) and special
targets (i.e. `ZERO_CHECK`, etc.), and allowing reference of target
dependencies that produce some output.

Fixes: #19665
2019-09-19 11:47:15 -04:00
Brad King
922482dd3a Merge topic 'cuda_resolve_device_symbols_on_static_lib_collect_deps_properly'
2d7bb13da7 CUDA: static lib device linking computes required static libs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3748
2019-09-09 09:41:32 -04:00
Brad King
ca8c3d64c8 Merge topic 'use-using'
1d3f5ebb0d clang-tidy: Enable check modernize-use-using
a1ddf2d0ba clang-tidy: Replace typedef with using

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3782
2019-09-06 12:38:04 -04:00