689 Commits

Author SHA1 Message Date
Brad King
6618cbf38a Merge topic 'vs-asmlist-dir'
c1fc6c80c7 VS: Place intermediate files in the "ASM List Location" next to objects

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3569
2019-07-19 11:55:48 -04:00
Brad King
c1fc6c80c7 VS: Place intermediate files in the "ASM List Location" next to objects
The `AssemblerListingLocation` setting in VS project files is meant for
intermediate files created during the build much like object files.
When the VS 7 generator was first under development, commit 49aebe6c99
(new arch, 2002-09-04) placed both object files and the ASM list
location in the same directory.  Later commit f9aef0e422 (Generator now
creates a separate intermediate files directory for each target,
2005-07-27) moved the object files to a per-target directory but the
ASM list location was not moved with them.  Move it now.

Fixes: #19480
2019-07-18 11:40:58 -04:00
Marc Chevrier
d9b2c7dae2 Introduce memory management helper: cm_memory.hxx 2019-07-14 15:37:30 +02:00
Brad King
609d86e813 Merge topic 'object-library-sbcs'
54290adcba VS: Fix SBCS support for object libraries

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3537
2019-07-12 07:22:55 -04:00
Brad King
54290adcba VS: Fix SBCS support for object libraries
In commit 3a53005f7d (Build object library targets in VS, 2012-03-12,
v2.8.8~29^2~13) we updated the condition for unicode but accidentally
left out the SBCS case support for object libraries.

Fixes: #19469
2019-07-12 07:20:23 -04:00
Brad King
71fbebd1dc IWYU: Fix handling of <memory> standard header
An old workaround for `std::allocator_traits<>::value_type` lints from
IWYU on `std::vector<>` usage breaks IWYU's handling of `<memory>`.
Convert the workaround to use the same approach we already use for a
workaround of `std::__decay_and_strip<>::::__type` lints.  Then update
the `<memory>` inclusions to follow the now-correct IWYU lints.
2019-07-10 11:48:56 -04:00
Brad King
41acd44625 Merge topic 'cuda-no-device-link-when-disabled'
a4d502a5bf CUDA: Do not device link if CUDA is not an enabled language

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3491
2019-07-02 08:36:56 -04:00
Robert Maynard
a4d502a5bf CUDA: Do not device link if CUDA is not an enabled language
Checks added in commit 81b4d10d8f (CUDA: More exhaustive checks to
determine when to do device linking, 2019-05-09, v3.15.0-rc1~82^2)
assumed that CUDA properties would be set only if CUDA is enabled.

We cannot do a device link step if we do not have the CUDA language
enabled.  This was discovered as some projects unconditionally set CUDA
properties such as `CUDA_RESOLVE_DEVICE_SYMBOLS` even when the CUDA
language has not been enabled.

Fixes: #19432
2019-07-01 08:29:10 -04:00
Brad King
3327fe948e Merge topic 'vs-dpi-aware'
cd92f8f8bf VS: Add VS_DPI_AWARE target property

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3418
2019-06-27 08:56:41 -04:00
Brad King
6ddc0b4438 Merge topic 'cuda-msvc-runtime-library'
8fbd25772f CUDA: Implement MSVC runtime library abstraction
07807a2006 VS: Use AddLanguageFlags to de-duplicate CMAKE_{CUDA,ASM*}_FLAGS lookup

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3485
2019-06-27 07:30:01 -04:00
Matt Weir
cd92f8f8bf VS: Add VS_DPI_AWARE target property
Enables setting the visual studio project property for Manifests,
controlling the DPI Aware setting.
2019-06-26 09:55:49 -04:00
Brad King
07807a2006 VS: Use AddLanguageFlags to de-duplicate CMAKE_{CUDA,ASM*}_FLAGS lookup
Apply the refactoring from commit 707283981f (VS: Use AddLanguageFlags
to de-duplicate CMAKE_<LANG>_FLAGS* lookup, 2019-04-01,
v3.15.0-rc1~300^2) to the CUDA, ASM_MASM, and ASM_NASM languages too.
In particular, CUDA needs the MSVC runtime library selection logic
in the `AddLanguageFlags` method that is used by other generators.
2019-06-26 08:36:48 -04:00
Wil Stark
7035bdeb52 VS10Generator: add project properties to enable WindowsCE deployment.
Fixes: #19408
2019-06-19 15:11:57 -07:00
Sebastian Holtermann
8d934d861b cmPropertyMap: Make std::map container private 2019-06-08 12:25:35 +02:00
Brad King
187928875d Merge topic 'vs-add-package-reference'
42e14d90b1 VS: Added support for VS package references for nuget

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Leonid Pospelov <pospelovlm@yandex.ru>
Merge-request: !3389
2019-05-31 13:18:31 -04:00
Brad King
82fec3784b Merge topic 'vs-depends-dedup'
42bc67bd43 VS: De-duplicate custom command dependencies
d03a6fc857 VS: Clarify name of custom commands AdditionalInputs variable
fcedf8e552 VS: Isolate custom command input/output generation scopes

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3388
2019-05-31 09:04:47 -04:00
Frans van Dorsselaer
42bc67bd43 VS: De-duplicate custom command dependencies
Avoid listing the same input more than once in custom commands generated
in `.vcxproj` and `.csproj` files.  In the case of a `.vcxproj` file
additionally avoid listing the source to which the command is attached
since it is already implicitly a dependency.

This is a nice cleanup and also works around a VS 2019 16.1 regression
in MSBuild dependency checking.  Starting with that version, MSBuild now
re-builds custom commands when the list of dependencies has changed.
However, its check is confused by duplicate dependencies.
De-duplicating them avoids this problem.

Co-Author: Brad King <brad.king@kitware.com>
Fixes: #19303
2019-05-30 13:57:03 -04:00
Frans van Dorsselaer
d03a6fc857 VS: Clarify name of custom commands AdditionalInputs variable 2019-05-30 13:57:03 -04:00
Brad King
fcedf8e552 VS: Isolate custom command input/output generation scopes 2019-05-30 13:57:03 -04:00
Kinan Mahdi
42e14d90b1 VS: Added support for VS package references for nuget 2019-05-30 10:22:44 -04:00
Brad King
fc4cbbc2a5 Merge topic 'remove_unneeded_device_link_calls'
81b4d10d8f CUDA: More exhaustive checks to determine when to do device linking
3205c7c950 cmNinjaLinkLineDeviceComputer now lives in the correct source file

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3320
2019-05-22 10:30:00 -04:00
Robert Maynard
81b4d10d8f CUDA: More exhaustive checks to determine when to do device linking
Previously CMake used fairly naive logic to determine when to do
device linking which caused unnecessary device linking to occur
frequently. We now use a more exhaustive algorithm to determine
when we have a need for device linking.

Fixes: #19238
2019-05-21 11:40:07 -04:00
Brad King
639e14def6 VS: Factor out helper to compute ApplicationTypeRevision
This is the first two components of `CMAKE_SYSTEM_VERSION`.
2019-05-21 08:50:01 -04:00
Vitaly Stakhovsky
23e8364aed Source: std::string related cleanup 2019-05-15 10:20:05 -04:00
Brad King
2d37678226 Merge topic 'vs-project-import'
d145d72e70 VS: add target property VS_PROJECT_IMPORT_<propspath>

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3143
2019-04-16 13:43:52 -04:00
Leonid Pospelov
d145d72e70 VS: add target property VS_PROJECT_IMPORT_<propspath>
Fixes: #18998
2019-04-15 13:05:07 -04:00
Leonid Pospelov
3e70a8d0df cmVisualStudio10TargetGenerator: Simplify code of two functions 2019-04-12 18:24:21 +03:00
Leonid Pospelov
e10b04ef05 cmVisualStudio10TargetGenerator: Use count instead of find 2019-04-12 18:22:00 +03:00
Leonid Pospelov
2418a5aec0 cmVisualStudio10TargetGenerator: Remove uses of const_cast 2019-04-12 18:20:07 +03:00
Brad King
707283981f VS: Use AddLanguageFlags to de-duplicate CMAKE_<LANG>_FLAGS* lookup 2019-04-02 14:23:46 -04:00
Sebastian Holtermann
db182eb160 cmTarget: Move member *Commands to impl 2019-03-23 22:22:34 +01:00
Brad King
591fab8a6a Merge topic 'vs-explicit-newline'
0bf4418017 VS: Encode newlines in XML attributes

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3065
2019-03-07 09:15:57 -05:00
Luca Cappa
0bf4418017 VS: Encode newlines in XML attributes
Encode `\n` as `&#10;` to avoid generating a literal newline inside an
XML attribute.  This is more readable and also fixes custom commands in
`.csproj` files with VS 2019 RC.

Fixes: #19001
2019-03-06 09:37:21 -05:00
Vitaly Stakhovsky
9dd255548d cmSystemTools::Error: consolidate parameters into single std::string 2019-02-20 11:18:11 -05:00
Vitaly Stakhovsky
0281f9a4ca cmMakefile::ConfigureFile: Accept std::string parameters 2019-02-18 20:48:19 -05:00
Saleem Abdulrasool
fc8b90af2c Create and use cmGeneratorTarget::Names
Rather than taking a number of out parameters for the various names,
create a structure that is reused for both `GetLibraryNames` and
`GetExecutableNames`.  Replace uses according to the new interface.
2019-02-11 10:44:24 -08:00
Robert Maynard
850ef90a66 CUDA: Honor CUDA_RESOLVE_DEVICE_SYMBOLS for more target types
`CUDA_RESOLVE_DEVICE_SYMBOLS` can be used with shared, module, and
executable target types.  This relaxation is to allow for better
interoperability with linkers that automatically do CUDA device symbol
resolution and have no way to disable it.
2019-02-05 11:09:48 -05:00
Brad King
a5ec7f868f Merge topic 'vs-wince-deployment'
f5d72be57a VS: Fix deployment for WinCE projects

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2907
2019-02-04 07:49:01 -05:00
Wil Stark
f5d72be57a VS: Fix deployment for WinCE projects
Fixes: #18868
2019-02-01 13:59:09 -05:00
Gilles Khouzam
cff026dbc0 VS: Fix WinRT component references
WinRT components need to be referenced in a similar way that managed
code libraries are referenced.  Validate that the library reference is a
WinRT component and reference it through the project.

Add test coverage for `VS_WINRT_COMPONENT`.  While at it, fix the IOT
reference failing on Win10 SDK 17763 which doesn't include it anymore.

Fixes: #18846
2019-02-01 13:04:52 -05:00
Bruno Manganelli
b6a957c969 cmOutputConverter: move ConvertToRelativePath to cmStateDirectory. 2019-01-27 15:48:57 +00:00
Brad King
bd3685b6cf Merge topic 'vs-debug-utility-targets'
22b43b0009 VS: Add support for VS_DEBUGGER_* properties on custom targets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2794
2019-01-17 11:07:11 -05:00
Brad King
9e3e93fc6f Merge topic 'fix_csharp_defines'
a541d113e6 VS: Honor target_compile_definitions for C# projects

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2809
2019-01-17 11:06:04 -05:00
Nils Gladitz
22b43b0009 VS: Add support for VS_DEBUGGER_* properties on custom targets
Visual studio itself supports the corresponding `LocalDebugger*`
properties on utility targets; support generating them from CMake as
well.
2019-01-16 10:21:01 -05:00
Bruno Manganelli
cc2a5261f8 Factor out enum MessageType into dedicated header
Reduce the number of files relying on `cmake.h`.
2019-01-16 08:16:31 -05:00
Wil Stark
a541d113e6 VS: Honor target_compile_definitions for C# projects
Fixes: #18698
2019-01-15 21:29:59 -08:00
Brad King
d7835e4d0e Merge topic 'fix-source-group-CMakeLists.txt'
77303314dc Restore support for a custom source group for CMakeLists.txt

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2803
2019-01-15 13:20:01 -05:00
Brad King
77303314dc Restore support for a custom source group for CMakeLists.txt
Since commit v3.11.0-rc1~467^2 (VS,Xcode: Add CMakeLists.txt sources
without mutating targets, 2017-10-18) we do not add `CMakeLists.txt` to
target sources but instead generate references to them directly.  This
accidentally dropped generation of the `.vcxproj.filters` entry for a
source group in which `CMakeLists.txt` is the only member.

Fixes: #18795
2019-01-14 08:43:30 -05:00
Wil Stark
5b1364a2e3 cmVisualStudio10TargetGenerator: Fix .NET Compact Framework projects.
Fixes: #18672
2019-01-11 09:08:55 -08:00
Wil Stark
5e4887e673 VS: Honor WinCE deployment properties in VS 2010+
Previously only VS 2008 was supported.
2019-01-10 13:06:25 -05:00