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

138 Commits

Author SHA1 Message Date
Brad King
6999b87133 cmGlobalVisualStudio10Generator: Add method to find MSBuild early
Add a way to find MSBuild before the main `FindMakeProgram` code path
has executed.
2021-10-20 13:00:25 -04:00
Brad King
7f730464be cmGlobalGenerator: Add method to check if generator is at least VS 10 2021-10-20 13:00:25 -04:00
Brad King
6511654164 cmGlobalVisualStudio10Generator: Allow subclasses to reset MSBuild search
While at it, convert to inline initialization.
2021-10-20 13:00:25 -04:00
Gustavo Varo
9ba99a1203 VS: Add support for Utf8Enconding when using VS 16.10+
On VS 16.10 Preview 2 or above, generate `UseUtf8Encoding`
instead of `StdOutEncoding=UTF-8` in `.vcxproj` files.

Fixes: #22032
2021-06-17 13:44:22 -04:00
Brad King
3fd65f5ca6 VS: Compare VS instance versions as strings
This makes the values more readable.
2021-06-17 07:54:48 -04:00
Brad King
aabc3ca47d cmGlobalVisualStudio10Generator: Adopt GetVSInstanceVersion method
Port from `cmGlobalVisualStudioVersionedGenerator`.
2021-06-16 13:22:32 -04:00
Brad King
608ef8a6fc VS: Add a mostly-undocumented hook to load custom JSON flag tables
The names and formats of our VS flag tables are internal implementation
details.  However, some institutions need to maintain support for
non-public VS platforms and toolsets.  Provide a hook that their
projects can use to load custom flag table files.  This helps avoid
distributing a custom CMake package within such institutions.

Document the hook itself, but explicitly specify that the files the
hook loads are not considered a stable interface.
2021-03-22 13:28:27 -04:00
Marcel Ritzschke
c73b847b03 VS: switch to new folder structure while keeping the old one working
Fixes: #21170
2021-03-18 15:44:13 +01:00
Brad King
3d661c6c3a Merge topic 'vs-toolset-version'
30c835428f VS: Accept and translate '-T version=' values with three components
58a50a3a0a VS: Fix '-T version=14.28' under VS 16.9
09f59da7f0 cmGlobalVisualStudioVersionedGenerator: Clarify local variable name

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5903
2021-03-15 08:50:13 -04:00
Brad King
58a50a3a0a VS: Fix '-T version=14.28' under VS 16.9
CMake accepts the toolset version that is default in the current VS
version by matching the name later VS versions will use for the SxS
props files.  It predicts the future name based on the first two
components of the current VS version's default toolset.  However, this
heuristic breaks naming the VS 16.8 toolset version 14.28 under VS 16.9
because the latter's default toolset version is 14.28.29910, which did
not increment the second version component (unprecedented in VS).

Fix this by always using the requested version's SxS props file when it
exists, even if it matches the first two components of the current VS
version's default toolset.  Also add a special case for the name VS
16.10 will use for VS 16.9's default toolset, so that it can be used
with VS 16.9 too.

Fixes: #21922
2021-03-12 08:36:40 -05:00
Brad King
1b33150f7e cmGlobalVisualStudio10Generator: Generalize flag table lookup interface 2021-03-05 09:34:59 -05:00
Brad King
414b5e0119 cmGlobalVisualStudio10Generator: Clarify LoadFlagTable argument name 2021-03-05 09:34:59 -05:00
Brad King
99f6f1b3b9 cmGlobalVisualStudio10Generator: Remove redundant arguments 2021-03-05 09:34:58 -05:00
Brad King
1b774e18fb cmGlobalVisualStudio10Generator: Remove redundant arguments 2021-03-05 09:34:58 -05:00
Brad King
a1c0758ea0 cmGlobalVisualStudio10Generator: Clarify method name 2021-03-05 09:34:58 -05:00
Brad King
e562e8987c cmGlobalVisualStudio10Generator: Remove unused flag table method argument 2021-03-05 09:34:58 -05:00
Brad King
fe17685722 cmGlobalVisualStudio10Generator: Adopt flag table name methods
Migrate them from `cmVisualStudio10ToolsetOptions`.
2021-03-05 09:34:58 -05:00
Kitware Robot
bdca8b01d2 Modernize: Use #pragma once in all header files
#pragma once is a widely supported compiler pragma, even though it is
not part of the C++ standard. Many of the issues keeping #pragma once
from being standardized (distributed filesystems, build farms, hard
links, etc.) do not apply to CMake - it is easy to build CMake on a
single machine. CMake also does not install any header files which can
be consumed by other projects (though cmCPluginAPI.h has been
deliberately omitted from this conversion in case anyone is still using
it.) Finally, #pragma once has been required to build CMake since at
least August 2017 (7f29bbe6 enabled server mode unconditionally, which
had been using #pragma once since September 2016 (b13d3e0d)). The fact
that we now require C++11 filters out old compilers, and it is unlikely
that there is a compiler which supports C++11 but does not support
#pragma once.
2020-09-03 09:30:21 -04:00
Kyle Edwards
6051a49c78 Visual Studio: Add Android support 2020-06-24 08:41:09 -04:00
Kyle Edwards
14456923bd cmGlobalVisualStudio10Generator: Move variable initialization to header 2020-06-18 15:35:26 -04:00
Justin Goshi
e219527a72 VS: Use StdOutEncoding for VS 16.7 Preview 3 and above
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
2020-06-03 09:00:41 -04:00
Brad King
4b062c77b3 Merge topic 'vs-version-for-unity'
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
2020-02-05 08:33:50 -05:00
Brad King
9135954e2f VS: Do not use native unity builds on VS 2017 versions less than 15.8
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
2020-02-04 11:46:18 -05:00
Marc Chevrier
a00960288b GlobalGenerator family: modernize memory management 2020-01-07 11:03:11 +01:00
Marc Chevrier
36c8cae2e8 cmLocalGenerator: modernize memory management 2019-12-10 00:24:06 +01:00
Alexander Boczar
548e9051a4 VS: Add support to override VCTargetsPath through toolset
Fixes: #19708
2019-10-15 13:28:45 -04:00
Alexander Boczar
99e83d4235 cmake: Teach --build mode to load CMAKE_GENERATOR_TOOLSET
Extend the `cmGlobalGenerator::SetGeneratorToolset` signature to
indicate when it is called from `cmake::build`.
2019-10-15 13:28:41 -04:00
Benjamin Wozniak
df0247a371 cuda: Extend toolset argument to accept path
Previously cuda could only be used with cmake if it is
installed globally on the system. Sometimes this is not
possible (eg docker, packaging with conan, etc.).
Thus the cuda toolset argument is extended to take
a path to a cuda install directory.
2019-08-27 12:54:35 +02: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
Sebastian Holtermann
735c6f39d9 Fix invalid ///! doxygen comment line starts
In various places `///!` was used to start a comment line.  This is not valid
Doygen syntax.  This patch replaces `///!` comment starts with `//!`.
2019-03-31 11:27:12 +02:00
Bartosz Kosiorek
324d18bb34 cmake: Teach --build mode to support multiple targets
Fixes: #16136
2019-03-05 08:55:28 -05:00
Brad King
9620cb935a Merge topic 'add_consistent_verbose_build_flag'
66801f4d40 cmake: Add tests for verbose output to --build mode
439fe2e253 cmake: Add options for verbose output to --build mode
638667efa2 cmake: cmcmd.cxx fix "The arguments are" comments
3ca4402966 ctest: Fix --build-and-test without --build-target on Xcode
cb6c233ecc cmake: Add -hideShellScriptEnvironment xcodebuild option
1a45266cb5 cmGlobalGenerator: Add a class that represent the build command

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2708
2019-01-29 09:19:39 -05:00
Brad King
0fd742a6ff VS: Teach VS 2019 generator to select host tools matching host arch
This generator is new so we can introduce the long-desired behavior
of selecting ``host=x64`` tools by default on x64 hosts.
2019-01-28 12:58:21 -05:00
Robert Maynard
1a45266cb5 cmGlobalGenerator: Add a class that represent the build command
This refactors a std::vector<std::string> into a class so that
we can extend the features to represent things such as multiple
chained commands in the future.
2019-01-25 08:20:02 -05:00
Brad King
a8b447d72e Merge topic 'support_per_toolset_json_flags'
c8ba777f6d GlobalVisualStudio10Generator: Support non-standard toolset json flag files.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2772
2019-01-16 09:50:00 -05:00
Brad King
40a732800d VS: Clarify global generator constructor interface
Make the constructors protected since they should be produced through
factories.  Also rename `platform{ => InGenerator}Name` to clarify
the meaning of the argument.
2019-01-10 09:38:35 -05:00
Brad King
163cc8bbdd VS: Convert WriteSLNHeader to non-virtual lookup table 2019-01-10 07:52:51 -05:00
Brad King
03f74a16cd VS: Convert GetIDEVersion to non-virtual table lookup 2019-01-10 07:52:48 -05:00
Brad King
d07f453f39 VS: Convert GetToolsVersion to non-virtual table lookup 2019-01-10 07:51:47 -05:00
Stephan Szabo
c8ba777f6d GlobalVisualStudio10Generator: Support non-standard toolset json flag files.
If given a toolset that does not have an explicit mapping in
cmVisualStudio10ToolsetOptions, check for a json flag file using the
toolset name before trying the default toolset for the generator.
2019-01-03 13:25:19 -08:00
Vitaly Stakhovsky
77d83568e0 cmGlobalVisualStudioGenerator::GetIDEVersion(): const added 2019-01-02 08:25:49 -05:00
Vitaly Stakhovsky
94632087b2 Add missing override 2018-12-30 12:32:55 -05:00
Stephan Szabo
6d855fbf44 Replace header flag tables with json reading
Stop loading flag tables from header files and instead load the flag table
information from json files in Templates/MSBuild/FlagTables.
2018-11-28 07:43:31 -08: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
Basil Fierz
3c4698da3a VS: Allow toolset version selection to specify default toolset
Teach the feature added by commit v3.12.0-rc1~38^2 (VS: Add option to
select the version of the toolset used by VS 2017, 2018-05-19) to accept
the default toolset version in addition to older versions.  If the
default toolset version is supplied, simply clear it so the default will
be used.

Fixes: #18107
2018-06-24 10:36:03 -04: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
Brad King
958191a95c Merge topic 'vs-toolset-version'
5f13168419 VS: Add option to select the version of the toolset used by VS 2017

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Francisco Facioni <fran6co@gmail.com>
Merge-request: !2093
2018-05-30 10:19:21 -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
Florian Maushart
1ab3881ec9 cmake: Add options for parallel builds to --build mode
While we already support `cmake --build . -- -j`, the options after `--`
are specific to the native build tool.  Add new options `--parallel
[<N>]` and `-j [<N>]` to abstract this and map to the proper option
for the native build tool.
2018-05-25 09:42:20 -04:00
Vitaly Stakhovsky
cfe4e2db1f VS: Use 'override' keyword for overridden methods in generator classes
The corresponding 'virtual' removed.
2017-12-15 21:17:49 -05:00