1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-06-21 12:10:05 +08:00

1060 Commits

Author SHA1 Message Date
Evan Wilde
64b3367845 cmGlobalGenerator: Allow passing language to GetLangaugeOutputExtension
The original GetLanguageOutputExtension took a sourcefile instead of the
name of the language itself. This implementation provided a convenient
handler for when the SourceFile doesn't know what language it is, but
there are times where we know the language, but don't necessarily have a
source file. Adding an overload that takes the name of the language and
returns the extension of that language, or empty string if no extension
is registered.
2023-12-04 19:15:20 -05:00
Brad King
6f936245c2 Merge topic 'ccmake-install-rds-crash'
d01120a47a cmGlobalGenerator: clear RuntimeDependencySet members at configure

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9013
2023-11-30 09:03:51 -05:00
Ben Boeckel
d01120a47a cmGlobalGenerator: clear RuntimeDependencySet members at configure
Commit f2617cf8e6 (Source: Add cmInstallRuntimeDependencySet,
2021-05-19) introduced via !6186 to 3.21 added storage to the global
generator for runtime dependency sets. However, this was not cleared at
the start of configure in the `ClearGeneratorMembers()` method. When
using `ccmake` to configure (and, presumably `cmake-gui` too), projects
using `install(TARGETS … RUNTIME_DEPENDENCY_SET)` would use dependency
set tracking instances from previous configure runs that held references
to targets free'd with the `cmMakefile` instance that held them.

Clear the dependency sets at the beginning of configure so that they are
not remembered and trigger via use-after-free bugs when used.

Fixes: #25446
2023-11-29 08:34:21 -05:00
Brad King
cdd741ebf9 Merge branch 'backport-ci-fedora-39' into ci-fedora-39 2023-11-17 11:35:41 -05:00
Brad King
2744f14db1 codespell: Fix typos 2023-11-17 09:58:21 -05:00
William Sciaroni
5e0c1777a3 Optionally make test target depend on all
Fixes: #8774
2023-11-10 13:19:11 -05:00
Ben Boeckel
186673ba0b cmGlobalGenerator: hint about missing extensions on Windows
Discussed on Discourse:

    https://discourse.cmake.org/t/cross-compiling-from-a-windows-host-targeting-raspbian-32-bits-arm/9250
2023-10-24 11:21:31 -04:00
Cristian Le
b37b912e8f CMAKE_PROJECT_INCLUDE: Allow to run module files
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
2023-10-18 18:01:05 +02:00
Ben Boeckel
7a4c02cb38 cmGlobalGenerator: factor out messaging for CMP0037
Also make some strings into character literals.
2023-09-25 17:39:35 -04:00
Ben Boeckel
34b393f97f cmGlobalGenerator: use static string views for reserved targets
Also make the array static.
2023-09-25 17:39:35 -04:00
Ben Boeckel
80d6544398 cxxmodules: generate synthetic targets as an initial pass
We need to be able to construct BMIs that will be usable from the client
modules for the target importing the module, so create BMI-only
compilation rules for `IMPORTED` targets to create these BMIs.
2023-08-17 14:42:53 -04:00
Ben Boeckel
4980f47b46 cmGlobalGenerator: always support generating rule hashes 2023-08-08 14:25:01 -04:00
Brad King
241ee252ce IWYU: Update for Debian 12 CI job
`include-what-you-use` diagnostics, in practice, are specific to
the environment's compiler and standard library.  Update includes
to satisfy IWYU for our CI job under Debian 12.
2023-07-28 09:14:08 -04:00
Ben Boeckel
2a74f641db cmGlobalGenerator: use single chars where possible 2023-07-19 16:32:33 -04:00
Ben Boeckel
cfdb5c970c cmGlobalGenerator: use cmStrCat where possible 2023-07-19 16:32:25 -04:00
Clemens Wasser
b928f52983 cmGlobalGenerator: Remove unused windows.h include 2023-06-22 18:11:45 +02:00
Clemens Wasser
1bb0e59318 codecvt: Extrace codecvt::Encoding to remove codecvt includes 2023-06-22 18:11:45 +02:00
Ben Boeckel
0183e1bca3 cxxmodules: remove CMAKE_EXPERIMENTAL_CXX_MODULE_DYNDEP variable
It is now subsumed by the UUID setting completely.
2023-06-01 14:43:26 -04:00
Brad King
aa3675d281 Merge topic 'cmake-compile-no-warning-as-error'
da27ff1e96 Preserve --compile-no-warning-as-error in automatic CMake re-runs
e0b48284a1 Xcode: Internally uses -S instead of -H to specify source directory

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8522
2023-06-01 09:45:56 -04:00
Brad King
c4f273e722 Merge topic 'AddCacheEntry-suppress-raw-pointer-usage'
4fc322bab4 AddCacheEntry: Suppress raw pointer usage

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8520
2023-05-31 09:35:25 -04:00
Brad King
5b063510f9 Merge topic 'cmake-verbose-print-build-tool-command'
8451a3f0b5 cmGlobalGenerator: use a stream for output in `Build`
e060666531 cmake: write the build command itself with `--verbose`
b017c9f127 cmGlobalGenerator: fix off-by-one for `&&` command joining
c715fd8d76 cmGlobalGenerator: quote commands in `::Build` output
d6c0e827bc cmGlobalGenerator: add a `QuotedPrintable` method for commands
28ee3bef34 cmGlobalGenerator: add missing spaces in output
465ab8d872 cmGlobalGenerator: use `cmStrCat` in `::Build`
81d45dabc4 cmOutputConverter: add a `static` version of `EscapeForShell`

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Acked-by: Alex <leha-bot@yandex.ru>
Merge-request: !8183
2023-05-31 09:33:26 -04:00
Brad King
da27ff1e96 Preserve --compile-no-warning-as-error in automatic CMake re-runs
When the build system re-runs `cmake` to regenerate itself, preserve the
`--compile-no-warning-as-error` option if it was used when `cmake` was
last explicitly invoked.  Normally such settings are preserved in the
cache, but the purpose of this option is to be beyond the reach of
project code.
2023-05-30 17:44:43 -04:00
Marc Chevrier
4fc322bab4 AddCacheEntry: Suppress raw pointer usage 2023-05-30 16:41:59 +02:00
Ben Boeckel
8451a3f0b5 cmGlobalGenerator: use a stream for output in Build
This allows output to show up in output immediately instead of being
batched.
2023-05-27 07:04:17 -04:00
Marc Chevrier
aa5fed5052 SetProperty: suppress raw pointer usage 2023-05-26 14:48:22 +02:00
Marc Chevrier
5884303e69 Apple Framework: enhance path parsing 2023-05-21 14:26:08 +02:00
Ben Boeckel
b017c9f127 cmGlobalGenerator: fix off-by-one for && command joining
Only add `&&` if there is another command after the current one.
2023-05-16 12:48:20 -04:00
Ben Boeckel
c715fd8d76 cmGlobalGenerator: quote commands in ::Build output
Now that these are going to be visible when running with `--verbose`,
properly quote things so that they can be used as-is.
2023-05-16 12:48:19 -04:00
Ben Boeckel
d6c0e827bc cmGlobalGenerator: add a QuotedPrintable method for commands 2023-05-16 12:47:50 -04:00
Ben Boeckel
28ee3bef34 cmGlobalGenerator: add missing spaces in output
The preludes to commands should have a space to separate them from the
first argument of the command sequence.
2023-05-16 12:47:50 -04:00
Ben Boeckel
465ab8d872 cmGlobalGenerator: use cmStrCat in ::Build
Also replace some single-char strings with character literals.
2023-05-16 12:15:31 -04:00
Marc Chevrier
241304190f CMake code rely on cmList class for CMake lists management (part. 2) 2023-04-29 09:54:31 +02:00
Marc Chevrier
e08ba229ee CMake code rely on cmList class for CMake lists management (part. 1) 2023-04-24 10:41:10 +02:00
Orkun Tokdemir
69cf9700e6 Autogen: Defer setup until Generate step
It is better to set variables up once all target dependencies are known.
2023-04-05 16:12:16 -04:00
Brad King
17e6b2bdca Merge topic 'automoc-cxx-standard'
429a452705 Autogen: Add target's C++ standard to moc_predef.h
21f812e57c Autogen: Split creation and setup of custom targets into separate steps

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8359
2023-03-31 08:09:06 -04:00
Brad King
689616785f macOS: Do not pass Apple-specific flags to llvm-strip
Since commit cf82300a63 (BinUtils: Clarify search logic and make it more
consistent, 2021-05-27, v3.21.0-rc1~119^2~2) we prefer `llvm-strip` over
`strip` when using Clang.  However, since commit 20291e8e72 (install:
Fix stripping on macOS, 2019-01-30, v3.14.0-rc1~31^2) on macOS we add
flags `-u -r`, needed by Apple's `strip` for executables, but that
`llvm-strip` does not need or support.  Improve the condition to add
Apple-specific flags only when the selected `strip` tool is Apple's.

Note that Apple dylibs must be stripped with `-x` with either Apple's
`strip` or `llvm-strip`.

Fixes: #24601
2023-03-29 15:19:47 -04:00
Brad King
367aa65a9f Merge topic 'module-depends-static-lib-cycle'
01d7860fdb Ninja,Makefile: Restore Fortran module scanning in static library cycle
846baa7c5b cmGlobalGenerator: Factor out helper to check target ordering

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8363
2023-03-27 09:51:59 -04:00
Brad King
846baa7c5b cmGlobalGenerator: Factor out helper to check target ordering 2023-03-24 15:57:52 -04:00
Orkun Tokdemir
21f812e57c Autogen: Split creation and setup of custom targets into separate steps
Defer the setup step until after compile features have been finalized on
normal targets.  Later this will help pass the information to Qt tools.

Issue: #24624
2023-03-24 12:23:47 -04:00
Brad King
88bc8dfc14 cmMakefile: Store recursion depth limit as size_t 2023-03-13 11:32:03 -04:00
Brad King
ef5a4d964b Deprecate "extra" generators in favor of cmake-file-api(7)
The "extra" generators were created in CMake's early years to provide
support for users of specific IDEs by directly generating their project
files alongside make or ninja files.  Nowadays the file-api provides a
more generic, maintainable, well-tested, and robust way for IDEs to view
CMake project build trees.  Deprecate the legacy "extra" generators to
encourage the corresponding IDEs to use the file-api.

Fixes: #19090
2023-02-15 10:48:26 -05:00
Kyle Edwards
2b17b6da6a cmGlobalGenerator: Avoid referencing CMAKE_CFG_INTDIR 2023-02-03 11:24:57 -05:00
Brad King
f4d604f77f Merge topic 'try_compile-verbose'
faa950a155 try_compile: Run native build tool with verbose output

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8095
2023-01-23 10:34:37 -05:00
Brad King
06c7e88b91 Merge topic 'configure-log'
317aac14ef cmake: Stop pointing users at logs on configure errors
eae1398d09 cmake --system-information: Stop dumping CMake{Output,Error}.log

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8094
2023-01-20 09:37:08 -05:00
Brad King
526b2db5d3 Merge topic 'print-configure-generate-time'
5f0c5ec49b cmake: Print configure/generate time

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: scivision <michael@scivision.dev>
Merge-request: !8083
2023-01-20 09:32:45 -05:00
Brad King
faa950a155 try_compile: Run native build tool with verbose output
Make the compiler command lines visible in the configure log.

Issue: #23200
2023-01-20 09:17:51 -05:00
Brad King
317aac14ef cmake: Stop pointing users at logs on configure errors
Since commit 18e1bfbb3c (cmake: On configure error suggest looking at
CMake*.log files, 2013-07-09, v2.8.12~210^2), when configuring a project
fails, we print `See also .../CMake{Output,Error}.log` near the end of
the output.  This was intended to help users find failures in system and
compiler inspection checks, but for normal project errors the messages
may be misleading.  The logs may contain incidental errors that are part
of normal operation and do not need to be addressed by the user.

Since commit f6ed2585e5 (Modules: Record system inspection steps in the
configure log, 2023-01-16), CMake's builtin modules no longer log
information to the old-style `CMake{Output,Error}.log` files anyway,
so stop mentioning them.

Fixes: #22131
Issue: #23200
2023-01-19 13:27:51 -05:00
Kyle Edwards
5f0c5ec49b cmake: Print configure/generate time 2023-01-19 09:51:07 -05:00
Vitaly Stakhovsky
b3edfcf46e cmValue: Use operator* explicitly to convert to std::string; avoid extra call 2023-01-15 23:39:02 -05:00
Ben Boeckel
5e026739e1 cmGlobalGenerator: factor out C++ module support checking
This will simplify adding support to other generators.
2022-11-23 17:31:31 -05:00