diff options
author | Brad King <brad.king@kitware.com> | 2020-11-23 20:00:27 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-11-23 20:56:28 (GMT) |
commit | f06f4b517cad32ec619774ce8a3a529c3ae32ebd (patch) | |
tree | fbb3c1063ac802d79ebc28726f3d1e202241ce04 /Tests/RunCMake | |
parent | 43c95df8fb8776d36240e57ffc222587bc2049cd (diff) | |
download | CMake-f06f4b517cad32ec619774ce8a3a529c3ae32ebd.zip CMake-f06f4b517cad32ec619774ce8a3a529c3ae32ebd.tar.gz CMake-f06f4b517cad32ec619774ce8a3a529c3ae32ebd.tar.bz2 |
cmTarget: Do not enforce CMP0111 on imported INTERFACE libraries
Fix logic added by commit 359c500a24 (cmTarget: Raise error if imported
target location is not set, 2020-08-08, v3.19.0-rc1~273^2) to exclude
INTERFACE libraries from the policy. They have no location.
Fixes: #21470
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r-- | Tests/RunCMake/CMP0111/CMP0111-Common.cmake | 5 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0111/main.cpp | 3 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0111/module.cpp | 4 |
3 files changed, 7 insertions, 5 deletions
diff --git a/Tests/RunCMake/CMP0111/CMP0111-Common.cmake b/Tests/RunCMake/CMP0111/CMP0111-Common.cmake index 564169d..c31e4ba 100644 --- a/Tests/RunCMake/CMP0111/CMP0111-Common.cmake +++ b/Tests/RunCMake/CMP0111/CMP0111-Common.cmake @@ -4,6 +4,7 @@ set(CMAKE_IMPORT_LIBRARY_SUFFIX "placeholder") add_library(unknown_lib UNKNOWN IMPORTED) add_library(static_lib STATIC IMPORTED) add_library(shared_lib SHARED IMPORTED) +add_library(interface_lib INTERFACE IMPORTED) -add_executable(executable main.cpp) -target_link_libraries(executable unknown_lib static_lib shared_lib) +add_library(module MODULE module.cpp) +target_link_libraries(module unknown_lib static_lib shared_lib interface_lib) diff --git a/Tests/RunCMake/CMP0111/main.cpp b/Tests/RunCMake/CMP0111/main.cpp deleted file mode 100644 index 5047a34..0000000 --- a/Tests/RunCMake/CMP0111/main.cpp +++ /dev/null @@ -1,3 +0,0 @@ -int main() -{ -} diff --git a/Tests/RunCMake/CMP0111/module.cpp b/Tests/RunCMake/CMP0111/module.cpp new file mode 100644 index 0000000..b82bb31 --- /dev/null +++ b/Tests/RunCMake/CMP0111/module.cpp @@ -0,0 +1,4 @@ +int module() +{ + return 0; +} |