From 97fae68b81d7dbb5dda9fe21f860863bcc0c7183 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Tue, 10 Dec 2013 17:16:08 +0100 Subject: Remove INTERFACE build targets. Commit b04f3b9a (Create make rules for INTERFACE_LIBRARY targets., 2013-08-21) extended the makefile generator to create build targets for INTERFACE_LIBRARY targets. No other generators were extended with this feature. This conflicts with the feature of whitelisting of target properties read from INTERFACE_LIBRARY targets. The INTERFACE_* properties of the INTERFACE_LIBRARY may legitimately contain TARGET_PROPERTY generator expressions for reading properties from the 'head target'. The 'head target' would be the INTERFACE_LIBRARY itself when creating the build rules for it, which means that non-whitelisted properties would be read. --- Tests/InterfaceLibrary/CMakeLists.txt | 14 ++++++++++++++ Tests/InterfaceLibrary/broken.cpp | 2 ++ Tests/InterfaceLibrary/dummy.cpp | 5 +++++ 3 files changed, 21 insertions(+) create mode 100644 Tests/InterfaceLibrary/broken.cpp create mode 100644 Tests/InterfaceLibrary/dummy.cpp (limited to 'Tests/InterfaceLibrary') diff --git a/Tests/InterfaceLibrary/CMakeLists.txt b/Tests/InterfaceLibrary/CMakeLists.txt index 53aeb036b0..8154cedad7 100644 --- a/Tests/InterfaceLibrary/CMakeLists.txt +++ b/Tests/InterfaceLibrary/CMakeLists.txt @@ -13,3 +13,17 @@ add_subdirectory(libsdir) add_executable(sharedlibtestexe sharedlibtestexe.cpp) target_link_libraries(sharedlibtestexe shared_iface) + +add_library(broken EXCLUDE_FROM_ALL broken.cpp) + +add_library(iface_broken INTERFACE) +# This is not a dependency, so broken will not be built (and the error in +# it will not be hit) +target_link_libraries(iface_broken INTERFACE broken) + +add_library(iface_whitelist INTERFACE) +# The target property CUSTOM will never be evaluated on the INTERFACE library. +target_link_libraries(iface_whitelist INTERFACE $<$>:irrelevant>) + +add_executable(exec_whitelist dummy.cpp) +target_link_libraries(exec_whitelist iface_whitelist) diff --git a/Tests/InterfaceLibrary/broken.cpp b/Tests/InterfaceLibrary/broken.cpp new file mode 100644 index 0000000000..1fd10416b4 --- /dev/null +++ b/Tests/InterfaceLibrary/broken.cpp @@ -0,0 +1,2 @@ + +#error Broken diff --git a/Tests/InterfaceLibrary/dummy.cpp b/Tests/InterfaceLibrary/dummy.cpp new file mode 100644 index 0000000000..341aaafa0a --- /dev/null +++ b/Tests/InterfaceLibrary/dummy.cpp @@ -0,0 +1,5 @@ + +int main(int, char **) +{ + return 0; +} -- cgit v1.2.1