Commit Graph

47480 Commits

Author SHA1 Message Date
Brad King
16053df54e Merge topic 'link-libs-config-case'
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
2020-03-31 09:19:42 -04:00
Brad King
34108b496b Merge branch 'release-3.17' 2020-03-31 09:17:54 -04:00
Brad King
20819b1cdb Merge topic 'aix-ExportImportList-install'
39e5a4da22 AIX: Install ExportImportList script with execute permission

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4545
2020-03-31 09:17:53 -04:00
Brad King
76f08a107b Merge topic 'aix-ExportImportList-install' into release-3.17
39e5a4da22 AIX: Install ExportImportList script with execute permission

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4545
2020-03-31 09:17:53 -04:00
Kitware Robot
be154ea1e3 CMake Nightly Date Stamp 2020-03-31 00:01:10 -04:00
Brad King
888b8a43d8 Merge topic 'cmprop-state'
a4255ecf81 cmStateDirectory::GetProperty: return cmProp

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4536
2020-03-30 13:30:48 -04:00
Brad King
615950dfb6 Merge topic 'cuda_support_bin_util_overrides'
79b6e928c3 CUDA: Support compiler specific FindBinUtils overrides

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Axel Huebl <axel.huebl@plasma.ninja>
Merge-request: !4539
2020-03-30 13:29:36 -04:00
Brad King
ad22d0c1d0 Merge topic 'vs-non-built-file-item-metadata'
0723e04f7a VS: Add documentation for VS_SETTINGS and VS_SOURCE_SETTINGS_<tool>.
2ca1102f83 VS: Test VS_SETTINGS and VS_SOURCE_SETTINGS_<tool> properties.
f00e1b816d VS: Add VS_SOURCE_SETTINGS_<tool> target property
2ce42f281f VS: Add VS_SETTINGS source file property
53116d3942 VS: Use unordered_map to write HLSL settings.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4498
2020-03-30 13:28:19 -04:00
Brad King
cfa3a2342f Merge topic 'gtest_discover_tests_cross_compile_support'
3b4838b57f GoogleTest: Add tests for MultiConfig discovery in PRE_TEST mode
1ba4cb565e GoogleTest: Parameterize tests to check PRE_TEST/POST_BUILD discovery mode
75e82a13db GoogleTest: Add new DISCOVERY_MODE option to gtest_discover_tests
889a7146ff GoogleTestAddTests: Refactor into callable method

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4078
2020-03-30 13:26:49 -04:00
Brad King
e20146b429 Merge topic 'FindBoost-lib-prefix-clarify'
040f503d83 FindBoost: Clarify logic selecting Boost_LIB_PREFIX

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4537
2020-03-30 13:24:38 -04:00
Brad King
026083f97b Merge branch 'release-3.17' 2020-03-30 13:23:19 -04:00
Brad King
0055170b08 Merge topic 'docs-xcode-gen-scheme-workdir'
6905451e11 Help: Add missing XCODE_SCHEME_WORKING_DIRECTORY
6ff07dac76 Help: Minor typos and formatting for XCODE_SCHEME_WORKING_DIRECTORY

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4543
2020-03-30 13:23:19 -04:00
Brad King
04d8ed643c Merge topic 'docs-xcode-gen-scheme-workdir' into release-3.17
6905451e11 Help: Add missing XCODE_SCHEME_WORKING_DIRECTORY
6ff07dac76 Help: Minor typos and formatting for XCODE_SCHEME_WORKING_DIRECTORY

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4543
2020-03-30 13:23:18 -04:00
Brad King
04c7f8f9f3 Merge branch 'release-3.17' 2020-03-30 13:22:02 -04:00
Brad King
42cefc6bc1 Merge topic 'llvm_rc_pp' into release-3.17
4bef0e6450 llvm-rc: Enable preprocessing if CMAKE_RC_COMPILER_INIT is an absolute path

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4535
2020-03-30 13:22:02 -04:00
Brad King
0188df97e8 Merge topic 'llvm_rc_pp'
4bef0e6450 llvm-rc: Enable preprocessing if CMAKE_RC_COMPILER_INIT is an absolute path

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4535
2020-03-30 13:22:02 -04:00
Brad King
39e5a4da22 AIX: Install ExportImportList script with execute permission
This script was added by commit 0f150b69d3 (AIX: Explicitly compute
shared object exports for both XL and GNU, 2019-07-11,
v3.16.0-rc1~418^2~2) but does not have a `.sh` extension so our existing
install rules neglect to give it execute permission.  Our test suite
works on AIX in the build tree but the script is broken without execute
permission on installation.

Fixes: #20520
2020-03-30 11:43:08 -04:00
Brad King
2af18704fd Merge branch 'backport-3.16-link-libs-config-case' 2020-03-30 11:34:39 -04:00
Brad King
3f976bf201 target_link_libraries: Fix regression in case of $<CONFIG> genex
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
2020-03-30 11:33:55 -04:00
Brad King
5a95b5e091 target_link_libraries: Fix regression in case of $<CONFIG> genex
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
2020-03-30 11:24:27 -04:00
Brad King
3c48f4b24b Merge topic 'FindPython-use-sysconfig-package'
dd0664415a FindPython: use 'sysconfig' as alternate to 'distutils.sysconfig'

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4540
2020-03-30 09:42:35 -04:00
Kitware Robot
887eb6b768 CMake Nightly Date Stamp 2020-03-30 00:01:13 -04:00
Craig Scott
6905451e11 Help: Add missing XCODE_SCHEME_WORKING_DIRECTORY 2020-03-29 22:13:56 +11:00
Craig Scott
6ff07dac76 Help: Minor typos and formatting for XCODE_SCHEME_WORKING_DIRECTORY 2020-03-29 22:13:56 +11:00
Kitware Robot
371727cd58 CMake Nightly Date Stamp 2020-03-29 00:01:22 -04:00
Marc Chevrier
dd0664415a FindPython: use 'sysconfig' as alternate to 'distutils.sysconfig'
To support any python installation, if package 'distutils.sysconfig'
is not available, try to use package 'sysconfig'.

Fixes: #20502
2020-03-28 10:51:47 +01:00
Craig Scott
67e2fef722 Merge branch 'release-3.17' 2020-03-28 03:05:11 -04:00
Craig Scott
e5eb4108a0 Merge topic 'ninja-multi-doc-variable-update' into release-3.17
c8fd26eb57 Help: Move Ninja Multi-Config variable details into their respective pages

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4532
2020-03-28 03:05:10 -04:00
Craig Scott
655b52af1d Merge topic 'ninja-multi-doc-variable-update'
c8fd26eb57 Help: Move Ninja Multi-Config variable details into their respective pages

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4532
2020-03-28 03:05:10 -04:00
Kitware Robot
cc86c9279e CMake Nightly Date Stamp 2020-03-28 00:01:13 -04:00
Robert Maynard
79b6e928c3 CUDA: Support compiler specific FindBinUtils overrides 2020-03-27 12:58:01 -04:00
Vitaly Stakhovsky
a4255ecf81 cmStateDirectory::GetProperty: return cmProp 2020-03-27 12:33:04 -04:00
Matt Davies
0723e04f7a VS: Add documentation for VS_SETTINGS and VS_SOURCE_SETTINGS_<tool>. 2020-03-27 12:01:21 -04:00
Ryan Thornton
3b4838b57f GoogleTest: Add tests for MultiConfig discovery in PRE_TEST mode
PRE_TEST makes it possible to properly distinguish between test cases
that exist only in certain configurations.

In the new test scenario, debug tests are disabled in release builds,
and release tests are disabled in debug builds
when a multi config generator is used.

Note, this is a bit of a hack and *only* works for PRE_TEST mode.

POST_BUILD makes no attempt to get this right. It preserves the status quo
and you obtain the tests that were last discovered.

See further discussion in !4078

Ideally, the POST_BUILD behavior could be fixed
by using generator expressions in OUTPUT and BYPRODUCT expressions.

Then you could do something like:

    set(ctest_include_file "${ctest_file_base}_include-$<CONFIG>.cmake")
    set(ctest_tests_file "${ctest_file_base}_tests-$<CONFIG>.cmake")

Once #12877 lands, maybe this can be revisited.

Co-authored-by: Ryan Thornton <ThorntonRyan@JohnDeere.com>
Co-authored-by: Kevin Puetz <PuetzKevinA@JohnDeere.com>
2020-03-27 09:40:40 -05:00
Ryan Thornton
1ba4cb565e GoogleTest: Parameterize tests to check PRE_TEST/POST_BUILD discovery mode
Now, the unit tests are ran twice -- once with POST_BUILD (i.e. default mode)
and again with PRE_TEST (i.e. new discovery mode).

Both modes of setting gtest discovery mode are also tested:
1. Using the global override (i.e. CMAKE_GTEST_DISCOVER_TESTS_DISCOVERY_MODE)
2. Explicitly passing DISCOVERY_MODE in calls to gtest_discover_tests (in GoogleTestDiscoveryTimeout.cmake)

The goal is to show that the new PRE_TEST discovery mode does not break existing behavior
(i.e. should not break POST_BUILD mode) and should also pass the same tests
in the same way.

A few non trivial implementation details worth noting:

1. Refactoring discovery_timeout_test into own project

Originally, I tried doing:

```
run_GoogleTest(POST_BUILD)
run_GoogleTest(PRE_TEST)
```

Without changing the internal structure of run_GoogleTest.

But since discovery_timeout_test is part of the same project as the other tests,
and CTest include files always get evaluated and that's where test discovery occurs,
this means every other test now notices the timeout problem when running in PRE_TEST mode.

As a result, keeping the existing test structure meant that each existing test
(and any new test) would need to have its own PRE_TEST / POST_BUILD variant for stderr and stdout
in order to handle the case where discovery_timeout_test timed out.

This exponential increase in test output files introduced unnecessary complexity
and made it more cumbersome to work on test cases.

Why should an unrelated test case care about discovery_timeout_test?

So, to fix that issue, the tests were broken apart into two main groups:
1. run_GoogleTest_discovery_timeout (the test dealing with discovery_timeout_test)
2. run_GoogleTest (everything else)

This isolates the PRE_TEST / POST_BUILD timeout variants to a single test case.

And the other test cases remain unchanged -- further driving home the point that
DISCOVERY_MODE shouldn't change existing behavior.

2. Different number of PRE_TEST / POST_BUILD file variants

On the PRE_TEST path, different build systems / compilers (i.e. MSBuild and ninja/gcc)
produces different build output when building discovery_timeout_test,
but we don't actually care what it is, just as long as it builds
successfully.

This the fundamental difference in behavior between POST_BUILD (which would have failed)
and PRE_TEST (which doesn't) and is the reason why we don't need
a GoogleTest-discovery-build-result.txt or GoogleTest-discovery-build-stdout.txt

3. Fix flaky discovery timeout test

The test expects to see:

> Output:
>  timeout
>    case.

But sometimes, the test would only produce:

> Output:
>  timout

In certain environments, specifically when built with OpenWatcom 1.4,
and while the build server was under heavy load (i.e. running many tests in parallel),
std::endl behaves inconsistently and doesn't completely
flush std::cout when the program is terminated due to timeout.

This results in inconsistent test failures because the actual output
doesn't fully match what's expected.

At first we tried adding an additional:
    std::cout << std::flush

That didn't work. But using C-style printf() and fflush() appears to do
the trick:

> This time I managed to get on the machine while it was still busy doing other nightly builds
> and could reproduce the problem reliably. With that I was finally able to find a fix.
> It turns out my earlier hypothesis that C++ stream flushing was not working on the old compiler was correct,
> but even .flush() is not enough.
> I changed it to use C-style printf() and fflush() and now the test passes on that build.
> -- Brad King <brad.king@kitware.com>

Co-authored-by: Ryan Thornton <ThorntonRyan@JohnDeere.com>
Co-authored-by: Kevin Puetz <PuetzKevinA@JohnDeere.com>
2020-03-27 09:39:47 -05:00
Brad King
040f503d83 FindBoost: Clarify logic selecting Boost_LIB_PREFIX
Also add a comment explaining its purpose.
2020-03-27 09:32:47 -04:00
Lucas Wang
4bef0e6450 llvm-rc: Enable preprocessing if CMAKE_RC_COMPILER_INIT is an absolute path
`CMAKE_RC_COMPILER_INIT` and `CMAKE_RC_COMPILER` can be set by user,
for example `llvm-rc-10` and `D:\LLVM\bin\llvm-rc.exe`.
2020-03-27 08:54:58 -04:00
Brad King
f670435715 Merge topic 'pch-warn-invalid'
2ce08e5489 PCH: add an option to disable `-Winvalid-pch`

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4499
2020-03-27 08:03:30 -04:00
Brad King
cc1d5a436b Merge topic 'doc-cmake-package-targets'
e6344586ee install: Document caveat when EXPORT name matches package name

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4527
2020-03-27 07:58:39 -04:00
Brad King
d6119e2305 Merge topic 'cleanup-endls-1'
3fdd8db3aa Refactor: Avoid `std::endl` where it's not necessary (part 1)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4513
2020-03-27 07:51:27 -04:00
Brad King
a6611577c3 Merge topic 'cmprop-getglobalprop'
c84cf42897 cmState::GetGlobalProperty: return cmProp

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4521
2020-03-27 07:50:28 -04:00
Brad King
7e3d81b1df Merge topic 'cmprop-state'
a7f2ff16a4 cmState::GetCacheEntryProperty: return cmProp

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4522
2020-03-27 07:49:30 -04:00
Brad King
ae96b772fa Merge topic 'export-error-on-multuple-calls'
0cd20e8f62 export(): raise an error on multiple calls with same FILE

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4510
2020-03-27 07:48:30 -04:00
Brad King
767a875fee Merge branch 'release-3.17' 2020-03-27 07:46:15 -04:00
Brad King
0613f1b245 Merge topic 'ctest-timeout-report'
3503a79639 Merge branch 'backport-ctest-timeout-report' into ctest-timeout-report
7fda917fa4 CTest: Fix reported duration on timeout when grindchild keeps pipes open

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4530
2020-03-27 07:46:15 -04:00
Brad King
b835c5d5c9 Merge topic 'ctest-timeout-report' into release-3.17
7fda917fa4 CTest: Fix reported duration on timeout when grindchild keeps pipes open

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4530
2020-03-27 07:46:14 -04:00
Brad King
e50c02c009 Merge branch 'release-3.17' 2020-03-27 07:45:15 -04:00
Brad King
efb2a9f093 Merge topic 'vs-clangcl' into release-3.17
f3d7a15010 VS: Fix ClangCL toolset compiler path detection

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4523
2020-03-27 07:45:15 -04:00
Brad King
112cb248ae Merge topic 'vs-clangcl'
f3d7a15010 VS: Fix ClangCL toolset compiler path detection

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4523
2020-03-27 07:45:15 -04:00
Brad King
311848f790 Merge topic 'FindPython-variable-spelling-error' into release-3.17
63580668a8 FindPython: fix variable spelling error

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4529
2020-03-27 07:44:12 -04:00