Commit Graph

466 Commits

Author SHA1 Message Date
AJIOB
2b2344b412 MSVC: Add abstraction for runtime checks
Replace our hard-coded default for `/RTC1` with a first-class
abstraction to select runtime checks from an enumeration of logical
names.  Add a `MSVC_RUNTIME_CHECKS` target property and corresponding
`CMAKE_MSVC_RUNTIME_CHECKS` variable.

Removing the old default flag requires a policy because existing
projects may rely on string processing to edit them and choose
runtime checks under the old behavior.  Add policy CMP0184 to
provide compatibility.

Fixes: #26614
2025-01-29 13:07:41 -05:00
Brad King
cf6114886a Merge topic 'CMAKE_LANG_DEVICE_LINK_MODE'
53de9d0125 Introduce CMAKE_<LANG>_DEVICE_LINK_MODE variable.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10209
2025-01-22 09:24:27 -05:00
Brad King
e7a90d0551 Help: Document CTEST_EXTRA_SUBMIT_FILES variable 2025-01-21 14:55:14 -05:00
Brad King
123e002168 Help: Document CTEST_NOTES_FILES variable 2025-01-21 14:52:14 -05:00
Marc Chevrier
53de9d0125 Introduce CMAKE_<LANG>_DEVICE_LINK_MODE variable.
This is a complement to commit 00932ea864 (Introduce CMAKE_<LANG>_LINK_MODE variable., 2025-01-09)
2025-01-21 15:17:05 +01:00
Brad King
e87c6c6259 Merge topic 'execute-process-error'
3ece058d97 execute_process: Allow setting default COMMAND_ERROR_IS_FATAL value
85035dd954 Help/command/execute_process: Fix definition list formatting

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10169
2025-01-16 08:59:00 -05:00
Martin Duffy
3ece058d97 execute_process: Allow setting default COMMAND_ERROR_IS_FATAL value
Issue: #26576
2025-01-15 11:12:34 -05:00
Brad King
74c462b4f8 Merge topic 'xcode-scheme-test-config'
7d28005244 Xcode: Support for test action 'Build Configuration' scheme property
1f4e1ccbc8 Help: Move launch config scheme property to the correct section
8aaae0f643 vim: Remove duplicated keywords from cmake.vim

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10154
2025-01-13 11:37:31 -05:00
Marc Chevrier
00932ea864 Introduce CMAKE_<LANG>_LINK_MODE variable.
This variable define how the link step is done. Possible values are:
* DRIVER: the compiler is used as driver for the link step
* LINKER: the linker is used directly for the link step.
2025-01-10 13:24:16 +01:00
Cristiano Carvalheiro
7d28005244 Xcode: Support for test action 'Build Configuration' scheme property
Also allow scoped property checking on Xcode scheme tests to
 be able to distinguish between launch and test actions build config.
2025-01-09 16:36:33 +00:00
Brad King
5c7bb0bfd9 Merge topic 'rename-cmakelists'
fcbc883fa3 cmake: Allow configuration of default script names

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: scivision <michael@scivision.dev>
Merge-request: !10059
2024-12-18 08:49:58 -05:00
Martin Duffy
fcbc883fa3 cmake: Allow configuration of default script names
Adds the ``--project-file`` command-line option to modify the default script
name loaded by CMake and ``add_subdirectory`` to values other than
``CMakeLists.txt``.

Fixes: #21570
2024-12-17 12:47:02 -05:00
Cristiano Carvalheiro
419cfe30d0 Xcode: Support for 'LLDB Init File' scheme property
Fixes: #24002
2024-12-13 08:31:11 -05:00
Garrett Campbell
9ed178f9d8 Add generator-agnostic DEBUGGER_WORKING_DIRECTORY target property
Generalize the `VS_DEBUGGER_WORKING_DIRECTORY` property.

Issue: #16478
2024-12-09 10:47:10 -05:00
Marc Chevrier
521a6d409c Archive library: Add support for ARCHIVER: prefix
Add the support of the ARCHIVER: prefix to offer a portable way to pass
options to the archiver when the compiler is used as driver.
2024-11-26 19:26:07 +01:00
Marc Chevrier
7907c83175 Link step: Add LINK_WARNING_AS_ERROR target property
Add a way to specify, in a portable way, to raise an error for any
warning during the link step. For that purpose, define:
* CMAKE_LINK_WARNING_AS_ERROR variable
* LINK_WARNING_AS_ERROR target property

Fixes: #25343
2024-11-12 15:11:53 +01:00
Robert Maynard
9510820d58 Help: Document CTest module BUILD_TESTING variable
The `BUILD_TESTING` variable is referenced in `add_test` and
`enable_testing`.  It should be documented as it controls the
behavior tests working when projects use `include(CTest)`.
2024-10-24 11:46:37 -04:00
leha-bot
5d2b89d5fa Add CMAKE_HOST_EXECUTABLE_SUFFIX for Unix/Windows
Closes: #17553
2024-10-02 10:39:40 -04:00
Brad King
53f3e5da1e Merge topic 'link-strategy'
7abd3137b7 Linking: Optionally reorder direct dependencies from LINK_LIBRARIES
9285a9dc9a cmComputeLinkDepends: Add final dependency ordering to debug output
f792db4ca2 cmComputeLinkDepends: Add undocumented per-target debug property
80b469a51d cmComputeLinkDepends: Factor out string literals as named constants
3bd73fcc76 cmComputeLinkDepends: Modernize member initialization
8db69c767b cmComputeLinkDepends: Remove redundant member
dccdd030cd cmComputeLinkDepends: Replace depender index sentinel value with cm::optional
6c9d8dc243 cmComputeLinkDepends: Replace group index sentinel value with cm::optional
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9835
2024-09-26 08:47:47 -04:00
Brad King
7abd3137b7 Linking: Optionally reorder direct dependencies from LINK_LIBRARIES
Traditionally CMake generates link lines by starting with the direct
link dependencies specified by `LINK_LIBRARIES` in their original order
and then appending indirect dependencies that the direct dependencies
do not express.  This gives projects control over ordering among
independent entries, which can be important when intermixing flags
and libraries, or when multiple libraries provide the same symbol.
However, it may also result in inefficient link lines.

Add support for an alternative strategy that can reorder direct link
dependencies to produce more efficient link lines.  This is useful
for projects that cannot easily specify their targets' direct
dependencies in an order that satisfies indirect dependencies.

Add a `CMAKE_LINK_LIBRARIES_STRATEGY` variable and corresponding
`LINK_LIBRARIES_STRATEGY` target property to select a strategy.

Fixes: #26271
2024-09-25 06:48:57 -04:00
Brad King
3b4d0df670 NVCC: Detect host compiler id and version
Report them in `CMAKE_<LANG>_HOST_COMPILER_{ID,VERSION}` variables.

Fixes: #20901
2024-09-20 17:48:33 -04:00
Brad King
9c5f6d22f3 Merge topic 'windows-kernel-mode-driver-includes'
b151bcfc9e WindowsKernelModeDriver: Add WDK include and link paths on MSVC

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9705
2024-09-05 09:21:35 -04:00
Brad King
2daeb0b504 Merge topic 'build-databases'
e77655555c cmExperimental: gate build database support behind a flag
23cbeb5035 ci: enable `build_database` CXXModules tests
6863c1d823 Tests/CXXModules: add tests for module commands
123107c1a4 Tests/CXXModules: add support for running targets under a given config
438038b5e1 Tests/CXXModules: support building specific targets of example trees
84bc710d84 cmGlobalGenerator: generate build database files for targets
670f753f24 cmDyndepCollation: write build database metadata
dcf9a66ffe cxxmodules: plumb control data for exporting build databases
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9708
2024-09-05 09:20:23 -04:00
Joseph Snyder
b151bcfc9e WindowsKernelModeDriver: Add WDK include and link paths on MSVC
Detect Windows Kernel-Mode Driver include directories and library search
paths from the WDK command-line environment.  Require toolchain files to
specify the KMDF target version via a new variable.

Since this changes the behavior of the WindowsKernelModeDriver
experimental feature, update its UUID.
2024-09-03 11:10:35 -04:00
Vito Gamberini
20e9b59d5e
Linking: Add CMAKE_LANG_STANDARD_LINK_DIRECTORIES
Closes: #18222
2024-08-28 15:54:43 -04:00
Ben Boeckel
dcf9a66ffe cxxmodules: plumb control data for exporting build databases
This includes the target property, its initializing variable, its
initializing environment variable, and updating related docs to mention
the new bits.
2024-08-27 12:37:36 -04:00
Brad King
a8d8f26828 Merge topic 'aix-archive-shared-libraries'
d27fe9dfba AIX: Add option to archive shared libraries
98013ad1ca cmXCOFF: Add support for editing binary inside an archive

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9606
2024-07-19 09:55:58 -04:00
Aditya Vidyadhar Kamath
d27fe9dfba AIX: Add option to archive shared libraries
Add option `CMAKE_AIX_SHARED_LIBRARY_ARCHIVE`.

There will no versions for the shared objects when this option is used.

Closes: #26033
2024-07-17 11:52:09 -04:00
Brad King
b3cd795e65 Merge topic 'wasi'
68cd5281e4 WASI: Add platform modules

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9659
2024-07-17 09:47:30 -04:00
Jacob Hummer
68cd5281e4 WASI: Add platform modules
Add minimal platform modules to support toolchain files like those in

* https://github.com/WebAssembly/wasi-sdk

or direct use of `-DCMAKE_SYSTEM_NAME="WASI"`

Fixes: #19223
2024-07-16 12:28:19 -04:00
權少
723e236224 Help: Move deprecated modules and variables to dedicated sections
These were missed in commit e0355c4ea9 (FindBoost: Add policy to remove
this module, 2024-05-03, v3.30.0-rc1~150^2) and commit 0aba13a2f3
(ctest: Add explicit options for TLS server verification, 2024-03-01,
v3.30.0-rc1~408^2~3).
2024-07-15 16:55:38 -04:00
Marc Chevrier
576567f028 Link feature attributes: stabilization
* enhance OVERRIDE handling
* Update wording
2024-06-21 11:18:20 +02:00
Brad King
5d93c421f1 HIP: Populate CMAKE_HIP_KNOWN_FEATURES global property
Fixes: #26013
2024-05-28 14:36:42 -04:00
Marc Chevrier
6e5e7968c3 GenEx $<LINK_LIBRARY>: Add the support of properties attached to features
Fixes: #24504, #25954
2024-05-15 10:02:36 +02:00
Tyler
7c38e6bb52 Add CMAKE_<LANG>_STANDARD_LATEST variables
Add a variable to indicate the latest standard known to be supported for
each language:

* `CMAKE_C_STANDARD_LATEST`
* `CMAKE_CXX_STANDARD_LATEST`
* `CMAKE_CUDA_STANDARD_LATEST`
* `CMAKE_HIP_STANDARD_LATEST`
* `CMAKE_OBJC_STANDARD_LATEST`
* `CMAKE_OBJCXX_STANDARD_LATEST`

These variables, more generally referred to as
`CMAKE_<LANG>_STANDARD_LATEST`, are assigned an integer value which
represents the minimum between the latest version of the associated
language standard supported by the current compiler and the latest
version supported by CMake.

Add documentation for these variables in a new page called
`CMAKE_<LANG>_STANDARD_LATEST` was added under the "Variables for
Languages" section of the `cmake-variables(7)` page.

Update each compiler-specific CMake script under
`${CMAKE_ROOT}\Modules\Compiler` to manually define the relevant
`CMAKE_<LANG>_STANDARD_LATEST` variable as necessary. This will
require updating and maintaining as newer compiler versions become
recognized by CMake.

Closes: #25717
2024-04-30 11:05:03 -04:00
Ben Boeckel
678717f3e4 cxxmodules: provide a detection variable for import std 2024-04-18 09:53:21 -04:00
Ben Boeckel
7146cf9248 cmTarget: support the CXX_MODULE_STD property 2024-04-11 10:19:44 -04:00
Brad King
6671f17f65 ctest: Add explicit options for TLS version
Add a dedicated `TLSVersion` ctest option and a `CTEST_TLS_VERSION`
variable to control it.

Issue: #25701
2024-03-12 10:46:23 -04:00
Brad King
0aba13a2f3 ctest: Add explicit options for TLS server verification
Add a dedicated `TLSVerify` ctest option and a `CTEST_TLS_VERIFY`
variable to control it.  Deprecate `CurlOptions` because it exposes
internal implementation details.
2024-03-12 10:46:11 -04:00
Brad King
fb9a6cf909 file(DOWNLOAD|UPLOAD): Add CMAKE_TLS_VERSION variable
Issue: #25701
2024-02-28 08:40:27 -05:00
Brad King
b814641444 VS: Add [CMAKE_]VS_USE_DEBUG_LIBRARIES options to control UseDebugLibraries
This indicates to MSBuild which configurations are considered debug
configurations.  This is useful for reference both by humans and tools.

Issue: #25327
2024-02-19 10:40:41 -05:00
Orkun Tokdemir
7c39dabdbc Autogen: AUTO*_EXECUTABLE: add support for per-config values
* Per-config values were added to `AUTO*_EXECUTABLE`.
* Dependency order was refactored for `cmake_autogen` and `cmake_autorcc` to avoid unnecessary rebuilds.
* A new parameter was added for `cmake_autogen` and `cmake_autorcc` to specify the config name of the `auto*_executable` to be used.
* Add `AUTOGEN_BETTER_GRAPH_MULTI_CONFIG` target property to change the behavior of the dependency graph.
* The timestamp target is split into three targets for per-config to avoid redundant `mocs_compilation` builds when `AUTOGEN_BETTER_GRAPH_MULTI_CONFIG`	 is ON
* Per-config `DEP_FILE_RULE_NAME` values were added to `AutogenInfo.json` for `Multi-Config` usage.
* Some functions were refactored to avoid code duplication.

This commit reimplements fddd0f0443

Fixes: #20074
2024-01-17 16:02:58 +01:00
Ralf Habacker
1ec0372ed4 add_test: Optionally use a launcher for tests running in-project targets
Add a `CMAKE_TEST_LAUNCHER` variable and corresponding `TEST_LAUNCHER`
target property.

Issue: #23672
2023-12-13 10:20:43 -05:00
Brad King
81e836e0fe Merge topic 'vs-ifx'
43d218d970 VS: Add support for using Intel oneAPI Fortran compiler in .vfproj files
5c77facd78 VS: Fix Intel plugin version detection fallback

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9001
2023-11-27 08:41:55 -05:00
Brad King
43d218d970 VS: Add support for using Intel oneAPI Fortran compiler in .vfproj files
Add a `fortran={ifort,ifx}` field to `CMAKE_GENERATOR_TOOLSET` to
specify which Intel Fortran compiler to use.

Fixes: #25427
2023-11-22 10:22:12 -05:00
權少
3888ea2f24 Help: Move deprecated variables to dedicated section 2023-11-22 08:41:55 -05:00
Brad King
1f7a653e90 Merge topic 'swift-compilation-mode'
0f80101b73 Tests: Update Swift tests to use CMP0157 NEW behavior
c1d787e473 Swift: Add abstraction for compilation mode
c39384f540 Tests: Simplify RunCMake.Swift conditions to enable use of Swift

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8918
2023-11-19 11:47:37 -05:00
Evan Wilde
c1d787e473 Swift: Add abstraction for compilation mode
Add a `CMAKE_Swift_COMPILATION_MODE` variable and corresponding
`Swift_COMPILATION_MODE` target property to control the compilation
mode.  Select among `wholemodule`, `singlefile`, and `incremental`.

Add policy CMP0157 to remove the default `-wmo` flags in favor of the
abstract setting.

Issue: #25366
2023-11-17 08:43:21 -05:00
tophoo
7a07887055 Autogen: Add support for response files for moc predef targets
Add support for response files for moc predef targets and make the limit when
to use response files for autogen targets configurable.
2023-11-16 16:29:02 +01:00
Kyle Edwards
c6e6861e63 install(EXPORT): Export find_dependency() calls
Issue: #20511
Co-Authored-by: Brad King <brad.king@kitware.com>
Co-Authored-by: Robert Maynard <rmaynard@nvidia.com>
2023-11-13 11:07:52 -05:00