Commit Graph

814 Commits

Author SHA1 Message Date
Craig Scott
d2efc90598 Help: Move linker preference variables to the internal section
These probably should not have been documented as public variables
to begin with. But since they have been documented for a long time,
we can't just remove them from the docs. Move them to the internal
section instead to make it clearer that they are not intended to be used
directly by projects.
2022-01-15 11:09:19 +11:00
Brad King
138aabfa9d Merge topic 'vs-csharp-dotnet-sdk'
0eea32a376 VS: Add DOTNET_SDK property to generate SDK-style C# projects
a450cc9533 VS: Set ResolveNugetPackages to false for ALL_BUILD and ZERO_CHECK
fa76e5d194 cmVisualStudio10TargetGenerator: Factor out helper for classic MSBuild project

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6634
2021-12-22 08:56:22 -05:00
Sumit Bhardwaj
0eea32a376 VS: Add DOTNET_SDK property to generate SDK-style C# projects
Changes in cmVisualStudio10TargetGenerator::Generate to write .Net
SDK-style project for VS generators VS 19 and above. Also adds
documentation and tests.

Issue: #20227
2021-12-21 09:35:49 -08:00
Brad King
37af6c3311 target_link_libraries: Optionally require only target names
Optionally verify that items in `LINK_LIBRARIES` and
`INTERFACE_LINK_LIBRARIES` that can be target names are actually target
names.  Add a `LINK_LIBRARIES_ONLY_TARGETS` target property and
corresponding `CMAKE_LINK_LIBRARIES_ONLY_TARGETS` variable to enable
this new check.

Fixes: #22858
2021-12-20 12:14:07 -05:00
Brad King
eaef62ec3b Merge topic 'doc-policy-default'
69b70968bd Help: Suggest CMAKE_POLICY_DEFAULT_CMP0126 in CMP0126 docs
5b1c24255f Help: Suggest CMAKE_POLICY_DEFAULT_CMP0077 in CMP0077 docs
c44636a89b Help: Document more use cases for CMAKE_POLICY_DEFAULT_CMPNNNN

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6756
2021-11-23 09:53:43 -05:00
Brad King
c44636a89b Help: Document more use cases for CMAKE_POLICY_DEFAULT_CMPNNNN 2021-11-22 14:55:36 -05:00
Fred Baksik
e006b87cc6 GHS: GHSMULTI - Update documentation to match implementation
* The variable being set was named `GHSMULTI` not `GHS-MULTI`.
2021-11-15 13:15:11 -05:00
Brad King
7a149034f7 Merge topic 'xcode-generation-enablegpuframecapturemode'
0798edfb85 Tests: Xcode scheme ENABLE_GPU_FRAME_CAPTURE_MODE
e09a3eddb6 Xcode: Support "GPU Frame Capture" scheme property

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !6639
2021-11-12 09:05:01 -05:00
Brad King
c0e23058f6 Merge topic 'vs-framework-version'
d51246c662 VS: Default TargetFrameworkVersion to v4.7.2 for VS 2022
f97f8537f3 VS: Model a default target framework
e40cedddc0 cmVisualStudio10TargetGenerator: Refactor target framework selection
78782cc7dc cmGlobalVisualStudio8Generator: Refactor SetGeneratorPlatform

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6699
2021-11-08 12:38:48 -05:00
Brad King
2b9b64269f Merge topic 'vs-framework-version' into release-3.22
d51246c662 VS: Default TargetFrameworkVersion to v4.7.2 for VS 2022
f97f8537f3 VS: Model a default target framework
e40cedddc0 cmVisualStudio10TargetGenerator: Refactor target framework selection
78782cc7dc cmGlobalVisualStudio8Generator: Refactor SetGeneratorPlatform

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6699
2021-11-08 12:38:47 -05:00
Brad King
f97f8537f3 VS: Model a default target framework
Add fields to the VS generator to select a target framework.
Migrate the existing default for VS 12 .NET CF for Windows CE.

Report the values in `CMAKE_VS_*` variables and use them for
the CSharp compiler id project too.

Issue: #22849
2021-11-06 06:08:54 -04:00
Brad King
36afda49e6 Merge topic 'help_cmake_lang_extensions_default'
e9976c8827 Help: Better explain CMAKE_<LANG>_EXTENSIONS_DEFAULT

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6686
2021-11-03 10:39:05 -04:00
Raul Tambre
e9976c8827 Help: Better explain CMAKE_<LANG>_EXTENSIONS_DEFAULT
Explain that this represents the compiler's default and mustn't be modified
by the user. Clarify when it's used as the default.

Additionally:
* Add a reference to it in cmake-compile-features in text explaining the
  feature.
* Add explanations for the default initialization by
  `CMAKE_<LANG>_EXTENSIONS_DEFAULT` to all `<LANG>_EXTENSIONS` pages and
  references to CMP0128.
* Slightly reduce the wordiness of the default initialization explanations by
  removing an unnecessary "it is".

Fixes #22828.
2021-11-02 17:58:21 +02:00
Brad King
195d47e213 VS: Allow CMAKE_GENERATOR_INSTANCE to specify portable instance
Previously the `CMAKE_GENERATOR_INSTANCE` value was used only to filter
the instances reported by the Visual Studio Installer tool.  If the
specified install location is not known to the VS Installer, but the
user provided a `version=` field, check for the installation directly
on disk.

Fixes: #21639, #22197
2021-10-29 11:52:58 -04:00
Brad King
ec8d37b3b1 VS: Support version specification in CMAKE_GENERATOR_INSTANCE 2021-10-29 11:52:58 -04:00
Brad King
8e6d930e8c VS: Parse comma-separated fields from CMAKE_GENERATOR_INSTANCE 2021-10-29 11:52:58 -04:00
Brad King
152f9978dd Help: De-duplicate VS instance selection documentation
Add a section to `CMAKE_GENERATOR_INSTANCE` for VS instance selection,
and reference it from the corresponding sections of each VS generator.
2021-10-29 11:52:57 -04:00
Craig Scott
300d653248 Help: CTEST_CUSTOM_TESTS_IGNORE matches exact test names, not regexes
Fixes: #22758
2021-10-24 19:58:37 +11:00
makise-homura
3958ed878f LCC: Add policy CMP0129 regarding interpreting LCC as GNU
Due to MCST LCC compiler identification is now changed to LCC,
there should be a way for old projects to still identify it as GNU,
as it was before.
This commits adds the policy:
CMP0129: Compiler id for MCST LCC compilers is now LCC, not GNU.
This policy controls such a behavior.
OLD behaivior is to treat LCC as GNU, NEW is to treat is as LCC.
2021-10-21 17:24:22 +03:00
Jake Turner
e09a3eddb6 Xcode: Support "GPU Frame Capture" scheme property
Added XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE variable which
sets the scheme property value for "GPU Frame Capture" in the Options section by setting the Xcode project variable "enableGPUFrameCaptureMode".

Example values are "Metal" (1) and "Disabled" (3).

XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE is initialized by the property CMAKE_XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE.

Implements: #22700
2021-10-19 15:24:10 +01:00
Brad King
d723bac01c Merge topic 'lcc-compiler'
02b2607a5c Help: Add release note for MCST LCC compiler support
e5d9fce03f LCC: Add dedicated support for MCST LCC compiler
2b9ef77944 CPack/DEB: deal with broken dpkg-shlibdeps on E2K architecture
0995c75301 Tests/RPM: skip tests tat rely on debugedit if it's not found
ea55ac9a51 Tests/RunCMake/CommandLine: Deal with locales that are different from English

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6608
2021-10-19 09:22:22 -04:00
makise-homura
e5d9fce03f LCC: Add dedicated support for MCST LCC compiler
Divert LCC compiler as a new one, instead of treating it as GNU.

Since old times, Elbrus C/C++/Fortran Compiler (LCC) by MCST has been
passing checks for GNU compilers, so it has been identified as GNU.
Now, with intent of seriously upstreaming its support, it has been
added as a separate LCC compiler, and its version displays not a
supported GCC version, but LCC version itself (e.g. LCC 1.25.19 instead
of GNU 7.3.0).

This commit adds its support for detection, and also converts basically
every check like 'is this compiler GNU?' to 'is this compiler GNU or
LCC?'. The only places where this check is untouched, is where it
regards other platforms where LCC is unavailable (primarily non-Linux),
and where it REALLY differs from GNU compiler.

Note: this transition may break software that are already ported to
Elbrus, but hardly relies that LCC will be detected as GNU; still such
software is not known.
2021-10-15 05:05:19 +03:00
Nikhil Reddy Ramolla
5d178fcc53 CTest: Add CTEST_SUBMIT_INACTIVITY_TIMEOUT variable
Fixes: #22617
2021-10-14 11:41:44 -04:00
Deniz Bahadir
f2262fab51 Help: Add documentation for CMAKE_<LANG>_COMPILER_FRONTEND_VARIANT
Signed-off-by: Deniz Bahadir <deniz@code.bahadir.email>
2021-10-13 10:37:09 -04:00
Deniz Bahadir
ffb54e2350 Help: Add more documentation for CMAKE_<LANG>_SIMULATE_ID
Signed-off-by: Deniz Bahadir <deniz@code.bahadir.email>
2021-10-13 10:37:08 -04:00
Craig Scott
9a88f5df3e Merge topic 'fetchcontent-CMAKE-vars-passthrough'
1851aa49be FetchContent: Pass through networking-related CMAKE_... variables
96937438b7 Help: Clean up how TLS and NETRC variables are discussed
2a82bd85b6 Help: Add documentation for CMAKE_TLS_CAINFO

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6589
2021-10-06 07:07:32 -04:00
Craig Scott
1851aa49be FetchContent: Pass through networking-related CMAKE_... variables
CMAKE_TLS_VERIFY, CMAKE_TLS_CAINFO, CMAKE_NETRC and
CMAKE_NETRC_FILE are now passed through to the underlying
ExternalProject sub-build. Previously, they were silently ignored.

Fixes: #22144
2021-10-05 23:41:34 +11:00
Brad King
c55a41c9b2 Merge topic 'default_extensions'
4a0485be7f cmStandardLevelResolver: Avoid unnecessary flags, fix unset level logic
29e2b85171 Tests: Simplify RunCMake.CompileFeatures introspection
fc3a1cbdd8 CompilerID: Compiler extensions default detection
2adfd95d79 CompilerID: Rename language_dialect to language_standard
00055d7779 Help: Document CMAKE_<LANG>_STANDARD_DEFAULT
a65bee4cfc Help: Document HIP standard/extensions properties and variables
a40ff1bb5a Help: Make language standard/extensions variable pages less wordy
3feff8379b Help: Generic language standard and extension variables documentation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6177
2021-10-04 12:43:24 -04:00
Craig Scott
2a82bd85b6 Help: Add documentation for CMAKE_TLS_CAINFO 2021-10-04 21:48:00 +11:00
Raul Tambre
4a0485be7f cmStandardLevelResolver: Avoid unnecessary flags, fix unset level logic
The changes are part of CMP0128.

When the standard level is unset:
* Flags are added if extension mode doesn't match the compiler's default.
  Previously logic only worked if LANG_EXTENSIONS was ON. Fixes #22224.
* The full flag is used. Previously CMAKE_LANG_EXTENSION_COMPILE_OPTION was
  used. This was only supported for IAR.

Otherwise:
* Avoid adding flags if not necessary per the detected compiler defaults.
* Fixed check for when the requested standard is older. It now matches the
  nearby comments.

I reworded the fallback comment as its logic was a bit difficult to wrap my
head around.
2021-09-29 22:28:40 +03:00
Ralf Habacker
9aba0ce29d Help: Fix CMAKE_FIND_LIBRARY_SUFFIXES examples for Windows
Fixes: #22697
2021-09-29 13:38:41 -04:00
Raul Tambre
fc3a1cbdd8 CompilerID: Compiler extensions default detection 2021-09-28 21:24:53 +03:00
Raul Tambre
00055d7779 Help: Document CMAKE_<LANG>_STANDARD_DEFAULT
Seems to be stable and will referred to by policy for standards flags rework.
2021-09-28 21:24:53 +03:00
Raul Tambre
a65bee4cfc Help: Document HIP standard/extensions properties and variables 2021-09-28 21:24:53 +03:00
Raul Tambre
a40ff1bb5a Help: Make language standard/extensions variable pages less wordy
They all had two sentences describing the same thing. Furthermore, with the
shorter wording the explicit advice to see the property being initialized for
further information seems unnecessary.
2021-09-28 21:24:53 +03:00
Raul Tambre
3feff8379b Help: Generic language standard and extension variables documentation
Add generic documentation to improve the discoverability of language-specific
ones and to make it possible to refer to them generically from other language
generic documentation.
2021-09-28 21:24:53 +03:00
Craig Scott
b1745dcbca Merge topic 'doc-build-config'
b8d10c27d1 Help: Restructure build type docs and clarify case sensitivity

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !6516
2021-09-22 08:20:08 -04:00
Craig Scott
b8d10c27d1 Help: Restructure build type docs and clarify case sensitivity
Fixes: #22591
2021-09-21 22:23:24 +10:00
Brad King
36966f63ca Merge topic 'hip-no-hipcc'
cb93f72624 HIP: Simplify detection of HIP runtime CMake package
a71f0fc9c7 HIP: Remove ROMClang compiler id and use Clang directly
b125e9809a HIP: Detect ROCm path earlier
735f41fc2d HIP: Use 'rocm_agent_enumerator' to determine CMAKE_HIP_ARCHITECTURES

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: Raul Tambre <raul@tambre.ee>
Acked-by: Axel Huebl <axel.huebl@plasma.ninja>
Merge-request: !6533
2021-09-20 12:38:44 -04:00
Brad King
a71f0fc9c7 HIP: Remove ROMClang compiler id and use Clang directly
Since commit bd844387df (ROCMClang: Add the ROCm toolkit derived clang
compiler to CMake, 2020-08-28, v3.21.0-rc1~66^2~6) and commit ff0d2858e1
(HIP: Extract clang compiler details from hipcc, 2020-10-21,
v3.21.0-rc1~66^2~5), the separate `ROCMClang` compiler id for `hipcc`
has caused a few problems:

* The compiler id changed from behavior of CMake 3.20 and below,
  breaking projects that already built with `hipcc` treated as `Clang`.

* The implementation of `target_compile_features` was incomplete for
  the `ROCMClang` identity.

* Only `hipcc` was identified as `ROCMClang`, so after it is unwrapped
  to the underlying `clang++`, future runs of new CMake versions on
  an existing build tree would not repeat this.

* Clang should be usable as a HIP compiler without the `hipcc` wrapper.

Remove the `ROMClang` compiler identity, and revise HIP language support
to work directly with a Clang compiler.

Reject direct `hipcc` usage as a HIP compiler.  For now it cannot be
supported because it interferes with flags CMake needs to pass to Clang.

Fixes: #22536, #22460, #22593
2021-09-16 15:33:47 -04:00
Zack Galbreath
735f41fc2d HIP: Use 'rocm_agent_enumerator' to determine CMAKE_HIP_ARCHITECTURES 2021-09-16 14:41:30 -04:00
Robert Maynard
1230ceb97e Help: Improve explanation on CMAKE_POLICY_WARNING warnings occur 2021-09-15 09:28:10 -04:00
Brad King
441691bc24 Help: Document that toolchain files may set implicit link information
Document in `CMAKE_<LANG>_IMPLICIT_LINK_{LIBRARIES,DIRECTORIES}` how
their value is used and that a fallback value may be provided by a
toolchain file.
2021-09-02 14:49:40 -04:00
Craig Scott
18259fa689 Merge topic 'doc-ctest-output'
ba6d1947b6 Help: Add cross-references between test output size ctest variables
cdde9e5a10 Help: Improve wording and cross-referencing for ctest JUnit output

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6389
2021-07-26 07:48:02 -04:00
Craig Scott
ba6d1947b6 Help: Add cross-references between test output size ctest variables 2021-07-26 21:08:45 +10:00
Brad King
f7d82cb6f7 Merge topic 'iar-exe-suffix'
09bc0785ee Help: Document CMAKE_EXECUTABLE_SUFFIX_<LANG> explicitly
05a3bafe65 Compiler/IAR: Avoid clobbering CMAKE_EXECUTABLE_SUFFIX

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6357
2021-07-20 11:56:01 -04:00
Lorenzo Cappelletti
09bc0785ee Help: Document CMAKE_EXECUTABLE_SUFFIX_<LANG> explicitly
Documentation for `CMAKE_EXECUTABLE_SUFFIX_<LANG>`, useful when
cross-compiling, is buried in section `CMAKE_EXECUTABLE_SUFFIX`.
2021-07-20 11:51:19 -04:00
Craig Scott
3f3179aad1 Merge topic 'doc-cleanups-3.21' into release-3.21
8d1944c675 Help: Expand details for file(COPY_FILE)
c8ea886123 Help: Re-order file() sub-commands in Filesystem section
b5a96716eb Help: Clarify which project() call PROJECT_IS_TOP_LEVEL is for
8be7694d97 Help: Fix trivial typo

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6361
2021-07-20 07:54:58 -04:00
Craig Scott
4e5d871e74 Merge topic 'doc-cleanups-3.21'
8d1944c675 Help: Expand details for file(COPY_FILE)
c8ea886123 Help: Re-order file() sub-commands in Filesystem section
b5a96716eb Help: Clarify which project() call PROJECT_IS_TOP_LEVEL is for
8be7694d97 Help: Fix trivial typo

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6361
2021-07-20 07:54:58 -04:00
Brad King
1f6e1a2d78 Merge topic 'vs2022'
0c7f918fb1 VS: Update Visual Studio 17 2022 generator for Preview 2
1ac1436b25 VS: Fix `/sourceDependencies` flag table entries for v143
919fc7fd5f VS: Remove broken EnableASAN entry from flag table for v143
3f19847b28 VS: Remove empty ExternalWarningLevel entry from flag table for v143
ccb6083cbe VS: Remove empty LanguageStandard entries from flag table for v143
c167de7e70 VS: Remove empty ConformanceMode entry from flag table for v143
993d706a17 VS: Populate `/JMC-` flag table entry for v143
a070d87e08 VS: Populate `-Qspectre-` flag table entry for v143
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Egor Pugin <egor.pugin@gmail.com>
Merge-request: !6350
2021-07-19 12:41:20 -04:00