summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'backport-3.17-graphviz-restore-per-target' into release-3.17Brad King2020-07-213-0/+56
|\ | | | | | | Merge-request: !5039
| * Tests: Cover Graphviz support for per-target dependency graph optionsStephan Rohmen2020-07-213-0/+56
| | | | | | | | Issue: #20928
* | Merge topic 'pch-fix-bad-ClearSourcesCache' into release-3.17Brad King2020-06-011-2/+5
|\ \ | | | | | | | | | | | | | | | | | | | | | 902858367f Merge branch 'backport-3.16-pch-fix-bad-ClearSourcesCache' fa7b041eca PCH: Fix logic error that incorrectly clears sources during VS generation Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4815
| * \ Merge branch 'backport-3.16-pch-fix-bad-ClearSourcesCache'Brad King2020-05-291-2/+5
| |\ \ | | |/ | |/|
| | * PCH: Fix logic error that incorrectly clears sources during VS generationBrad King2020-05-291-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit 729d997f10 (Precompile Headers: Add REUSE_FROM signature, 2019-08-30, v3.16.0-rc1~101^2), `GetPchFileObject` handles the case that it is called first for another target's `REUSE_FROM` by calling `AddSource` to make sure `GetObjectName` can produce the correct object name. However, `AddSource` causes `ClearSourcesCache` to be called, which since commit a9f4f58f0c (cmGeneratorTarget: Clear AllConfigSources in ClearSourcesCache, 2020-05-15, v3.16.7~2^2) now correctly erases the `AllConfigSources` structure. This is okay during `AddPchDependencies`, but there is another code path in which it is problematic. When the Visual Studio generator's `WriteAllSources` method is looping over the sources, the `cmake_pch.cxx` source is encountered first. This causes `OutputSourceSpecificFlags` to call `GetPchCreateCompileOptions`, which calls `GetPchFile`, which under MSVC with `CMAKE_LINK_PCH` calls `GetPchFileObject`. That leads to `ClearSourcesCache` erasing the structure over which `WriteAllSources` is iterating! This bug is caught by our `RunCMake.PrecompileHeaders` test when run with the VS generator as of the commit that exposed it by fixing `ClearSourcesCache`. However, that change was backported to the CMake 3.16 series after testing only with later versions versions that contain commit a55df20499 (Multi-Ninja: Add precompile headers support, 2020-01-10, v3.17.0-rc1~136^2). By adding proper multi-config support for PCH, that commit taught `cmLocalGenerator::AddPchDependencies` to call `GetPchFile` with the real set of configurations instead of just the empty string. This allows the `GetPchFile` cache of PCH sources to be populated up front so that the later calls to it in the `WriteAllSources` loop as described above do not actually call `GetPchFileObject` or `ClearSourcesCache`. That hid the problem. Fix this by re-ordering calls to `AddPchDependencies` to handle `REUSE_FROM` targets only after the targets whose PCH they re-use. Remove the now-unnecessary call to `AddSource` from `GetPchFileObject` so that `ClearSourcesCache` is never called during `WriteAllSources`. Update the PchReuseFrom test case to cover an ordering of targets that causes generators to encounter a `REUSE_FROM` target before the target whose PCH it re-uses. Fixes: #20770
* | | Ninja Multi-Config: Fix bug in CMAKE_WINDOWS_EXPORT_ALL_SYMBOLSKyle Edwards2020-05-291-0/+2
|/ / | | | | | | Fixes: #20775
* | CPack-deb: don't add a line with a dot to pkg descJonathan Verner2020-05-271-11/+1
| | | | | | | | | | | | | | | | | | | | | | Currently, if the package description ends with a newline (typically if it is read from a file) cpack -deb adds a single line with a dot at the end which leads to a violation of the `extended-description-contains-empty-paragraph` debian policy. This commit fixes the above behaviour. Fixes: #20763
* | Merge topic 'ctest-repeat-notrun' into release-3.17Brad King2020-05-275-6/+49
|\ \ | | | | | | | | | | | | | | | | | | | | | bbb62dcc72 CTest: Make sure NOT_RUN tests show up in the failed test log c503251997 Tests: Add coverage of ctest_test RETURN_VALUE and REPEAT Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4801
| * | CTest: Make sure NOT_RUN tests show up in the failed test logRobert Maynard2020-05-275-1/+28
| | | | | | | | | | | | Issue: #20543
| * | Tests: Add coverage of ctest_test RETURN_VALUE and REPEATRobert Maynard2020-05-271-5/+21
| | |
* | | Ninja Multi-Config: Make "install" targets depend on default configsKyle Edwards2020-05-223-1/+75
| | | | | | | | | | | | | | | | | | And add an "install:all" target. Fixes: #20713
* | | Merge topic 'fix-cache-args-file-to-dep-list' into release-3.17Brad King2020-05-137-0/+48
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | 0199dd9f1b ExternalProject: expose _ep_cache_args_script to the caller Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4710
| * | | ExternalProject: expose _ep_cache_args_script to the callerBen Boeckel2020-05-127-0/+48
| |/ / | | | | | | | | | | | | | | | | | | This is needed so that the caller can add a dependency on the cache file. Fixes: #20668
* | | Merge topic 'vs-pch-compile-opts' into release-3.17Brad King2020-05-121-0/+3
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | 6b2fb4ffd2 VS: Fix using PCH from source with COMPILE_OPTIONS Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4734
| * | | VS: Fix using PCH from source with COMPILE_OPTIONSBrad King2020-05-111-0/+3
| | |/ | |/| | | | | | | | | | | | | | | | If a source file gets per-source flags from both PCH and custom `COMPILE_OPTIONS`, combine them correctly. Fixes: #20694, #20456
* | | Merge branch 'backport-3.16-FindPkgConfig-isystem'Brad King2020-05-061-1/+21
|\ \ \ | |_|/ |/| |
| * | FindPkgConfig: also handle "-isystem" prefixes for include directoriesRolf Eike Beer2020-05-051-1/+21
| |/ | | | | | | Fixes: #20652
* | Merge topic 'pch-genex-absolute' into release-3.17Brad King2020-04-284-2/+6
|\ \ | | | | | | | | | | | | | | | | | | | | | b204bae261 target_precompile_headers: Fix documented example using genex Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Cristian Adam <cristian.adam@gmail.com> Merge-request: !4678
| * | target_precompile_headers: Fix documented example using genexBrad King2020-04-274-2/+6
| |/ | | | | | | | | | | | | | | When the path to a header file is specified using a generator expression, evaluation of the genex must produce an absolute path. Update our documented example and add a test covering the case. Fixes: #20617
| * target_link_libraries: Fix regression in case of $<CONFIG> genexBrad King2020-03-304-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit b8626261e9 (Precompile headers: Add methods to generate PCH sources, 2019-07-13, v3.16.0-rc1~182^2~4) we look up source files for a target using an upper-case configuration even though an original-case name is sufficient. Since commit 36ded610af (PCH: Generate sources during Compute step, 2019-10-05, v3.16.0-rc1~2^2) the source file lookup is the first time we compute many on-demand structures that depend on the configuration name. This caused the `$<CONFIG>` generator expression to evaluate to the upper-case configuration name in some cases where we used original-case before. Fix this by switching the source file lookup to the original-case config name. Add a test covering the symptom that led to the discovery of this problem. Fixes: #20517
* | Ninja: Remove config suffix from order-only targetKyle Edwards2020-04-232-0/+21
| | | | | | | | Fixes: #20621
* | Merge topic 'llvm-rc-include-path' into release-3.17Brad King2020-04-071-8/+8
|\ \ | | | | | | | | | | | | | | | | | | 35a29ec827 llvm-rc: Restore include path for data after explicit preprocessing Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4570
| * | llvm-rc: Restore include path for data after explicit preprocessingThomas Bernard2020-04-061-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit 1c2d031cbd (Add -E cmake_llvm_rc to preprocess files for llvm-rc, 2020-01-14, v3.17.0-rc1~24^2) with llvm-rc we explicitly preprocess RC source files and then compile separately without -I flags. This broke cases where the RC source references data files adjacent to itself or in the include path. This change adds the expansion of the include paths when calling the llvm-rc in order for the resource files to be picked up correctly by llvm-rc. Since the RC compiled file is first preprocessed, the file being compiled by llvm-rc resides in the build directory. In order for llvm-rc to find the resource data specified relative to the .rc file being compiled, the source file path is preppended in the include list so that the original source path takes priority over all the other includes paths specified. A space was added in the CMAKE_INCLUDE_FLAG_RC to make the include directive work properly for llvm-rc. Checks on the rc.exe showed that the syntax change doesn't affect it's proper operation. Fixes: #20529
* | | Merge topic 'link-libs-config-case' into release-3.17Brad King2020-03-314-0/+28
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | | | | 2af18704fd Merge branch 'backport-3.16-link-libs-config-case' 3f976bf201 target_link_libraries: Fix regression in case of $<CONFIG> genex 5a95b5e091 target_link_libraries: Fix regression in case of $<CONFIG> genex Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4544
| * | target_link_libraries: Fix regression in case of $<CONFIG> genexBrad King2020-03-304-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit b8626261e9 (Precompile headers: Add methods to generate PCH sources, 2019-07-13, v3.16.0-rc1~182^2~4) we look up source files for a target using an upper-case configuration even though an original-case name is sufficient. Since commit 36ded610af (PCH: Generate sources during Compute step, 2019-10-05, v3.16.0-rc1~2^2) the source file lookup is the first time we compute many on-demand structures that depend on the configuration name. This caused the `$<CONFIG>` generator expression to evaluate to the upper-case configuration name in some cases where we used original-case before. Fix this by switching the source file lookup to the original-case config name. Add a test covering the symptom that led to the discovery of this problem. Fixes: #20517
* | | Merge topic 'ctest-timeout-report' into release-3.17Brad King2020-03-272-2/+2
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | 7fda917fa4 CTest: Fix reported duration on timeout when grindchild keeps pipes open Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4530
| * | | CTest: Fix reported duration on timeout when grindchild keeps pipes openBrad King2020-03-262-2/+2
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit d1976cd1f2 (CTest: Fix timeout when grandchild keeps pipes open, 2020-01-13, v3.17.0-rc1~169^2) we no longer hang, but the test duration we report after the timeout is the amount of time the immediate child ran before exiting. Fix the logic to instead report the actual amount of time we spent monitoring the test before the timeout. Fixes: #20509
* | | llvm-rc: Print stderr output when calling tools through cmake_llvm_rcThomas Bernard2020-03-263-3/+4
|/ / | | | | | | | | | | The stored error pipe is output if the program fails. Fixes: #20494
* | export: Fix use-after-free on multiple calls overwriting same FILEBrad King2020-03-193-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CMake 3.16 and below allow multiple `export()` calls with the same output file even without using `APPEND`. The implementation worked by accident by leaking memory. Refactoring in commit 5444a8095d (cmGlobalGenerator: modernize memrory managemenbt, 2019-12-29, v3.17.0-rc1~239^2) cleaned up that memory leak and converted it to a use-after-free instead. The problem is caused by using the `cmGlobalGenerator::BuildExportSets` map to own `cmExportBuildFileGenerator` instances. It can own only one instance per output FILE name at a time, so repeating use of the same file now frees the old `cmExportBuildFileGenerator` instance and leaves the pointer in the `cmMakefile::ExportBuildFileGenerators` vector dangling. Move ownership of the instances into `cmMakefile`'s vector since its entries are not replaced on a repeat output FILE. In future work we should introduce a policy to error out on this case. For now simply fix the use-after-free to restore CMake <= 3.16 behavior. Fixes: #20469
* | Merge topic 'rename-macho-version-properties' into release-3.17Craig Scott2020-03-121-2/+2
|\ \ | | | | | | | | | | | | | | | | | | 14732d3f30 macOS: Rename OSX_*_VERSION properties to MACHO_*_VERSION Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4452
| * | macOS: Rename OSX_*_VERSION properties to MACHO_*_VERSIONBrad King2020-03-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The properties added by commit 4a62e3d97c (macOS: Add OSX_COMPATIBILITY_VERSION and OSX_CURRENT_VERSION properties, 2020-01-24, v3.17.0-rc1~80^2~1) are general-purpose for all platforms using Mach-O formats and not just on OS X. Rename them accordingly. The properties are new to the CMake 3.17 release so we can rename them without compatibility concerns. Fixes: #20442
* | | Swift: support Ninja Multi-ConfigSaleem Abdulrasool2020-03-093-0/+9
| | | | | | | | | | | | | | | Enable support for multi-configuration builds using Ninja when building Swift.
* | | Merge topic 'ninja-multi-custom-command-deps' into release-3.17Brad King2020-03-053-6/+3
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | 081c4679f7 Ninja Multi-Config: Don't build target dependencies for custom commands Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4423
| * | | Ninja Multi-Config: Don't build target dependencies for custom commandsKyle Edwards2020-03-033-6/+3
| |/ / | | | | | | | | | | | | | | | | | | If cross-config mode is used, and a target depends on another target as well as a custom command, we don't want the custom command to also depend on the depended target, as that would build targets unnecessarily. Fix this behavior.
* | | Ninja Multi-Config: Fix spurious unused variable warningKyle Edwards2020-03-032-2/+13
|/ / | | | | | | Fixes: #20381
* | Merge topic 'ninja-multi-variable-shuffle-again' into release-3.17Brad King2020-02-2817-34/+70
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | c794b70f19 Ninja Multi-Config: Always generate build.ninja 9590c3a400 Generator: Don't allow Ninja Multi-Config variables on other generators 7a63dafafb Ninja Multi-Config: Remove "NMC" from variable names Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4403
| * | Ninja Multi-Config: Always generate build.ninjaKyle Edwards2020-02-274-12/+3
| | | | | | | | | | | | | | | If CMAKE_DEFAULT_BUILD_TYPE is not specified, use the first item from CMAKE_CONFIGURATION_TYPES instead.
| * | Generator: Don't allow Ninja Multi-Config variables on other generatorsKyle Edwards2020-02-2710-0/+45
| | | | | | | | | | | | | | | | | | We may want to enable these variables later on with specific semantics. To avoid breaking backwards compatibility, make it an error to use them for now.
| * | Ninja Multi-Config: Remove "NMC" from variable namesKyle Edwards2020-02-276-27/+27
| | | | | | | | | | | | | | | | | | Also rename `..._DEFAULT_BUILD_FILE_CONFIG` to `..._DEFAULT_BUILD_TYPE`. These name changes make the variables meaningful for future use by other generators.
* | | foreach: Set fatal error on invalid rangeKyle Edwards2020-02-274-0/+8
| | | | | | | | | | | | Fixes: #20394
* | | foreach: Fix crash when parsing invalid integerKyle Edwards2020-02-2719-0/+48
|/ / | | | | | | Fixes: #20393
* | Merge topic 'RunCMake-test-lang' into release-3.17Brad King2020-02-261-0/+3
|\ \ | | | | | | | | | | | | | | | | | | 95dbcf0598 Tests: fix RunCMake.Make test when run on systems with non-english locale Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4389
| * | Tests: fix RunCMake.Make test when run on systems with non-english localeRolf Eike Beer2020-02-261-0/+3
| | | | | | | | | | | | | | | | | | Set `LANG=C` in the environment so the output of `make` is predictable. Fixes: #19689
* | | CTest: Provide more detailed information on resource allocation errorKyle Edwards2020-02-243-3/+37
|/ /
* | Ninja Multi-Config: Fix issue with framework dependencies and AutogenKyle Edwards2020-02-172-0/+27
| | | | | | | | Fixes: #20345
* | Merge topic 'ninja-multi-default-configs-fix' into release-3.17Brad King2020-02-123-0/+45
|\ \ | | | | | | | | | | | | | | | | | | 46c836644d Ninja Multi-Config: Fix issue with "all" in CMAKE_NMC_DEFAULT_CONFIGS Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4349
| * | Ninja Multi-Config: Fix issue with "all" in CMAKE_NMC_DEFAULT_CONFIGSKyle Edwards2020-02-113-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | Prior to this fix, CMAKE_NMC_DEFAULT_CONFIGS would inherit "all" from the union of CMAKE_NMC_DEFAULT_BUILD_FILE_CONFIG and CMAKE_NMC_CROSS_CONFIGS. This is inconsistent with the behavior of the "all" target signifying CMAKE_NMC_CROSS_CONFIGS. Update "all" in CMAKE_NMC_DEFAULT_CONFIGS to inherit only from CMAKE_NMC_CROSS_CONFIGS.
* | | Merge topic 'file-CONFIGURE_DEPENDS-verify-CMP0009' into release-3.17Brad King2020-02-125-2/+30
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 818ec34bdd file: GLOB_RECURSE VerifyGlobs.cmake should have CMP0009 set to new b620dc566d file: Fix GLOB_RECURSE LIST_DIRECTORIES documentation regarding CMP0009 715f90bdd9 Tests: Perform minor cleanups in RunCMake.file test Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Kyle Edwards <kyle.edwards@kitware.com> Merge-request: !4342
| * | | file: GLOB_RECURSE VerifyGlobs.cmake should have CMP0009 set to newShane Parris2020-02-115-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In certain cases, rebuilds with CMake using the CONFIGURE_DEPENDS flag with GLOB_RECURSE could result in a reconfigure loop due to CMP0009 not being propogated to the generated VerifyGlobs.cmake script. During the inital configuration phase, RecurseThroughSymlinksOn() is called for recursive glob operations either by having the CMP0009 status not set to NEW or by explicitly providing the FOLLOW_SYMLINKS flag. At the end when the VerifyGlobs script is created, the FOLLOW_SYMLINKS flag is written according to the final resolved form through a call to GetRecurseThroughSymlinks(). Thus, setting CMP0009 to NEW in the generated file is safe and allows correct behavior whether or not the end user sets the policy status to NEW or OLD.
| * | | Tests: Perform minor cleanups in RunCMake.file testShane Parris2020-02-111-2/+2
| | | |