summaryrefslogtreecommitdiff
path: root/Tests
Commit message (Collapse)AuthorAgeFilesLines
* try_compile: Record propagated CMake variables in configure logBrad King2023-02-014-0/+47
| | | | | | | These provide more detailed information about how the test project was configured. Issue: #23200
* Merge topic 'msvc-showIncludes'Brad King2023-01-3034-18/+146
|\ | | | | | | | | | | | | | | | | | | | | 8f82e755f3 Ninja: Fix detection of MSVC showIncludes prefix in Italian d6e7e4d4a1 Tests: Extend RunCMake.Ninja ShowIncludes cases to cover more languages 9596305c0b Tests: Generalize RunCMake.Ninja ShowIncludes test infrastructure c6dd4fa21d Tests: Extend RunCMake.Ninja ShowIncludes case with sample path a9d97492fd Ninja: Record showIncludes detection in configure log Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8129
| * Ninja: Fix detection of MSVC showIncludes prefix in ItalianBrad King2023-01-285-0/+15
| | | | | | | | | | | | The prefix does not have two colons. Update our regex. Fixes: #24357
| * Tests: Extend RunCMake.Ninja ShowIncludes cases to cover more languagesBrad King2023-01-2821-0/+93
| | | | | | | | Add cases for English, French, German, and Japanese.
| * Tests: Generalize RunCMake.Ninja ShowIncludes test infrastructureBrad King2023-01-2810-15/+35
| | | | | | | | Prepare to add support for more languages.
| * Tests: Extend RunCMake.Ninja ShowIncludes case with sample pathBrad King2023-01-275-6/+6
| | | | | | | | Verify that the prefix is separated from the path.
* | Merge topic 'cxxmodules-export-iface-names-test'Brad King2023-01-3017-14/+251
|\ \ | | | | | | | | | | | | | | | | | | | | | f755296f9d Tests/RunCMake/CXXModules: add tests which don't export C++ module properties Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !8126
| * | Tests/RunCMake/CXXModules: add tests which don't export C++ module propertiesBen Boeckel2023-01-2617-14/+251
| | | | | | | | | | | | | | | | | | | | | The existing `export-interfaces-{build,install}` tests were actually doing this, but make those test exporting the interfaces and copy the existing tests to tests which explicitly test the "no properties" condition.
* | | FindImageMagick: Define targets for specific componentshstejas2023-01-275-0/+42
| |/ |/| | | | | | | | | | | - With this change we can use e.g. ImageMagick::Magick++ directly in targt_link_libraries. - This change also adds CFLAGS which was missing before. - Also adds example on how to use the targets.
* | VS: Honor compile options for ASM_NASMBrad King2023-01-262-1/+7
| | | | | | | | | | | | | | | | The Ninja and Makefile generators honor `target_compile_options` and friends for ASM_NASM `.asm` sources. Teach the VS generator to honor them too for consistency. Issue: #24289
* | VS: Honor compile options for ASM_MARMASMBrad King2023-01-262-1/+4
| | | | | | | | | | | | | | | | The Ninja and Makefile generators honor `target_compile_options` and friends for ASM_MARMMASM `.asm` sources. Teach the VS generator to honor them too for consistency. Issue: #24289
* | Xcode: Inherit Swift flags and compilation conditionsRoss Kilgariff2023-01-254-2/+32
| | | | | | | | | | | | | | | | Extend the change from commit dfaf55fbfd (Xcode: add extra '$(inherited)' entries using InheritBuildSettingAttribute, 2021-05-03, v3.21.0-rc1~182^2) to cover Swift flags and compilation conditions, allowing CocoaPods and CMake to interoperate when used in the same project.
* | Merge topic 'test-try_compile-matching'Brad King2023-01-253-20/+20
|\ \ | | | | | | | | | | | | | | | | | | | | | 7db4df2e8c Tests: Match configure log try_compile directories more precisely Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !8114
| * | Tests: Match configure log try_compile directories more preciselyBrad King2023-01-243-20/+20
| |/ | | | | | | | | Do not accept a double-quote in the `try_compile` work directory to ensure we do not match more than the field value.
* | Merge topic 'isdir_empty'Brad King2023-01-253-0/+7
|\ \ | | | | | | | | | | | | | | | | | | a1dc38a567 Help: Document behavior of if(EXISTS,IS_DIRECTORY) for empty paths Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8109
| * | Help: Document behavior of if(EXISTS,IS_DIRECTORY) for empty pathsscivision2023-01-243-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Document and add explicit tests for empty string input: `if(EXISTS "")` and `if(IS_DIRECTORY "")` are always false. This avoids need for users to do extra checks due to CMake non-short-circuit logic as below: if("${p}") if(EXISTS "${p}")
* | | Merge topic 'swiftmodule-dependency-tracking'Brad King2023-01-255-0/+49
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | 1730d208b5 Add incremental Swift static lib build test bf3a8ef6d5 Ninja: Swift: Add dependency edge to swiftmodule file d0b469b7e0 Ninja: NFC: refactor swift module name computations Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !8084
| * | Add incremental Swift static lib build testEvan Wilde2023-01-215-0/+49
| |/ | | | | | | | | | | | | | | | | Ensure that we're actually trying to rebuild libB when the public interface for libA changes. Without handling the swiftmodule dependency edge correctly, we would only get a linker error because libA didn't have the symbol that libB depended on. With the fix, we get a proper compiler error because ninja knows to rebuild the intermediate libB when the public interface of libA changes. This is more actionable.
* | Ninja: require Ninja 1.11 for C++ module supportBen Boeckel2023-01-232-2/+2
| | | | | | | | | | See: https://gitlab.kitware.com/cmake/cmake/-/issues/18355#note_1296721 See: https://github.com/ninja-build/ninja/pull/1937
* | Merge topic 'genex-CONFIG-validate-all'Brad King2023-01-233-1/+10
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | 910ada1a88 Genex: $<CONFIG:> syntax of all entries checked 42e417ad12 GeneratorExpression Tests: Remove duplicate test entry Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !8082
| * | Genex: $<CONFIG:> syntax of all entries checkedRobert Maynard2023-01-202-0/+10
| | | | | | | | | | | | Fixes #24327
| * | GeneratorExpression Tests: Remove duplicate test entryRobert Maynard2023-01-171-1/+0
| | |
* | | Merge topic 'try_compile-verbose'Brad King2023-01-234-1/+25
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | faa950a155 try_compile: Run native build tool with verbose output Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8095
| * | try_compile: Run native build tool with verbose outputBrad King2023-01-204-1/+25
| | | | | | | | | | | | | | | | | | Make the compiler command lines visible in the configure log. Issue: #23200
* | | Merge topic 'configure-log'Brad King2023-01-205-14/+0
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | cmake: Stop pointing users at logs on configure errorsBrad King2023-01-195-14/+0
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Merge topic 'ninja-swift-exported-executables'Brad King2023-01-205-1/+27
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | 4165eb3d0b Ninja: Emit swiftmodule from executable with exports Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8048
| * | | Ninja: Emit swiftmodule from executable with exportsEvan Wilde2023-01-195-1/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for tracking the swiftmodules for executables exporting symbols. This fixes a bug in the earlier implementation around emitting the swiftmodule. Previously, the code would use `CMAKE_EXE_EXPORTS_Swift_FLAG` to inject the `-emit-module`, and module path information into the `CMAKE_Swift_LINK_EXECUTABLE` rule. Because Swift skips the build step and only runs during the link phase, these flags were injected in `cmNinjaNormalTargetGenerator::ComputeLinkCmd` instead of `cmLocalGenerator::GetTargetFlags` where it is done normally. Unfortunately, injecting in `ComputeLinkCmd` didn't do anything because we have a `linkCmd` so `ComputeLinkCmd` exits early, before the EXE_EXPORT flags get added to the link command. Instead of playing with that flag, CMake checks `CMAKE_Swift_LINK_EXECUTABLE_WITH_EXPORTS` and uses that as the link rule if it exists and falls back on `CMAKE_Swift_LINK_EXECUTABLE`. I've defined that variable in terms of `CMAKE_Swift_LINK_EXECUTABLE` with the necessary additional flags for emitting the swift module instead. This has the same end effect as the desired behavior, but simplifies things a bit. Since we're generating the swiftmodule for executables with exports, I've also updated the dependency graph to include the swiftmodule as an output in the build dependency graph if the executable has exports. Tests updated: - RunCMake/NoWorkToDo: Ensure that the build graph does not result in unnecessary rebuilds with exporting executables. - SwiftOnly: Ensure that we can consume functions defined in the executable by a library getting linked into said executable.
* | | | Merge topic 'print-configure-generate-time'Brad King2023-01-209-18/+18
|\ \ \ \ | |_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | cmake: Print configure/generate timeKyle Edwards2023-01-199-18/+18
| | |/ | |/|
* | | Merge topic 'configure-log'Brad King2023-01-1912-27/+106
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | f6ed2585e5 Modules: Record system inspection steps in the configure log 0f688386ea Modules: Drop redundant check logging to CMakeOutput.log and CMakeError.log ecc26f98eb UsewxWidgets: Remove leftover debugging code 874c2e1198 FindQt4: Drop outdated advice to look at CMakeError.log on failure a80465bcad GHS: Drop debugging message from log 9199449687 CompileFeatures: Warn explicitly when feature detection binary is not found 24ccc8c3c9 CompilerId: Restore logging of failed identifications 95976514f6 Tests: Avoid using CMake{Output,Error}.log files Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8089
| * | | Modules: Record system inspection steps in the configure logBrad King2023-01-186-10/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace old-style `file(APPEND .../CMake{Output,Error}.log)` logging with calls to `message(CONFIGURE_LOG)` to record the steps in the `CMakeConfigureLog.yaml` configure log instead. Issue: #23200
| * | | Tests: Avoid using CMake{Output,Error}.log filesBrad King2023-01-186-17/+35
| | | | | | | | | | | | | | | | These log files will soon go away, so avoid using them in tests.
* | | | Merge topic 'optimize-full-name-function'Brad King2023-01-191-1/+1
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a525f5f1bf cmGeneratorTarget: Cache full name components Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !8033
| * | | | cmGeneratorTarget: Cache full name componentsPierre Testart2023-01-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Cache the result of cmGeneratorTarget::GetFullNameInternalComponents to improve performance.
* | | | | Revise C++ coding style using clang-format-15Kitware Robot2023-01-1841-54/+66
| |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Run the `clang-format.bash` script to update all our C and C++ code to a new style defined by `.clang-format`. Use `clang-format` version 15. * If you reached this commit for a line in `git blame`, re-run the blame operation starting at the parent of this commit to see older history for the content. * See the parent commit for instructions to rebase a change across this style transition commit. Fixes: #24315
* | | | Merge topic 'configure-log'Brad King2023-01-188-1/+50
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a78cba5197 message: Add CONFIGURE_LOG mode to record a message in the configure log 645671d36f Help: Document configure log behavior in try_compile and try_run Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8080
| * | | | message: Add CONFIGURE_LOG mode to record a message in the configure logBrad King2023-01-188-1/+50
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | Provide a replacement for `file(APPEND .../CMake{Output,Error}.log)` that records messages in the configure log. Issue: #23200
* | | | clang-format.bash: Use generic clang-format attributeBrad King2023-01-186-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Specify the clang-format version in the attribute value instead of its name. Issue: #24315
* | | | Merge topic 'add_visbility_flags_to_device_link_line'Brad King2023-01-186-13/+32
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 0c56bdf91e CUDA: device linking obeys CMAKE_CUDA_VISIBILITY_PRESET setting Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8065
| * | | | CUDA: device linking obeys CMAKE_CUDA_VISIBILITY_PRESET settingRobert Maynard2023-01-166-13/+32
| | |_|/ | |/| | | | | | | | | | Fixes #24272
* | | | Merge topic 'typo-fix'Brad King2023-01-181-1/+1
|\ \ \ \ | |_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | 99614e06be Source: Fix a few typos Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !8078
| * | | Source: Fix a few typosVitaly Stakhovsky2023-01-171-1/+1
| | | |
* | | | Merge topic 'configure-log'Brad King2023-01-1716-0/+144
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 48292c8624 try_compile: Record stack of in-progess checks in configure log d4bf7d80c6 try_compile: Add a NO_LOG option to skip recording in the configure log 9d9e8450a8 try_compile: Add optional LOG_DESCRIPTION to record in configure log 65ed5c2ca8 try_compile: Report underlying error when COPY_FILE fails 0418efb7ad Tests: Add explicit ConfigureLog case to RunCMake.try_compile 189557bd74 cmake: Make entire in-progress check stack available internally 96ce3581ab Help: Clarify backtrace order in cmake-configure-log(7) Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !8072
| * | | | try_compile: Record stack of in-progess checks in configure logBrad King2023-01-167-0/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many `try_compile` and `try_run` calls occur inside check modules between `message(CHECK_START)` and `message(CHECK_{PASS,FAIL})` pairs. Add a field to configure log entries to report this context. Issue: #23200
| * | | | try_compile: Add a NO_LOG option to skip recording in the configure logBrad King2023-01-162-0/+10
| | | | |
| * | | | try_compile: Add optional LOG_DESCRIPTION to record in configure logBrad King2023-01-1610-0/+32
| | | | | | | | | | | | | | | | | | | | Issue: #23200
| * | | | Tests: Add explicit ConfigureLog case to RunCMake.try_compileBrad King2023-01-165-0/+60
| |/ / /
* | | | Merge topic 'ctest-no-tests-action-env-var'Brad King2023-01-179-0/+16
|\ \ \ \ | |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | 0661de58d8 ctest(1): Add CTEST_NO_TESTS_ACTION env var Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !8044
| * | | ctest(1): Add CTEST_NO_TESTS_ACTION env varfriendlyanon2023-01-139-0/+16
| |/ / | | | | | | | | | | | | This environment variable provides a default value for the --no-tests=<action> command line argument.