diff options
author | Brad King <brad.king@kitware.com> | 2018-05-10 13:54:23 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-05-10 13:57:31 (GMT) |
commit | e567d7eb639b43c2256340acdf4b0053dec0018a (patch) | |
tree | 79d902c898966289a2e5959954a3c064e4dd723a /Tests/RunCMake/alias_targets | |
parent | fbe6cd1596bf280edd49aeb8f981f99d7cd8beb3 (diff) | |
download | CMake-e567d7eb639b43c2256340acdf4b0053dec0018a.zip CMake-e567d7eb639b43c2256340acdf4b0053dec0018a.tar.gz CMake-e567d7eb639b43c2256340acdf4b0053dec0018a.tar.bz2 |
add_library: Restore error on alias of non-global imported target
In commit v3.11.0-rc1~433^2~1 (Add support for IMPORTED GLOBAL targets
to be aliased, 2017-09-14) we accidentally dropped the error on calling
`add_library` to alias an imported target that is not globally visible.
The `add_executable` command's equivalent check was properly updated.
Restore the check in `add_library` with the same update. Also fix the
test case accordingly.
Fixes: #17982
Diffstat (limited to 'Tests/RunCMake/alias_targets')
-rw-r--r-- | Tests/RunCMake/alias_targets/imported-target-stderr.txt | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Tests/RunCMake/alias_targets/imported-target-stderr.txt b/Tests/RunCMake/alias_targets/imported-target-stderr.txt index 12ffbc2..465de03 100644 --- a/Tests/RunCMake/alias_targets/imported-target-stderr.txt +++ b/Tests/RunCMake/alias_targets/imported-target-stderr.txt @@ -3,7 +3,13 @@ \"test-exe\" is imported but not globally visible. Call Stack \(most recent call first\): CMakeLists.txt:[0-9]+ \(include\) - - ++ 'alias-test-exe' does not exist![?] +* +CMake Error at imported-target.cmake:[0-9]+ \(add_library\): + add_library cannot create ALIAS target "alias-test-lib" because target + "test-lib" is imported but not globally visible. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\) ++ 'alias-test-lib' does not exist![?]$ |