774 Commits

Author SHA1 Message Date
Brad King
5c7ca6f8a8 CUDA: Move VS CudaRuntime selection to be with rest of CUDA options 2020-05-22 08:15:37 -04:00
Brad King
3b547e2e4b VS: Simplify logic adding source file C/C++ language flag to MSVC
Do not add a target-wide language flag.  We need a flag on an individual
source file to explicitly specify the C or C++ language if and only if
the source file extension does not imply it.
2020-05-18 15:34:17 -04:00
Brad King
27ead9d4b7 VS: Compute managed type from an existing configuration
It is not clear how multiple configurations should be handled here, but
using an existing configuration is at least better than the empty
configuration.
2020-05-18 15:34:15 -04:00
Brad King
1222327c89 VS: Write custom commands for sources from all configurations 2020-05-18 15:33:16 -04:00
Brad King
65fe58a4b4 cmVisualStudio10TargetGenerator: Adopt Windows Store and Phone infrastructure
Move support for Resx, Xaml, Certificate, and AppManifest file handling
out of cmGeneratorTarget.
2020-05-18 12:56:56 -04:00
Brad King
eb2a554b12 Merge topic 'vs-pch-compile-opts'
6b2fb4ffd2 VS: Fix using PCH from source with COMPILE_OPTIONS

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4734
2020-05-12 06:53:41 -04:00
Brad King
6b2fb4ffd2 VS: Fix using PCH from source with COMPILE_OPTIONS
If a source file gets per-source flags from both PCH and custom
`COMPILE_OPTIONS`, combine them correctly.

Fixes: #20694, #20456
2020-05-11 11:58:41 -04:00
Vitaly Stakhovsky
53675adbcf GetSafeProperty: return std::string const& 2020-04-30 10:27:16 -04:00
Vitaly Stakhovsky
36aba01223 cmGeneratorTarget::GetProperty: return cmProp 2020-04-29 10:59:39 -04:00
Julien Jemine
197b4cbe18 VS: Add option for per-target PlatformToolset
Add a `VS_PLATFORM_TOOLSET` target property to set `PlatformToolset` in
the `.vcxproj` file for specific targets.  Document that this is safe
only when the named toolset uses the same underlying compiler as the
primary toolset.

Fixes: #17429
2020-04-29 07:35:57 -04:00
Marc Chevrier
4248bb452a CUDA: Device linking use now link options
properties LINK_OPTIONS and INTERFACE_LINK_OPTIONS are propagated
to the device link step.

To control which options are selected for normal link and device link steps,
the $<DEVICE_LINK> and $<HOST_LINK> generator expressions can be used.

Fixes: #18265
2020-04-19 15:53:11 +02:00
Marc Chevrier
aacd4e4a90 Refactoring: add cm::contains to <cmext/algorithm> 2020-04-17 10:00:03 +02:00
Brad King
156196938c Merge topic 'cmprop-source'
e64fa5f1b6 cmSourceFile::GetProperty: return cmProp
fc223f9860 cmGlobalXCodeGenerator: Fix genex interpreter overloads

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4603
2020-04-15 09:49:46 -04:00
Vitaly Stakhovsky
e64fa5f1b6 cmSourceFile::GetProperty: return cmProp 2020-04-14 10:57:17 -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
Brad King
25a920e827 cmLocalGenerator: Convert GetStaticLibraryFlags to take original-case config
Move upper-case conversion of the configuration into the implementation.
2020-04-01 10:55:59 -04:00
Vitaly Stakhovsky
3eec21a01c cmTarget::GetProperty: return cmProp 2020-03-30 15:00:14 -04:00
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