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

791 Commits

Author SHA1 Message Date
Brad King
6a55c8c603 Merge topic 'vs-cuda-no-host-includes'
543b6826ee VS: Avoid duplication of CUDA include directories

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2158
2018-06-20 09:46:58 -04:00
Brad King
543b6826ee VS: Avoid duplication of CUDA include directories
We already place all include directories for CUDA inside `CudaCompile`
so we do not need to use any from `ClCompile`.  Tell `CudaCompile`
not to use the host compiler's include directory settings.

Fixes: #18101
2018-06-20 09:44:18 -04:00
Jon Chronopoulos
797de7a6f6 VS10Project: Expand VS_DEBUGGER_* capabilities
This adds VS_DEBUGGER_COMMAND_ARGUMENTS and VS_DEBUGGER_ENVIRONMENT as
well as allowing VS_DEBUGGER_* to use generator expressions.
2018-06-17 17:55:27 +10:00
Marc Chevrier
c1f5a44b28 LINK_OPTIONS: Add new family of properties
This family enable to manage link flags

Three new properties:
* directory property: LINK_OPTIONS
* target properties: LINK_OPTIONS and INTERFACE_LINK_OPTIONS

Two new commands
* add_link_options(): to populate directory property
* target_link_options(): to populate target properties

Fixes: #16543
2018-06-06 17:22:39 +02:00
Kitware Robot
d7204e649e Revise C++ coding style using clang-format-6.0
Run the `clang-format.bash` script to update all our C and C++ code to a
new style defined by `.clang-format`.  Use `clang-format` version 6.0.

* If you reached this commit for a line in `git blame`, re-run the blame
  operation starting at the parent of this commit to see older history
  for the content.

* See the parent commit for instructions to rebase a change across this
  style transition commit.
2018-06-01 09:53:42 -04:00
Basil Fierz
5f13168419 VS: Add option to select the version of the toolset used by VS 2017
Add new `version=` parameter in the toolset setting to select the
version.  Add variable `CMAKE_VS_PLATFORM_TOOLSET_VERSION` to hold the
version, if one is set (blank indicates default).

Fixes: #17549
2018-05-29 10:12:59 -04:00
Vitaly Stakhovsky
e7e25c6cb6 cmVisualStudio10TargetGenerator: Remove empty Elem::EndElement()
The method no longer does anything.  Remove it and remove calls to it.
2018-05-25 13:04:56 -04:00
Vitaly Stakhovsky
726c090297 cmVisualStudio10TargetGenerator: close XML tag in Elem destructor
RAII actually implemented; EndElement() still kept to avoid major reformatting
2018-05-25 09:28:54 -04:00
Vitaly Stakhovsky
45c4a75d27 cmVisualStudio10TargetGenerator: make sure each Elem has right scope
Prepare for future RAII
2018-05-22 11:28:11 -04:00
Vitaly Stakhovsky
790fc415b1 cmVisualStudio10TargetGenerator: remove BuildFileStream member
Stream object is now local to `Generate()`
2018-05-16 12:59:00 -04:00
Brad King
c8c07c24dd Merge topic 'dotnet_target_fw_init'
71a033616a added CMAKE_DOTNET_TARGET_FRAMEWORK_VERSION variable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2032
2018-05-16 10:02:48 -04:00
Brad King
d32ceffb1e Merge topic 'vs-nitpicks'
b88e138369 cmVisualStudio10TargetGenerator: minor code cleanup

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2063
2018-05-16 10:01:57 -04:00
Michael Stürmer
71a033616a added CMAKE_DOTNET_TARGET_FRAMEWORK_VERSION variable
Fixes: #17955
2018-05-15 09:00:31 +02:00
Brad King
5a227ce805 Merge topic 'cuda-vs-cuda-device-runtime'
a170a59a58 VS: Link CUDA binaries with the device runtime library 'cudadevrt'

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2062
2018-05-14 09:42:00 -04:00
Vitaly Stakhovsky
b88e138369 cmVisualStudio10TargetGenerator: minor code cleanup 2018-05-11 10:05:51 -04:00
Brad King
c9e995c9ef Merge topic 'vs-refactor'
a2b5acec3b cmVisualStudio10TargetGenerator: refactor

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2054
2018-05-11 09:23:13 -04:00
Brad King
1dda570edc Merge topic 'vs-fix-csharp-recompile'
91754b4e60 VS: When not referencing output assembly do not try to copy it either

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2037
2018-05-11 09:20:49 -04:00
Brad King
a170a59a58 VS: Link CUDA binaries with the device runtime library 'cudadevrt'
According to https://docs.nvidia.com/cuda/nvrtc/index.html there are
some cases where a CUDA binary "...must be linked against the CUDA
device runtime (cudadevrt) library".  When `nvcc` drives linking it
automatically links to runtime libraries as follows:

* -cudart=none: None
* -cudart=shared: -lcudadevrt -lcudart
* -cudart=static: -lcudadevrt -lcudart_static

The `cudadevrt` library is the cuda device runtime library.  It is
always static so passing it to the linker when not necessary does
not hurt anything.

With Ninja and Makefile generators, we detect `cudadevrt` and either
`cudart` or `cudart_static` libraries implied by `nvcc` and then add
them to link lines driven by a host compiler.  However, this does not
work with the VS generator because the CUDA Toolkit Visual Studio
integration does not use `nvcc` to link binaries and instead uses
`link.exe` directly.

Visual Studio project files (`.vcxproj`) for CUDA are expected to
explicitly list the needed runtime libraries.  Our VS generator already
adds `cudart.lib` or `cudart_static.lib` based on the `-cudart=` flag.
Update it to also add `cudadevrt.lib` as nvcc does.

Fixes: #17988
2018-05-11 08:49:10 -04:00
Andreas Schönle
91754b4e60 VS: When not referencing output assembly do not try to copy it either
When generating a `ProjectReference` with `ReferenceOutputAssembly` set
to `false`, also set `CopyToOutputDirectory` to `Never`.  Otherwise
MSBuild might report a diagnostic like

    Project '<name>' is not up to date.
    CopyLocal reference '...\ZERO_CHECK' is missing from output location.

and rebuild the referencing project unnecessarily.
2018-05-09 08:17:42 -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
d3292d2d10 Merge topic 'vs-refactor-xml'
0bd1d1fcc4 VS: Fix regression in XML generation for CUDA

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2053
2018-05-09 07:44:28 -04:00
Brad King
0bd1d1fcc4 VS: Fix regression in XML generation for CUDA
Refactoring in commit 3f315dc128 (cmVisualStudio10TargetGenerator: XML
refactoring, 2018-05-02) accidentally left the `<Import>` element for
the CUDA build customizations unclosed.
2018-05-08 10:29:22 -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
Brad King
42d198744b Merge topic 'deprecate_static_managed_targets'
b7c2b2cd78 cmVisualStudio10TargetGenerator: add handling of static C# targets
d244f2cad3 cmVisualStudio10TargetGenerator: add handling of manual /clr setting
1e5a8f882f cmVisualStudio10TargetGenerator: fix checking for managed target
8d7ffed048 cmVisualStudio10TargetGenerator: issue warning when adding static C# lib
73ee599a82 cmGeneratorTarget: make GetManagedType() return 'Native' for static targets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2014
2018-05-08 08:36:20 -04:00
Michael Stürmer
b7c2b2cd78 cmVisualStudio10TargetGenerator: add handling of static C# targets 2018-05-07 07:21:12 +02:00
Michael Stürmer
d244f2cad3 cmVisualStudio10TargetGenerator: add handling of manual /clr setting 2018-05-07 07:21:10 +02:00
Michael Stürmer
1e5a8f882f cmVisualStudio10TargetGenerator: fix checking for managed target 2018-05-07 07:21:08 +02:00
Michael Stürmer
8d7ffed048 cmVisualStudio10TargetGenerator: issue warning when adding static C# lib 2018-05-07 07:20:46 +02: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
Brad King
36d7f8ca10 Merge topic 'vs-shader-generator-expressions'
83ed65cdde Add generator expressions for VS_SHADER_ source file properties.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2000
2018-04-30 09:18:02 -04:00
Brad King
0036966c0b Merge topic 'vs-refactor-xml'
4465a27882 cmVisualStudio10TargetGenerator: XML refactoring

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2012
2018-04-27 08:24:51 -04:00
Brad King
ea8189ee55 Merge topic 'vs-managed-fastlink'
27b28c001f VS: Don't turn on /DEBUG:FASTLINK for managed C++ targets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2011
2018-04-27 08:24:06 -04:00
Jeremiah van Oosten
83ed65cdde Add generator expressions for VS_SHADER_ source file properties. 2018-04-26 23:00:10 +02:00
Vitaly Stakhovsky
4465a27882 cmVisualStudio10TargetGenerator: XML refactoring 2018-04-26 13:45:29 -04:00
Calum Robinson
27b28c001f VS: Don't turn on /DEBUG:FASTLINK for managed C++ targets
FastLink is only supported for native C++ targets. Turning it off avoids
a warning when building managed C++.
2018-04-26 15:36:59 +01: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
7d407b438d cmVisualStudioGeneratorOptions: specify indentation with integer 2018-04-25 11:01:37 -04:00
Brad King
5a6c629289 Merge topic 'vs-dedup-custom-commands'
f59c33a763 VS: Generate a custom command only in the least dependent target
d58d4daa6b cmVisualStudio10TargetGenerator: Use cmLocalVisualStudio10Generator

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1889
2018-04-25 08:56:16 -04:00
Vitaly Stakhovsky
1f29777798 cmVisualStudio10TargetGenerator: refactoring (continued) 2018-04-24 12:01:19 -04:00
Jeremiah van Oosten
8d1ccbc693 VS: Add VS_SHADER_OBJECT_FILE_NAME source file property 2018-04-24 11:29:16 -04:00
Michael Stürmer
de549083e3 cmVisualStudio10TargetGenerator: warn if /clr flag is set manually 2018-04-24 07:05:19 +02:00
Michael Stürmer
59ec7d50bd cmVisualStudio10TargetGenerator: fix for backward compatibility 2018-04-24 07:05:18 +02:00
Michael Stürmer
663f5120f4 cmGlobalVisualStudioGenerator: remove TargetCanBeReferenced() 2018-04-24 07:05:17 +02: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
Michael Stürmer
f3c6828876 cmVisualStudio10TargetGenerator: /clr compatible flags for managed tgt 2018-04-23 07:31:22 +02:00