summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/try_compile
Commit message (Collapse)AuthorAgeFilesLines
* try_compile: Record propagated CMake variables in configure logBrad King2023-02-013-0/+32
| | | | | | | These provide more detailed information about how the test project was configured. Issue: #23200
* Tests: Match configure log try_compile directories more preciselyBrad King2023-01-242-10/+10
| | | | | 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 '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 'print-configure-generate-time'Brad King2023-01-203-6/+6
|\ \ | |/ |/| | | | | | | | | | | | | 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-193-6/+6
| |
* | Modules: Record system inspection steps in the configure logBrad King2023-01-183-6/+51
| | | | | | | | | | | | | | | | 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-181-7/+16
|/ | | | These log files will soon go away, so avoid using them in tests.
* try_compile: Record stack of in-progess checks in configure logBrad King2023-01-164-0/+22
| | | | | | | | 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-161-0/+5
|
* try_compile: Add optional LOG_DESCRIPTION to record in configure logBrad King2023-01-168-0/+28
| | | | Issue: #23200
* Tests: Add explicit ConfigureLog case to RunCMake.try_compileBrad King2023-01-165-0/+60
|
* ConfigureLog: Version individual events instead of the whole logBrad King2022-12-161-5/+2
| | | | | | | | In order to support multiple log versions without buffering the entire log, move versioning to the level of individual events. Multiple versions of an event may then be logged consecutively. Issue: #23200
* ConfigureLog: Log try_compile and try_run checksMatthew Woehlke2022-12-162-0/+38
| | | | | | Add configure log events for `try_compile` and `try_run` results. Issue: #23200
* Merge topic 'try_compile-copy-config'Brad King2022-11-232-0/+9
|\ | | | | | | | | | | | | | | | | 80fc564dd7 try_compile: Restore COPY_FILE with CMAKE_TRY_COMPILE_CONFIGURATION Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Acked-by: Robert Maynard <robertjmaynard@gmail.com> Merge-request: !7948
| * try_compile: Restore COPY_FILE with CMAKE_TRY_COMPILE_CONFIGURATIONBrad King2022-11-222-0/+9
| | | | | | | | | | | | | | | | | | Since commit 0c141b0393 (try_compile: Record output location instead of reverse computing it, 2022-08-31, v3.25.0-rc1~154^2) we always look for the "Debug" configuration's output binary from the test project. Restore looking for the `CMAKE_TRY_COMPILE_CONFIGURATION`. Fixes: #24180
| * Merge topic 'try_compile-CMP0128' into release-3.25Brad King2022-10-251-4/+5
| |\ | | | | | | | | | | | | | | | | | | 90287792b6 Tests: Avoid running C++11 test on GNU < 4.7 Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7821
| * \ Merge topic 'try_compile-CMP0128' into release-3.25Brad King2022-10-195-0/+66
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 50e90e2828 try_compile: Honor CMP0128 setting in test project Acked-by: Kitware Robot <kwrobot@kitware.com> Reviewed-by: Raul Tambre <raul@tambre.ee> Merge-request: !7803
* | | | Tests: Simplify RunCMake.try_compile compiler inspectionBrad King2022-10-312-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Detect the compiler id, version, and default standard level in the test's inspection step rather than passing it all in from the host CMake build's results. This avoids repeating details not known to older versions of CMake, and shortens the code.
* | | | Tests: Fix logic to enable RunCMake.try_compile OBJC/OBJCXX casesBrad King2022-10-312-9/+26
| | | | | | | | | | | | | | | | | | | | | | | | CMake itself does not enable the OBJC/OBJCXX languages, so the `CMAKE_OBJ{C,CXX}_STANDARD_DEFAULT` variables are never defined. Detect them inside the test instead.
* | | | Merge topic 'try_compile-CMP0128'Brad King2022-10-251-4/+5
|\ \ \ \ | | |_|/ | |/| | | | | | | | | | | | | | | | | | 90287792b6 Tests: Avoid running C++11 test on GNU < 4.7 Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7821
| * | | Tests: Avoid running C++11 test on GNU < 4.7Brad King2022-10-241-4/+5
| | |/ | |/| | | | | | | | | | | | | The test added in commit 50e90e2828 (try_compile: Honor CMP0128 setting in test project, 2022-10-18, v3.25.0-rc2~4^2) requires that the compiler support C++11 mode, so do not run it on GNU compilers that are too old.
* | | Merge topic 'try_compile-CMP0128'Brad King2022-10-195-0/+66
|\ \ \ | |/ / | | / | |/ |/| | | | | | | 50e90e2828 try_compile: Honor CMP0128 setting in test project Acked-by: Kitware Robot <kwrobot@kitware.com> Reviewed-by: Raul Tambre <raul@tambre.ee> Merge-request: !7803
| * try_compile: Honor CMP0128 setting in test projectBrad King2022-10-185-0/+66
| | | | | | | | | | | | | | | | | | Some projects pass a raw `-std=` flag to the compiler in the `try_compile` project. If they do not set CMP0128 to NEW, we should not append a `-std=` flag where we did not before the policy was added. Fixes: #24063
* | try_compile: Report build dir with --debug-trycompileMatthew Woehlke2022-10-062-0/+22
| | | | | | | | | | | | | | | | When `--debug-trycompile` is enabled, issue a log (with trace) for every `try_compile` noting what directory is being used for the compilation. This will make it easier to find the corresponding artifacts. Closes: #24022
* | try_compile: Rename SOURCE_FROM_ARG -> SOURCE_FROM_CONTENTMatthew Woehlke2022-09-306-6/+6
| | | | | | | | | | | | | | | | | | Change the SOURCE_FROM_ARG keyword to try_compile to SOURCE_FROM_CONTENT (which we can do because it was recently added and hasn't been in a release yet). The new name should be clearer as to what it does, and also more consistent with the CONTENT arguments to some other commands. Also, fix a typo in an error message.
* | Merge topic 'try_compile-source-from'Brad King2022-09-2313-0/+29
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | 611d801790 try_compile: Add SOURCE_FROM_FILE a04eaf6742 Tests: Clean up and simplify TryCompile tests cb14ae2b87 try_compile: Add SOURCE_FROM_{ARG,VAR} Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !7700
| * | try_compile: Add SOURCE_FROM_FILEMatthew Woehlke2022-09-224-0/+7
| | | | | | | | | | | | | | | | | | | | | Add ability to copy try_compile (and try_run) source files from arbitrary locations into the operation directory. This is included for the sake of completion and consolidation, although use cases which actually require this may be rare.
| * | try_compile: Add SOURCE_FROM_{ARG,VAR}Matthew Woehlke2022-09-2210-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | Add ability to "feed" try_compile (and try_run) sources more directly, either from literal content, or from a CMake variable which contains literal content. This saves the user from needing a separate step to write the content to a file, and allows for the sources to only exist in the scratch directory.
* | | Merge topic 'try_compile-more-consistent-errors'Brad King2022-09-202-2/+2
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | 30a234d275 try_compile: Improve error message consistency Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !7696
| * | try_compile: Improve error message consistencyMatthew Woehlke2022-09-162-2/+2
| | | | | | | | | | | | | | | Tweak some error messages from try_compile (and try_run) to be more consistent with each other.
* | | Merge topic 'add-try_compile-test-documentation'Brad King2022-09-191-0/+9
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | e933fccc7e Tests: document try_{compile,run} old/new signature testing Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !7681
| * | | Tests: document try_{compile,run} old/new signature testingMatthew Woehlke2022-09-151-0/+9
| | | | | | | | | | | | | | | | | | | | Add a brief documentation blurb to the try_compile and try_run test sets on writing tests for both "old" and "new" signatures.
* | | | Merge topic 'improve-try_compile-arg-error'Brad King2022-09-193-3/+3
|\ \ \ \ | |_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | f976800577 try_compile: More useful error if insufficient arguments Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !7682
| * | | try_compile: More useful error if insufficient argumentsMatthew Woehlke2022-09-153-3/+3
| |/ / | | | | | | | | | | | | Tweak try_compile and try_run to give a more informative error (rather than "unknown error") when given an insufficient number of arguments.
* | | Merge topic 'try_compile-new-project-signature'Brad King2022-09-1619-0/+51
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | 56ae40cc59 try_compile: Add PROJECT keyword-dispatched signature Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !7677
| * | try_compile: Add PROJECT keyword-dispatched signatureMatthew Woehlke2022-09-1419-0/+51
| | | | | | | | | | | | | | | | | | | | | Introduce a new signature for the project flavor of try_compile (and try_run) which removes the `bindir` argument and adds a required PROJECT tag. This is similar to the SOURCES flavor added by commit aa9220d3 (try_compile: Add keyword-dispatched signature, 2022-09-02).
* | | Tests: Fix recently added testsMatthew Woehlke2022-09-143-3/+9
|/ / | | | | | | | | | | Fix the tests added by commit 0c141b03 (try_compile: Record output location instead of reverse computing it, 2022-08-31), which were added as old-and-new-signature tests but only used the old signature.
* | try_compile: Record output location instead of reverse computing itRobert Maynard2022-09-074-0/+23
| | | | | | | | Fixes #23887, #23942, #20163, #18288
* | try_compile: Add keyword-dispatched signatureMatthew Woehlke2022-09-0556-136/+258
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce a new signature for try_compile (and try_run) which removes the `bindir` argument and requires the SOURCES tag. This will eventually allow us to add other ways of providing sources, but also allows us to change the behavior without breaking compatibility. The old signature uses a special, but non-unique temporary location inside the specified `bindir`, which conventionally is just the project's build directory. The new signature unconditionally uses the a unique temporary directory which is unconditionally within the project's build directory (which is no longer separately specified). This ensures that successive runs do not overwrite previous runs, will simplify debugging, and should also, eventually, allow us to execute multiple trials in parallel.
* | try_compile: Don't accept try_run argumentsMatthew Woehlke2022-08-171-8/+13
| | | | | | | | | | | | | | | | | | | | | | Modify cmCoreTryCompile to only recognize try_run arguments when actually parsing try_run. (The old behavior was to recognize try_run arguments for try_compile also and then complain.) This has a small chance that a try_run keyword will be consumed as part of a multi-valued keyword argument. However, this behavior is more consistent with other commands, as we don't normally treat keywords as universally reserved. Also, the code is noticeably simplified.
* | cmCoreTryCompile: Port to cmArgumentParserBrad King2022-08-0211-73/+44
| |
* | Tests: Add RunCMake.try_compile case for try_run-only argsBrad King2022-08-023-0/+83
| |
* | Tests: Add RunCMake.try_compile case covering empty value argumentsBrad King2022-07-264-0/+15
| |
* | Tests: Add RunCMake.try_compile case covering list arguments with no valuesBrad King2022-07-262-0/+9
| |
* | try_compile: Fail earlier when bindir is not an absolute pathBrad King2022-07-267-0/+16
| | | | | | | | | | If the bindir is not an absolute path, other errors occur later. Fail early with a clear error in this case.
* | cmTarget: add support for C++ module fileset typesBen Boeckel2022-06-161-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | C++ modules have two variants which are of importance to CMake: - `CXX_MODULES`: interface modules (those using `export module M;`, `export module M:part;`, or `module M:internal_part;`) - `CXX_MODULE_HEADER_UNITS`: importable header units Creating C++ modules or partitions are *not* supported in any other source listing. This is because the source files must be installed (so their scope matters), but not part of usage requirements (what it means for a module source to be injected into a consumer is not clear at this moment). Due to the way `FILE_SET` works with scopes, they are a perfect fit as long as `INTERFACE` is not allowed (which it is not).
* | try_compile: Add option to skip passing platform variablesBrad King2022-05-163-0/+14
| | | | | | | | | | | | | | Add a `CMAKE_TRY_COMPILE_NO_PLATFORM_VARIABLES` variable to tell `try_compile` not to pass platform variables to the test project. Issue: #23219
* | try_compile: Propagate platform variables in project-mode tooBrad King2022-05-167-0/+24
|/ | | | | | | | | Add policy CMP0137 to propagate both our builtin variables and those listed by `CMAKE_TRY_COMPILE_PLATFORM_VARIABLES` to `try_compile` whole-project builds. Inspired-by: Alexander Neumann <Alexander.Neumann@hamburg.de> Fixes: #23219
* Merge topic 'env-init-configs'Brad King2021-11-233-0/+27
|\ | | | | | | | | | | | | | | 5b1ed2a646 try_compile: Do not use CMAKE_BUILD_TYPE or CMAKE_CONFIGURATION_TYPES env vars Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !6755