summaryrefslogtreecommitdiffstats
path: root/Source/cmVisualStudio10TargetGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* VS: Don't compute CUDA options unless necessaryRaul Tambre2020-10-271-2/+4
| | | | | | | | | | | | | | | | | | In the following scenario (with 3.18 policies): 1. A CXX target is created. 2. CUDA language is enabled. CMake 3.18 introduced CMP0104, which requires CUDA_ARCHITECTURES to be set. Because the CXX target was created before CUDA was enabled it wouldn't have it set. The Visual Studio generator would however end up computing CUDA compile options for the CXX target, which would result in a fatal error due to the policy violation. There doesn't seem to be a reason to do this for targets that don't actually use the CUDA language, so we can skip and generate the CXX target just fine. Fixes: #21341
* VS: Fix regression in C# source linksKinan Mahdi2020-10-051-1/+8
| | | | | | Fix logic used since commit ac6b18cd90 (CSharp: Add support for source groups with out-of-source builds, 2020-02-18, v3.18.0-rc1~645^2). Add a check of the physical file location for C# source groups.
* VS: Restore toleration of target-wide -TP flag with MSVCBrad King2020-07-231-0/+6
| | | | | | | | | | | | | | Since commit 3b547e2e4b (VS: Simplify logic adding source file C/C++ language flag to MSVC, 2020-05-15, v3.18.0-rc1~139^2~1) we only add a per-source language selection flag when the source file extension does not match the compiler's default. This approach breaks when a project adds a target-wide `-TP` flag. Although such projects likely did not work with non-VS generators, we did support them before in Visual Studio generators. Add a special case to tolerate such flags again. Fixes: #21005
* VS: Restore compilation of '.C' sources as C++Brad King2020-06-111-3/+6
| | | | | | | | | Refactoring in commit 3b547e2e4b (VS: Simplify logic adding source file C/C++ language flag to MSVC, 2020-05-15, v3.18.0-rc1~139^2~1) failed to account for MSVC's treatment of `.C` extensions as C. Add this special case to the logic to restore use of `-TP` for `.C` extensions. Fixes: #20822
* VS: Use StdOutEncoding for VS 16.7 Preview 3 and aboveJustin Goshi2020-06-031-5/+5
| | | | | | | | | | | | | | | | | VS 16.6 added a `StdOutEncoding` setting for custom commands to tell MSBuild that the output is encoded as UTF-8. In commit bc877a7e94 (Add support to indicate UTF-8 custom command pipe output encoding, 2020-04-08) CMake learned to add the setting in anticipation of the VS 16.6 release. However, when 16.6 was released it had a bug in the implementation of custom tasks with StdOutEncoding enabled that was exposed by our test suite. In commit 5058fb5401 (VS: Drop StdOutEncoding with VS 16.6 pending investigation, 2020-05-29) we disabled the setting pending investigation. The problem is fixed in VS 16.7 Preview 3, so restore use of the setting when a VS instance of at least that version is detected. Fixes: #20769
* VS: Drop StdOutEncoding with VS 16.6 pending investigationBrad King2020-05-291-2/+5
| | | | | | | | | The `StdOutEncoding` added to `.vcxproj` files since commit bc877a7e94 (Add support to indicate UTF-8 custom command pipe output encoding, 2020-04-08) breaks custom commands with symbolic outputs on VS 16.6.0. Disable it pending further investigation and possibly a fix in VS. Issue: #20769
* CUDA: Move VS CudaRuntime selection to be with rest of CUDA optionsBrad King2020-05-221-4/+11
|
* VS: Simplify logic adding source file C/C++ language flag to MSVCBrad King2020-05-181-21/+7
| | | | | | 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.
* VS: Compute managed type from an existing configurationBrad King2020-05-181-1/+2
| | | | | | It is not clear how multiple configurations should be handled here, but using an existing configuration is at least better than the empty configuration.
* VS: Write custom commands for sources from all configurationsBrad King2020-05-181-8/+14
|
* cmVisualStudio10TargetGenerator: Adopt Windows Store and Phone infrastructureBrad King2020-05-181-66/+94
| | | | | Move support for Resx, Xaml, Certificate, and AppManifest file handling out of cmGeneratorTarget.
* Merge topic 'vs-pch-compile-opts'Brad King2020-05-121-1/+1
|\ | | | | | | | | | | | | 6b2fb4ffd2 VS: Fix using PCH from source with COMPILE_OPTIONS Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4734
| * VS: Fix using PCH from source with COMPILE_OPTIONSBrad King2020-05-111-1/+1
| | | | | | | | | | | | | | If a source file gets per-source flags from both PCH and custom `COMPILE_OPTIONS`, combine them correctly. Fixes: #20694, #20456
* | GetSafeProperty: return std::string const&Vitaly Stakhovsky2020-04-301-1/+1
| |
* | cmGeneratorTarget::GetProperty: return cmPropVitaly Stakhovsky2020-04-291-130/+120
| |
* | VS: Add option for per-target PlatformToolsetJulien Jemine2020-04-291-2/+8
| | | | | | | | | | | | | | | | | | 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
* | CUDA: Device linking use now link optionsMarc Chevrier2020-04-191-6/+16
| | | | | | | | | | | | | | | | | | | | 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
* | Refactoring: add cm::contains to <cmext/algorithm>Marc Chevrier2020-04-171-4/+4
| |
* | Merge topic 'cmprop-source'Brad King2020-04-151-56/+58
|\ \ | | | | | | | | | | | | | | | | | | | | | e64fa5f1b6 cmSourceFile::GetProperty: return cmProp fc223f9860 cmGlobalXCodeGenerator: Fix genex interpreter overloads Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4603
| * | cmSourceFile::GetProperty: return cmPropVitaly Stakhovsky2020-04-141-56/+58
| | |
* | | Add support to indicate UTF-8 custom command pipe output encodingJustin Goshi2020-04-131-0/+14
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | cmLocalGenerator: Convert GetStaticLibraryFlags to take original-case configBrad King2020-04-011-3/+2
| | | | | | | | Move upper-case conversion of the configuration into the implementation.
* | cmTarget::GetProperty: return cmPropVitaly Stakhovsky2020-03-301-7/+7
| |
* | Merge topic 'vs-non-built-file-item-metadata'Brad King2020-03-301-93/+146
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | VS: Add VS_SOURCE_SETTINGS_<tool> target propertyMatt Davies2020-03-201-0/+16
| | | | | | | | | | | | | | | | | | | | | 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.
| * | VS: Add VS_SETTINGS source file propertyMatt Davies2020-03-201-2/+32
| | | | | | | | | | | | | | | | | | 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.
| * | VS: Use unordered_map to write HLSL settings.Matt Davies2020-03-201-93/+100
| | |
* | | VS10Generator: avoid many string allocationsRolf Eike Beer2020-03-241-46/+36
| | |
* | | replace "std::string::find(x) == 0" with cmHasPrefix()Rolf Eike Beer2020-03-231-10/+11
|/ /
* | cmPropertyMap: Introduce cmProp as return type for GetProperty() functionsVitaly Stakhovsky2020-03-131-2/+2
| | | | | | | | | | | | | | 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.
* | CSharp: Add support for source groups with out-of-source buildsKinan Mahdi2020-02-281-83/+46
| | | | | | | | | | | | | | This also fixes support for multiple sources of the same name in different directories. Add a test for both problems. Issue: #19505
* | Merge branch 'backport-3.16-link-line-backtrace'Brad King2020-02-101-8/+8
|\ \ | |/
| * Propagate backtraces from LINK_LIBRARIES through to link line itemsBrad King2020-02-101-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Merge topic 'vs-version-for-unity' into release-3.16Brad King2020-02-051-7/+3
| |\ | | | | | | | | | | | | | | | | | | 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
| * \ Merge topic 'vs-16.4-custom-command-inputs' into release-3.16Brad King2020-01-291-1/+7
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | 58b0674687 VS: Tell VS 16.4 not to verify SYMBOLIC custom command inputs Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4297
* | \ \ Merge topic 'vs-version-for-unity'Brad King2020-02-051-7/+3
|\ \ \ \ | | |_|/ | |/| | | | | | | | | | | | | | | | | | 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
| * | | VS: Do not use native unity builds on VS 2017 versions less than 15.8Brad King2020-02-041-7/+3
| |/ / | | | | | | | | | | | | | | | | | | | | | 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
| * | Merge topic 'pch-force-include' into release-3.16Brad King2019-12-161-0/+3
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | c5c218fa0d PCH: Append pch header file to list of forced include files Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4135
* | \ \ Merge topic 'vs-16.4-custom-command-inputs'Brad King2020-01-291-1/+7
|\ \ \ \ | | |_|/ | |/| | | | | | | | | | | | | | | | | | 58b0674687 VS: Tell VS 16.4 not to verify SYMBOLIC custom command inputs Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4297
| * | | VS: Tell VS 16.4 not to verify SYMBOLIC custom command inputsBrad King2020-01-281-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Merge topic 'cuda_runtime_library_controls'Brad King2020-01-281-12/+1
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 0d0145138f CUDA: Add abstraction for cuda runtime selection Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4178
| * | | | CUDA: Add abstraction for cuda runtime selectionRobert Maynard2020-01-271-12/+1
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | Merge topic 'csharp-no-valued-macros'Brad King2020-01-271-0/+4
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | effd4d0569 CSharp: Do not pass definitions with values Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4267
| * | | | | CSharp: Do not pass definitions with valuesSumit Bhardwaj2020-01-241-0/+4
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Microsoft C# tooling does not accept definitions with values. Filter them out. Fixes: #19817
* | | | | VS: Add support for .NET Standard and .NET CoreJoerg Bornemann2020-01-241-17/+30
|/ / / / | | | | | | | | | | | | Fixes: #20105
* | | | Merge topic 'fix-vs-winrt-by-default'Brad King2019-12-171-5/+4
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | | VS: Change CMAKE_VS_WINRT_BY_DEFAULT to not implicitly enable WinRTPetr Polezhaev2019-12-161-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | | Merge topic 'vs-xml-improve'Brad King2019-12-171-12/+6
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | d8f1736dcc cmVisualStudio10TargetGenerator: improve XML element generation Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4140
| * | | | | cmVisualStudio10TargetGenerator: improve XML element generationVitaly Stakhovsky2019-12-151-12/+6
| |/ / / / | | | | | | | | | | | | | | | When an element is emitted, the newline will be printed first, not last
* | | | | Merge topic 'stdstring-target'Brad King2019-12-171-2/+2
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | c34b4497f8 cmTarget: add std::string overloads Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4137