1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-06-21 04:01:40 +08:00

669 Commits

Author SHA1 Message Date
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
Brad King
e2d0da3366 Merge topic 'vs_deploy_content_fix'
b5b63da088 VS: Fix Deploy content in .csproj files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2713
2018-12-13 10:03:52 -05:00
Wil Stark
ea3d60cffa VisualStudio10TargetGenerator: support C# refs with '.' in file name.
Fixes: #18696
2018-12-11 10:47:48 -08:00
Wil Stark
b5b63da088 VS: Fix Deploy content in .csproj files 2018-12-07 09:01:32 -08:00
Brad King
0780a8f57a Merge topic 'cuda-external'
7b74213461 CUDA: Fix crash on linking to a CUDA target without CUDA enabled

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2704
2018-12-06 08:39:22 -05:00
Brad King
7b74213461 CUDA: Fix crash on linking to a CUDA target without CUDA enabled
Do not try to device link or add CUDA runtime libraries if the language
is not enabled.

Fixes: #18673
Issue: #18614
2018-12-05 14:45:19 -05:00
Brad King
d955b4f753 Merge topic 'fix-custom-target-with-csharp'
9040df31e2 Merge branch 'backport-fix-custom-target-with-csharp'
1acd1c2b50 CSharp: Fix regression in VS project type selection for custom target
a56edad6d6 CSharp: Fix regression in VS project type selection for custom target

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2549
2018-11-01 07:36:39 -04:00
Brad King
a56edad6d6 CSharp: Fix regression in VS project type selection for custom target
A target created by `add_custom_target` should always be a `.vcxproj`
file even if it has `.cs` sources involved in custom commands and such.
The latter case was broken by refactoring in commit v3.12.0-rc1~160^2~7
(remove TargetIsCSharpOnly() and use methods from cmGeneratorTarget,
2018-03-19).  The reason is that the `HasLanguage` method added by
commit v3.12.0-rc1~239^2~6 (cmGeneratorTarget: add HasLanguage() as
wrapper for GetLanguages(), 2018-03-19) does not check the target type
and so is not a suitable check for deciding the project file extension.

The `HasLanguage` method was an attempt at an abstraction that turns
out not to work very well.  Replace it with a dedicated `IsCSharpOnly`
method that considers the target type, sources, and non-transitive
`LINKER_LANGUAGE`.

Fixes: #18515
2018-10-31 09:13:19 -04:00
Brad King
3793bed9df Merge topic 'vs-csharp-in-custom-target'
d004d8c59a VS: Fix crash on CSharp sources in a custom target

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2515
2018-10-24 10:40:24 -04:00
Brad King
35fe47bd5d Merge branch 'vs-csharp-in-custom-target' into release-3.13
Merge-request: !2515
2018-10-23 11:06:44 -04:00
Brad King
d004d8c59a VS: Fix crash on CSharp sources in a custom target
The target generator does not compute ClOptions for custom targets,
so we should not use them either.

Fixes: #18377, #18485
2018-10-23 10:58:42 -04:00
Brad King
f21d811c7c Merge topic 'gem-string'
b8bb6ba653 cmGeneratorTarget::GetExportMacro: return const std::string*

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2485
2018-10-17 13:26:33 -04:00
Vitaly Stakhovsky
b8bb6ba653 cmGeneratorTarget::GetExportMacro: return const std::string* 2018-10-16 11:12:19 -04:00
Vitaly Stakhovsky
1601388212 cmVisualStudio10TargetGenerator: Code improvement
Disallow incompletely initialized Elem objects
2018-10-14 18:32:53 -04:00
Brad King
4f289cdc1e Merge topic 'vs-cuda-pdb'
faf3d7d224 VS: Add workaround for CUDA compiler PDB location with space
592064e026 VS: Drop workaround for CUDA compiler PDB location on CUDA 9.2+
fb378fc4d7 Tests: Fix Cuda test project names

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2473
2018-10-11 07:41:42 -04:00
Brad King
bcfb245703 Merge branch 'vs-cuda-pdb' into release-3.13
Merge-request: !2473
2018-10-10 13:41:44 -04:00
Brad King
faf3d7d224 VS: Add workaround for CUDA compiler PDB location with space
CUDA Toolkit Visual Studio Integration for version 9.2 and above does
honor the `ClCompile.ProgramDataBaseFileName` field when telling `nvcc`
how to invoke `cl`.  Unfortunately it does not quote paths with spaces
correctly:

    -Xcompiler "... /Fd"C:\path\with space\foo.pdb" ..."

Work around this by converting the PDB location to a relative path.
Likely we could always do this, but for now make a minimal change
just for CUDA support.

Fixes: #18440
2018-10-10 13:29:47 -04:00
Brad King
592064e026 VS: Drop workaround for CUDA compiler PDB location on CUDA 9.2+
The workaround added by commit v3.12.0-rc1~227^2 (VS: Add workaround for
CUDA compiler PDB location, 2018-04-13) is not necessary on CUDA 9.2+
because the CUDA Toolkit Visual Studio Integration has fixed the
original bug and forwards the `ProgramDataBaseFileName` to the host
compiler itself.  Make the workaround conditional on the CUDA version.

Issue: #18440
2018-10-10 13:29:47 -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
Brad King
9fc3024f62 Merge topic 'fix-csharp-target-type'
375b420fdf CSharp: Fix regression in VS project type selection
8b21aa0af0 VS: Fix CSharp flag selection when linking to a static C++ library

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2427
2018-10-03 08:04:35 -04:00
Brad King
8b21aa0af0 VS: Fix CSharp flag selection when linking to a static C++ library
When a CSharp target links to a static C++ library, CMake will compute
the link language as C++ instead of CSharp.  That may be incorrect and
needs further investigation, but it does not affect how VS drives C#
linking.  However, it does break our flag language selection logic
and causes C++ flags to be used for CSharp.  In particular, this
drops the `-platform:x86` flag on 32-bit builds.

Fix this by always selecting the CSharp flags when generating a
`.csproj` project type.

Issue: #18239
2018-10-02 14:58:11 -04:00