119 Commits

Author SHA1 Message Date
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
d03a6fc857 VS: Clarify name of custom commands AdditionalInputs variable 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
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
2418a5aec0 cmVisualStudio10TargetGenerator: Remove uses of const_cast 2019-04-12 18:20:07 +03:00
Regina Pfeifer
b05b778a2d clang-tidy: Use = delete 2019-01-29 14:09:21 -05: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
Vitaly Stakhovsky
1601388212 cmVisualStudio10TargetGenerator: Code improvement
Disallow incompletely initialized Elem objects
2018-10-14 18:32:53 -04:00
Brad King
bb60ed6e72 VS: Add flag table entry for -Qspectre
Add special logic to map this flag to a top-level build setting
instead of being in ClCompile.

Fixes: #18426
2018-10-08 14:03:39 -04:00
Niels Dekker
567fabe88e IPO: INTERPROCEDURAL_OPTIMIZATION (LTCG) for Visual Studio
Add IPO support for Visual Studio (which is referred to by VS as
"Link Time Code Generation" and "Whole Program Optimization"), for
VS version >= 10.  This allows CMake/VS users to enable IPO by setting
property `INTERPROCEDURAL_OPTIMIZATION`.

Fixes: #16748
2018-09-17 10:53:10 -04:00
Vitaly Stakhovsky
790fc415b1 cmVisualStudio10TargetGenerator: remove BuildFileStream member
Stream object is now local to `Generate()`
2018-05-16 12:59:00 -04:00
Vitaly Stakhovsky
b88e138369 cmVisualStudio10TargetGenerator: minor code cleanup 2018-05-11 10:05:51 -04:00
Vitaly Stakhovsky
a2b5acec3b cmVisualStudio10TargetGenerator: refactor
`WritePlatformConfigTag` moved to local `Elem` class; other improvements
2018-05-09 08:04:34 -04:00
Brad King
f60e2eb3c5 Merge topic 'vs-improve-options'
e76a0c6071 VS: improve options generation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2044
2018-05-08 08:36:57 -04:00
Vitaly Stakhovsky
e76a0c6071 VS: improve options generation
Make use of the `Elem` and `OptionsHelper` classes; some cleanup
2018-05-05 17:35:37 -04:00
Mark Ingram
5cc195f1f4 VS Generator: Only include default certificate if it was actually copied 2018-05-04 18:10:10 +01:00
Vitaly Stakhovsky
3f315dc128 cmVisualStudio10TargetGenerator: XML refactoring 2018-05-04 10:46:11 -04:00
Vitaly Stakhovsky
4465a27882 cmVisualStudio10TargetGenerator: XML refactoring 2018-04-26 13:45:29 -04:00
Brad King
e52cf1034f Merge topic 'csharp_reference_imported_targets'
de549083e3 cmVisualStudio10TargetGenerator: warn if /clr flag is set manually
59ec7d50bd cmVisualStudio10TargetGenerator: fix for backward compatibility
663f5120f4 cmGlobalVisualStudioGenerator: remove TargetCanBeReferenced()
359544a907 add tests for using target_link_libraries() with imported managed targets
43571073e0 cmVisualStudio10TargetGenerator: store managed reference information in maps
16fec7e2fc cmVisualStudio10TargetGenerator: make some methods config aware
f3c6828876 cmVisualStudio10TargetGenerator: /clr compatible flags for managed tgt
f9042d807d remove TargetIsCSharpOnly() and use methods from cmGeneratorTarget
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1805
2018-04-26 08:55:19 -04:00
Brad King
5858267df6 Merge topic 'vs-refactor-xml'
dfff12c808 VS: Add Elem::Content() helper and usage demo
1f29777798 cmVisualStudio10TargetGenerator: refactoring (continued)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2005
2018-04-26 08:36:44 -04:00
Vitaly Stakhovsky
dfff12c808 VS: Add Elem::Content() helper and usage demo 2018-04-26 08:35:43 -04:00
Vitaly Stakhovsky
1f29777798 cmVisualStudio10TargetGenerator: refactoring (continued) 2018-04-24 12:01:19 -04:00
Michael Stürmer
43571073e0 cmVisualStudio10TargetGenerator: store managed reference information in maps 2018-04-24 07:05:14 +02:00
Michael Stürmer
16fec7e2fc cmVisualStudio10TargetGenerator: make some methods config aware 2018-04-23 07:31:23 +02:00
Fujii Hironori
f59c33a763 VS: Generate a custom command only in the least dependent target
If a custom command is assigned to multiple targets, generate the build
rule only in the least-dependent `.vcxproj` file.  Otherwise MSBuild
will run the command on the first build of a dependent target even if
its dependencies already brought the command up to date (in order to
populates its build log).

Generate targets in least-to-most-dependent order, and assign a custom
command to the least dependent target.

Added cmLocalVisualStudio10Generator::GenerateTargetsDepthFirst to call
cmVisualStudio10TargetGenerator::Generate in least-dependent order.

Moved SourcesVisited from cmVisualStudio10TargetGenerator to
cmLocalVisualStudio10Generator to avoid attaching a custom command to
multiple targets among the local generator.

Fixes: #16767
2018-04-23 13:31:28 +09:00
Fujii Hironori
d58d4daa6b cmVisualStudio10TargetGenerator: Use cmLocalVisualStudio10Generator
Change the type of a member variable `LocalGenerator` from
`cmLocalVisualStudio7Generator` to `cmLocalVisualStudio10Generator`.
2018-04-17 11:03:17 +09:00
Brad King
607b0ac2f3 Merge topic 'minor-cleanups'
acda926a04 Replace some uses of sprintf with std::to_string
418541035f cmCTestCurl: Fix UploadFile declared parameter names
1519628e60 cmVisualStudio10TargetGenerator: Make NsightTegraVersion unsigned
2f87d00803 cmMacroCommand: Fix format string to match type of argument
b0676cc5d4 Add in-class initialization of some members
966dba5b68 cmAlgorithms: Remove unnecessary typename keyword
12a145534a gitignore: Ignore a .vs directory in the source tree

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1932
2018-04-06 10:29:38 -04:00
jrp2014
1519628e60 cmVisualStudio10TargetGenerator: Make NsightTegraVersion unsigned
It's used in unsigned contexts, such as with format strings.
2018-04-05 13:42:49 -04:00
Vitaly Stakhovsky
30bbb4f2ac cmVisualStudio10TargetGenerator: extend DOM-like generation
The local Elem class is extended with more XML-generating functions.
WriteGroups() is rewritten to use these new functions,
avoiding BuildFileStream.
2018-03-30 22:55:30 -04:00
Vitaly Stakhovsky
80767dd50e VS: Simplify XML code
Get rid of suffix arguments
2018-03-27 17:39:19 -04:00
Vitaly Stakhovsky
a0d9429bd7 cmVisualStudioGeneratorOptions: Move XML code to subclasses 2018-03-26 09:35:58 -04:00
Vitaly Stakhovsky
a74d5a5c8b cmVisualStudio10TargetGenerator: improved XML nesting
Introduce an `Elem` helper class to track XML element state.  This
simplifies code in a few places, particularly OutputSourceSpecificFlags.
2018-03-16 08:50:19 -04:00
Vitaly Stakhovsky
59d8cfb85e cmVisualStudio10TargetGenerator: Use helpers for XML tags
Make the XML generating code smaller, more structured, and less
error-prone.  This is a step towards future XML refactoring.
2018-03-07 08:51:30 -05:00
Vitaly Stakhovsky
b723fe3d7d VS: Convert loops to C++11, other C++ improvements 2018-02-21 21:18:59 -05:00
Vitaly Stakhovsky
b721b9a381 cmVisualStudio10TargetGenerator: Make some data members const; simplify 2018-02-05 19:50:54 -05:00
Vitaly Stakhovsky
6d148d6d53 cmVisualStudio10TargetGenerator: Limit scope of ConvertToWindowsSlash()
It is no longer used outside this class, so its scope can be limited to file.
2018-02-01 19:09:34 -05:00
Marc Chevrier
3073bd1f3d VisualStudio generators: refactoring
Uniformize include directories handling.
Fix memory leaks in class cmVisualStudio10TargetGenerator:
OptionsMap uses now std::unique_ptr.
2018-01-23 10:25:03 +01:00
Brad King
506fda1cf0 Genex: Enable COMPILE_LANGUAGE for INCLUDE_DIRECTORIES with VS and Xcode
The set of compile flags used for a target's C and C++ sources is based
on the linker language.  By default this is always the C++ flags if any
C++ sources appear in the target, and otherwise the C flags.  Therefore
we can define the `COMPILE_LANGUAGE` generator expression in
`INCLUDE_DIRECTORIES` to match the selected language.

This is not exactly the same as for other generators, but is the best VS
and Xcode can do.  It is also sufficient for many use cases since the
set of include directories for C and C++ is frequently similar but may
be distinct from those for other languages like CUDA.

Fixes: #17435
2018-01-12 14:27:37 -05:00
Brad King
c2f79c9867 Genex: Enable COMPILE_LANGUAGE for COMPILE_DEFINITIONS with VS and Xcode
The set of compile flags used for a target's C and C++ sources is based
on the linker language.  By default this is always the C++ flags if any
C++ sources appear in the target, and otherwise the C flags.  Therefore
we can define the `COMPILE_LANGUAGE` generator expression in
`COMPILE_DEFINITIONS` to match the selected language.

This is not exactly the same as for other generators, but is the best VS
and Xcode can do.  It is also sufficient for many use cases since the
set of definitions for C and C++ is frequently similar but may be
distinct from those for other languages like CUDA.

Issue: #17435
2018-01-12 14:27:37 -05:00
Brad King
0795d25b78 cmVisualStudio10TargetGenerator: Factor out include dir computation 2018-01-11 15:03:02 -05:00
Daniel Pfeifer
ca2233e31f IWYU: Mark cmConfigure.h with pragma: keep
Also remove `#include "cmConfigure.h"` from most source files.
2017-08-26 07:41:04 +02:00
Michael Stürmer
ec409a116f Vs: fix CSharp custom command by introducing inline MSBuild <Targets>s
The custom command implementation is based on the Microsoft support article:

https://docs.microsoft.com/en-us/visualstudio/msbuild/how-to-extend-the-visual-studio-build-process

Fixes: #16960
2017-06-22 21:40:48 +02:00
Michael Stürmer
dcdab5cf23 Vs: factor out computation of <Link> tag for CSharp source files 2017-06-22 21:39:37 +02:00
Michael Stürmer
0a8f469af9 Vs: refactor WriteCustomRule for preparation of CSharp support 2017-06-22 16:52:37 +02:00
Brad King
f3ffd18ab6 Merge topic 'vs_csharp_prop_for_all_extensions'
c90630c5 Vs: add support for VS_CSHARP_* target property for additional file extensions

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !961
2017-06-15 10:22:12 -04:00
Michael Stürmer
07ec212ae8 VS: add target property VS_DOTNET_REFERENCEPROP_<refname>_TAG_<tagname>
Fixes: #16689
2017-06-13 10:46:31 -04:00
Michael Stürmer
c90630c501 Vs: add support for VS_CSHARP_* target property for additional file extensions
Fixes: #16726
2017-06-13 16:04:22 +02:00
Robert Maynard
a36fb229ba CUDA: Visual Studio now properly delays device linking 2017-04-26 11:41:22 -04:00