Commit Graph

37456 Commits

Author SHA1 Message Date
Tolga Mizrak 607d9cf561 WINDOWS_EXPORT_ALL_SYMBOLS: Do not export C++ operators declared extern "C"
The pattern `extern "C" { inline bool operator==(...) {} }` appears
in at least one Windows SDK header, `winnt.h`.  Translation units that
instantiate the inline symbol produce object files with a symbol named
just `==`.  Avoid exporting such symbols because the linker will not
recognize them.

Fixes: #24999
2025-05-21 08:07:54 -04:00
Tolga Mizrak 8f8b2e9429 bindexplib: Truncate short symbol names on first embedded null-terminator 2025-05-20 14:19:49 -04:00
Kitware Robot 5d70f07db5 CMake Nightly Date Stamp 2025-05-15 00:04:30 -04:00
Brad King c4b4e26019 Merge topic 'stdio-console'
ce6b0f9e10 ci: Drop unused build artifact
7cf81cdb04 Merge branch 'upstream-KWSys' into stdio-console
ad2d94cb9d KWSys 2025-05-14 (1d72955e)
40b0db5ffb cmConsoleBuf: Remove unused infrastructure
57b24e8fef StdIo: Init() automatically in Console()
3e88020aed StdIo: Replace uses of KWSys ConsoleBuf with StdIo::Console
f9f1f9a8cd StdIo: Add a Windows Console adaptor for cin, cout, and cerr

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10769
2025-05-14 10:11:23 -04:00
Brad King 7cf81cdb04 Merge branch 'upstream-KWSys' into stdio-console
# By KWSys Upstream
* upstream-KWSys:
  KWSys 2025-05-14 (1d72955e)
2025-05-14 09:05:09 -04:00
Brad King 7deaa4dfb8 Merge topic 'warn-invalid-experimental'
9036aa10f3 Experimental: provide useful warning for invalid experimental variable values
b05e5403d9 Experimental: Avoid mutating statically allocated data
348ba701fe Tests/RunCMake/cmake_language: Expect experimental warnings more precisely

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10767
2025-05-14 09:02:29 -04:00
Kitware Robot c3d20800c6 CMake Nightly Date Stamp 2025-05-14 00:04:33 -04:00
Brad King 40b0db5ffb cmConsoleBuf: Remove unused infrastructure
It has been replaced by `cm::StdIo::Console`.
2025-05-13 10:53:36 -04:00
Brad King 57b24e8fef StdIo: Init() automatically in Console()
Applications that initialize a `cm::StdIo::Console` immediately no
longer need to `cm::StdIo::Init` first.
2025-05-13 10:35:47 -04:00
Brad King 3e88020aed StdIo: Replace uses of KWSys ConsoleBuf with StdIo::Console
Issue: #26924
2025-05-13 10:35:47 -04:00
Brad King f9f1f9a8cd StdIo: Add a Windows Console adaptor for cin, cout, and cerr
On Windows, the only reliable way to read/write Unicode text from/to a
Console is to use `ReadConsoleW` and `WriteConsoleW` and convert from/to
wide-character encoding.  When `cin`, `cout`, and/or `cerr` are attached
to a Windows Console, use a custom C++ `streambuf` to handle the I/O.

This will replace KWSys ConsoleBuf, whose implementation is more complex
to support narrow output streams on Windows non-UTF-8 narrow encodings.
We only need to support UTF-8.

Issue: #26924
2025-05-13 10:35:47 -04:00
Bill Hoffman 9036aa10f3 Experimental: provide useful warning for invalid experimental variable values
Provide a useful warning if an invalid UUID is given in a
`CMAKE_EXPERIMENTAL_` variable.  This can occur if a different CMake
version is used than the one that the feature was implemented with, or
if there is a simple typo in the value.  It should reduce confusion with
the use of experimental features.

Co-authored-by: Brad King <brad.king@kitware.com>
2025-05-13 10:29:58 -04:00
Brad King b05e5403d9 Experimental: Avoid mutating statically allocated data 2025-05-13 10:25:02 -04:00
Kitware Robot 9d41f67319 CMake Nightly Date Stamp 2025-05-13 00:04:21 -04:00
Brad King 4802077fb9 Merge topic 'stdio-streams'
d6a1ff59f1 StdIo: Provide metadata about stdin, stdout, stderr streams

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10759
2025-05-12 09:37:04 -04:00
Brad King 54caca4cfa Merge topic 'configure-log-find-package-v1'
e324478e9b Tests/RunCMake/find_package: test ConfigureLog behaviors (parameters)
632661795d Tests/RunCMake/find_package: test ConfigureLog behaviors (version requests)
3b01fdb761 Tests/RunCMake/find_package: test ConfigureLog behaviors (version skips)
63a90f13c2 Tests/RunCMake/find_package: test ConfigureLog behaviors (nested config)
e594ea8dfb Tests/RunCMake/find_package: test ConfigureLog behaviors (module)
48575b554b Tests/RunCMake/find_package: test ConfigureLog behaviors (config)
8df9819839 find_package: generate `find_package-v1` configure log events
20a1f26127 cmConfigureLog: support writing array values

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10737
2025-05-12 09:30:32 -04:00
Brad King a1e1578e18 Merge topic 'update-kwsys'
dd162ac3be Merge branch 'upstream-KWSys' into update-kwsys
9df0cea115 KWSys 2025-05-09 (c1e5779a)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10757
2025-05-12 08:11:56 -04:00
Kitware Robot 31309ca2bb CMake Nightly Date Stamp 2025-05-12 00:14:28 -04:00
Brad King d6a1ff59f1 StdIo: Provide metadata about stdin, stdout, stderr streams
Detect the kind of terminal to which they are attached, if any.

Issue: #26924
2025-05-11 09:13:16 -04:00
Kitware Robot 528a04ec66 CMake Nightly Date Stamp 2025-05-11 00:05:10 -04:00
Kitware Robot 6ea1f5013d CMake Nightly Date Stamp 2025-05-10 00:04:33 -04:00
Ben Boeckel 8df9819839 find_package: generate find_package-v1 configure log events
Since `find_package` is far more complex than other `find_*` commands,
it gets its own event.

Closes: #24833
2025-05-09 16:46:43 +02:00
Ben Boeckel 20a1f26127 cmConfigureLog: support writing array values 2025-05-09 16:44:27 +02:00
Brad King 151a635325 Merge topic 'stdio-init'
cef4676d3a StdIo: Factor out helper to initialize stdin, stdout, and stderr

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10753
2025-05-09 09:25:01 -04:00
Brad King dd162ac3be Merge branch 'upstream-KWSys' into update-kwsys
# By KWSys Upstream
* upstream-KWSys:
  KWSys 2025-05-09 (c1e5779a)
2025-05-09 08:58:22 -04:00
Kitware Robot 17c484d94c CMake Nightly Date Stamp 2025-05-09 00:04:31 -04:00
Brad King cef4676d3a StdIo: Factor out helper to initialize stdin, stdout, and stderr
Move logic from commit c85524a94a (Ensure stdin, stdout, and stderr pipes
are always open, 2019-05-02, v3.15.0-rc1~171^2) and commit 96010cc968
(Ensure stdin, stdout, stderr FILE streams are open on Windows, 2024-01-24,
v3.29.0-rc1~65^2) to a dedicated source.  Expose it through an `Init` class
constructor to make it optionally available during static initialization.

Issue: #26924
2025-05-08 13:39:48 -04:00
Kitware Robot 54ca95a7fc CMake Nightly Date Stamp 2025-05-08 00:04:39 -04:00
Brad King 4d51ad2b0a Merge topic 'install-DIRECTORY-exclude-empty'
b70ef48b27 install(DIRECTORY): Add EXCLUDE_EMPTY_DIRECTORIES option

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10683
2025-05-07 09:45:42 -04:00
Kitware Robot 4cf27ab863 CMake Nightly Date Stamp 2025-05-07 00:07:49 -04:00
Hao Dong b70ef48b27 install(DIRECTORY): Add EXCLUDE_EMPTY_DIRECTORIES option
EXCLUDE_EMPTY_DIRECTORIES option excludes empty directories under the
directory to install. A directory is considered not empty if and only if
the directory contains at least one file or one symbolic link or one
none-empty sub-directory.

Closes: #19189
2025-05-06 10:59:24 -04:00
Kitware Robot 6100efaa2f CMake Nightly Date Stamp 2025-05-06 00:05:39 -04:00
Brad King 8c7ab4e1e6 Merge topic 'asm-no-msvc'
14212494bb ASM: Guard exclusion of MSVC C/CXX compiler with a policy

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10740
2025-05-05 08:55:20 -04:00
Brad King 93cbcd7596 Merge topic 'xcode-debugger-workdir'
149ee3b4bc Xcode: Use DEBUGGER_WORKING_DIRECTORY as a fallback for scheme work dir
0f1b9ef32a Help: VS_DEBUGGER_WORKING_DIRECTORY precedence

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10736
2025-05-05 08:52:54 -04:00
Kitware Robot 528ce5a96c CMake Nightly Date Stamp 2025-05-04 00:09:35 -04:00
Brad King 14212494bb ASM: Guard exclusion of MSVC C/CXX compiler with a policy
Since commit 6baf65ec46 (ASM: Do not consider MSVC C/CXX compiler for
generic ASM, 2025-04-08) we no longer mistake `cl` for an assembler.
However, some projects unconditionally enable ``ASM``, which worked
on Windows only due to that bug.  Restore compatibility with such
projects by guarding the change behind a new policy ``CMP0194``.

Fixes: #26907
Issue: #26617
2025-05-03 13:18:19 -04:00
Craig Scott 149ee3b4bc Xcode: Use DEBUGGER_WORKING_DIRECTORY as a fallback for scheme work dir
This also means when XCODE_SCHEME_WORKING_DIRECTORY is
set and a Xcode generator is used, that property will be used when
writing the debugger field in the file API replies.

Fixes: #26909
2025-05-03 10:16:15 -04:00
Brad King 67f86c7db8 Merge topic 'clang-macos-sdk'
bf1bb62e74 macOS: Restore support for LLVM/Clang without explicit CMAKE_OSX_SYSROOT

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10734
2025-05-03 10:02:18 -04:00
Brad King e49dc061c2 Merge topic 'clang-macos-sdk' into release-4.0
bf1bb62e74 macOS: Restore support for LLVM/Clang without explicit CMAKE_OSX_SYSROOT

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10734
2025-05-03 10:02:16 -04:00
Kitware Robot 7554926e54 CMake Nightly Date Stamp 2025-05-03 00:06:19 -04:00
Brad King bf1bb62e74 macOS: Restore support for LLVM/Clang without explicit CMAKE_OSX_SYSROOT
In commit 7b19531291 (macOS: Do not pass any SDK/-isysroot to compilers
by default, 2024-11-06, v4.0.0-rc1~511^2) we broke support for using
upstream LLVM/Clang to build for macOS because the compiler has no
default sysroot.  Handle empty `CMAKE_OSX_SYSROOT` with LLVM/Clang by
falling back to the macOS SDK reported by `xcrun --show-sdk-path` .

Fixes: #26863
2025-05-02 13:49:40 -04:00
Brad King 52903a0ae4 Merge topic 'find-event-refactor'
fdccb8846c cmFindCommonDebugState: adopt event writing logic
716dfd3b1e cmFindCommon: track debug state as an object
c6d097135d cmFindBaseDebugState: factor out a base class
bd5cb1f8e6 cmFindCommon: use `DebugModeEnabled` to query for debug mode
76ea613f4c cmFindBaseDebugState: get the command name directly from the object

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10713
2025-05-02 11:07:02 -04:00
Brad King 0556c1b455 Merge topic 'fix-find-performane-regression'
bb3a348def find_package: Fix performance regression in 4.0.0 release

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10731
2025-05-01 15:50:28 -04:00
Brad King edec9fbf57 Merge topic 'fix-find-performane-regression' into release-4.0
bb3a348def find_package: Fix performance regression in 4.0.0 release

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10731
2025-05-01 15:50:24 -04:00
Matthew Woehlke bb3a348def find_package: Fix performance regression in 4.0.0 release
In commit e90f60f864 (find_package: Don't glob certain macOS paths,
2024-10-23, v4.0.0-rc1~579^2~1) we changed the name matching logic of
`find_package` to check if a possible match is a directory before
checking whether the name is a match.  In some situations, this results
in unnecessarily calling `stat` for a very large number of files, which
can be extremely slow on some systems (especially Windows).  Fix this by
making the check the last thing we do before accepting a possible match.

Fixes: #26817
2025-05-01 14:48:33 -04:00
Brad King 74e677f62b Merge topic 'clang-libstdcpp-support'
5750fcd7b4 ci: enable `import_std23` module compilation with clang
52e2785018 experimental/CXXModules: recycle the UUID
28333c4516 Clang/CXXImportStd: support `-stdlib=libstdc++`

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10727
2025-05-01 08:40:49 -04:00
Brad King 6514fdebab Merge topic 'fix-cps-relative-name-mangling'
9081e73104 CPS: Fix mangling of relative requirement names

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !10729
2025-05-01 08:31:20 -04:00
Ben Boeckel fdccb8846c cmFindCommonDebugState: adopt event writing logic
This lays the groundwork for `find_package` also using the same
triggering logic.
2025-05-01 12:47:24 +02:00
Kitware Robot 0823acb5ef CMake Nightly Date Stamp 2025-05-01 00:04:14 -04:00
Matthew Woehlke 9081e73104 CPS: Fix mangling of relative requirement names
CPS names look like `[package]:component`, which needs to get mangled
into `package::component` to match CMake's convention. This was
implemented correctly for fully qualified component requirements, but
relative names were not being properly mangled. Adjust handling of
relative names to correctly translate from CPS to CMake convention.
2025-04-30 11:56:09 -04:00