Commit Graph

90 Commits

Author SHA1 Message Date
Ben Boeckel
050f891d81 Tests: choose an explicit FULL strategy in tests expecting it
Since it can be set in the environment when running the test suite,
guard tests which are sensitive to intermediate directory strategy
changes with explicit settings.
2025-07-29 08:06:30 -04:00
Craig Scott
aa63990ca9 file API: Add JSON schema files
Fixes: #26987
2025-07-26 18:51:27 +10:00
Craig Scott
4315076f2e fileapi: Add codemodelVersion fields to target and directory objects
This will allow JSON schemas for these two types of files to describe the
version-specific content without requiring any outside information.

Fixes: #27031
2025-07-13 14:59:03 +10:00
Vito Gamberini
ea6404b9c4 FileAPI: Ignore unresolved FileSet generators
Fixes: #27054
2025-07-09 10:08:47 -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
a3f273b657 cmFindBase: Create find-v1 configure log events
Record `find_` command events in the configure log, except
`find_package` as it is far more complicated (and will have its own
event kind).

Note that testing only generates the events of interest, there is no
verification. Also note that testing that the "found" to "notfound"
transition causes an event is not testable because a truthy value in the
variable skips any kind of verification or other logic beyond
normalization.

Co-Authored-by: Ryan Krattiger <ryan.krattiger@kitware.com>
See: #24833
2025-04-28 13:55:36 +02:00
Brad King
0cc962665b fileapi: Generate partial reply when buildsystem generation fails
In particular, the `configureLog` reply is useful for IDEs to read
`CMakeFiles/CMakeConfigureLog.yaml` when configuration fails.

Fixes: #26621
2025-04-14 10:42:03 -04:00
Brad King
5e0a644ee8 Tests/RunCMake/FileAPI: Explicitly specify expected reply index prefix 2025-04-14 09:34:22 -04:00
Stefan Wüthrich
1ae7497b6a fileapi: Restrict reply object file path lengths
Fixes: #23389
2025-01-27 09:49:19 +01:00
Garrett Campbell
0a9fb88121 fileapi: Report DEBUGGER_WORKING_DIRECTORY in codemodel-v2 target objects
Closes: #16478
2024-12-10 09:04:31 -05:00
Brad King
200efab4d4 Tests/RunCMake/FileAPI: Improve error on unexpected line numbers 2024-12-06 18:05:20 -05:00
Brad King
655a245d60 Tests: Explicitly disable AIX_SHARED_LIBRARY_ARCHIVE in some cases
We do not want AIX shared library archives in test cases that rely on
cross-platform appearance of `.so` files.
2024-11-23 15:23:25 -05:00
Brad King
7b19531291 macOS: Do not pass any SDK/-isysroot to compilers by default
On modern macOS, compiler wrappers like `/usr/bin/cc` automatically
choose a SDK to pass via `-isysroot` to an underlying compiler from
Xcode or the CommandLineTools.  Other toolchains like Homebrew's `gcc-*`
come with a default SDK too.  Therefore, when targeting macOS, we no
longer need to choose any SDK or pass an `-isysroot` flag by default.

Update initialization of `CMAKE_OSX_SYSROOT` to be empty by default when
targeting macOS.

Fixes: #19180
2024-11-07 09:46:10 -05:00
Marc Chevrier
61aee8c7bd Add support of "LINKER:" prefix for Windows executable creation
The following variables now support the LINKER: prefix:
* CMAKE_<LANG>_CREATE_WIN32_EXE
* CMAKE_<LANG>_CREATE_CONSOLE_EXE
2024-11-04 17:08:03 +01:00
Arctic Lampyrid
6116bcb066 fileapi: Add CONFIGURE_DEPENDS glob info to cmakeFiles object
Fixes: #25668
Co-authored-by: Brad King <brad.king@kitware.com>
2024-03-19 14:55:25 -04:00
Brad King
13ece67a58 Add genex support to TEST_LAUNCHER and CROSSCOMPILING_EMULATOR
Evaluate generator expressions in these properties, as they apply to
`add_test`, `add_custom_command`, and `add_custom_target`.

The `CMAKE_CROSSCOMPILING_EMULATOR` variable's `try_run` behavior occurs
at configure time and so cannot support generator expressions.
2024-01-29 10:30:24 -05:00
Ralf Habacker
88863d83d6 fileapi: Add test launcher to codemodel-v2
We do not need to bump the minor version because it was recently bumped
by addition of the cross-compiling emulator as another kind of launcher.
2023-12-13 10:20:43 -05:00
Ralf Habacker
478a5f4e04 fileapi: Make launcher attribute 'arguments' optional
This was missed in commit 80a64c9ce5 (fileapi: Add cross-compiling
emulator to codemodel-v2, 2023-11-11).
2023-12-13 10:20:41 -05:00
Ralf Habacker
80a64c9ce5 fileapi: Add cross-compiling emulator to codemodel-v2
Fixes: #25408
2023-12-01 10:57:15 -05:00
Brad King
b6845a689e Merge topic 'fileapi-file-sets-base-dirs-relative'
a3a85524cd fileapi: Fix file sets' base directories relative to top source

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Reviewed-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !8977
2023-11-20 09:13:01 -05:00
Kyle Edwards
a3a85524cd fileapi: Fix file sets' base directories relative to top source
This field was added by commit b3e9fb67bb (file-api: support exporting
file set information, 2022-11-03, v3.26.0-rc1~389^2) but the relative
path convention used elsewhere was accidentally left out.

Fixes: #25422
2023-11-17 07:59:05 -05:00
Ben Boeckel
0c07f39006 cmExperimental: remove the flag for C++ modules
All the major compilers now have scheduled releases with support for
scanning, so remove the experimental gate.

Fixes: #18355
2023-10-02 10:17:31 -04:00
David Lindauer
531b4fe643 OrangeC: Add support for OrangeC compiler
Add compiler information modules.  Update the test suite.

Fixes: #25032
Co-authored-by: Brad King <brad.king@kitware.com>
2023-09-25 12:27:29 -04:00
Ryan Krattiger
80838316a8 CrayClang: Add support for this compiler
Add `CrayClang` compiler ID for newer Cray compilers.

Fixes: #25102
2023-09-22 09:39:52 -04:00
Marc Chevrier
3bdf95f942 macOS: GNU toolchain: ensure framework, marked as SYSTEM, can be linked
Fixes: #25263
2023-09-21 16:29:40 +02:00
Kyle Edwards
e1fe5bb475 Tests: Fix FileAPI interface_exe test 2023-09-01 14:02:44 -04:00
Brad King
0d1529000d VS: Revert "Add CMake input files to ZERO_CHECK"
Since commit df58dbb0e9 (VS: Add CMake input files to ZERO_CHECK,
2023-03-19, v3.27.0-rc1~157^2), projects that specify the same file both
as input to `configure_file` and as the `MAIN_DEPENDENCY` of a custom
command fail to configure.  Revert the change pending further
investigation.  Add a test case demonstrating the problem.

Issue: #24557
Fixes: #25149
2023-08-02 11:53:48 -04:00
Craig Scott
99b2ccf80d cmake_file_api: New project command
Projects can use the new command to request file API replies for the current
run. No query files are generated, the query is tracked internally. Replies are
created in the file system at generation time in the usual way.

Fixes: #24951
2023-06-05 06:20:50 -04:00
Marc Chevrier
b3a6a11e95 fileapi: Extend codemodel targets/compileGroups with Apple frameworks
Fixes: #19897
2023-05-19 12:10:20 +02:00
Alexander Neundorf
df58dbb0e9 VS: Add CMake input files to ZERO_CHECK
Add all cmake input files to the `ZERO_CHECK` project.  Place files
under `CMAKE_SOURCE_DIR` in a folder structure matching the directory
structure.  This way they are easier to find, and Visual Studio does not
close them when reloading the project.

Fixes: #24557
2023-04-25 17:35:39 -04:00
Brad King
a78cba5197 message: Add CONFIGURE_LOG mode to record a message in the configure log
Provide a replacement for `file(APPEND .../CMake{Output,Error}.log)`
that records messages in the configure log.

Issue: #23200
2023-01-18 11:37:11 -05:00
Brad King
d811d86fd7 FileAPI: Add "configureLog" object kind
Provide clients with a way to get a known set of configure log event
versions.

Issue: #23200
2022-12-17 08:52:04 -05:00
Ben Boeckel
b3e9fb67bb file-api: support exporting file set information
This includes listing the filesets themselves as well as which file set
(if any) each source file is associated with.

Fixes: #24128
2022-11-08 10:07:10 -05:00
Brad King
024e3d2bf6 Xcode: Put object files in a place that Xcode cleans
Since commit dc5fc898f6 (Xcode: Set object file locations using
TARGET_TEMP_DIR, 2022-09-29, v3.25.0-rc1~64^2~1), `xcodebuild clean`
does not remove the object files in our explicit `TARGET_TEMP_DIR`
because it is not under the `SYMROOT`.  Put it there.

Fixes: #24096
2022-10-28 15:38:07 -04:00
Brad King
52c95540b7 target_*: Fix cross-directory call backtraces
Record the call-site backtrace, not the current backtrace of the
target's directory.

Fixes: #23873
2022-08-22 15:29:43 -04:00
Brad King
0d64c3abd1 Tests: Add FileAPI case for cross-directory target_* commands
The backtraces for some of the commands incorrectly come from the
target's directory instead of the caller's directory.  Expect the
incorrect backtraces in test results for now.

Increase the minimum required version of CMake in the test case
to enable policy CMP0079 to support cross-directory calls.

Issue: #23873
2022-08-22 14:51:16 -04:00
Brad King
68d3ca7008 Tests: Fix RunCMake.FileAPI test with jsoncpp < 1.7.5
Prior to jsoncpp commit `126bdc2b05` (Reject extra chars if strictRoot,
2016-08-21, 1.7.5~2), it did not diagnose trailing characters in the
input after a JSON value.  Teach our corresponding test case to tolerate
the old behavior.
2022-08-18 15:49:07 -04:00
Ben Boeckel
29118091dc install: support CXX_MODULES_BMI installation bits 2022-07-06 10:15:23 -04:00
Ben Boeckel
c5b56b35c2 cmInstallExportGenerator: expose the temporary directory
This needs to be known so that C++ module properties for the install can
be staged beside the other files.

Always perform the MD5 transformation (in non-bootstrap builds) so that
the path can be computed prior to generation (where it used the longest
configuration name to detect too-long paths). Update tests to expect the
always-present MD5 value. Note that this improves robustness of the test
suite as testing in a too-long path may have triggered the MD5
conversion anyways.
2022-04-28 09:13:48 -04:00
Kyle Edwards
313ea361b0 CMake: Use FindPython instead of FindPythonInterp to build CMake itself
Fixes: #23444
2022-04-21 14:23:36 -04:00
Aaron Liu
6da99e671c IBMClang: Add support for IBM Open XL C/C++
Fixes: #22929
2022-01-27 09:38:01 -05:00
Kyle Edwards
3c3698b0e4 FileAPI: Add information on file set installers 2021-10-27 15:17:23 -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
Kyle Edwards
8d898cb3e1 FileAPI: Add integration for runtime dependency installers 2021-06-04 15:25:18 -04:00
Kyle Edwards
f7ba3a0589 FileAPI: Populate information for IMPORTED_RUNTIME_ARTIFACTS 2021-05-31 09:02:45 -04:00
Nils Gladitz
99ff75455e install: Implement new install(CODE|SCRIPT) option ALL_COMPONENTS
In a per-component installation the generated installation scripts
are invoked once for each component.

Per default custom installation script code added by install(CODE|SCRIPT)
only runs for one specific component in this context.

The new ALL_COMPONENTS option allows custom script code to be run once
for each component being installed.
2021-05-19 19:17:58 +02:00
Orgad Shaneh
ddcd1469e8 MSYS: Add support for running under MSYS runtime environment
Detect MSYS as CYGWIN, with the required adaptations.
2021-04-26 14:27:34 -04:00
Brad King
049bf98f63 fileapi: Add installers to codemodel-v2 "directory" object
Co-Authored-by: Kyle Edwards <kyle.edwards@kitware.com>
2021-03-16 16:47:57 -04:00
Brad King
eae2256a52 fileapi: Add backtraceGraph to codemodel-v2 "directory" object
Co-Authored-by: Kyle Edwards <kyle.edwards@kitware.com>
2021-03-16 16:47:55 -04:00
Brad King
a12d7f70b1 fileapi: Add a "directory" object to codemodel-v2
This object will contain more detailed directory-level information.

Co-Authored-by: Kyle Edwards <kyle.edwards@kitware.com>
2021-03-16 16:47:43 -04:00