From e7a111f0945315b983cdb4d5d9f94b28e52598d4 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 9 Jan 2014 12:41:29 +0100 Subject: [PATCH] InterfaceLibrary: Add test requiring MAP_IMPORTED_CONFIG whitelisting The target properties with this prefix are whitelisted for INTERFACE_LIBRARY targets. --- Tests/InterfaceLibrary/CMakeLists.txt | 13 +++++++++++++ Tests/InterfaceLibrary/map_config.cpp | 15 +++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 Tests/InterfaceLibrary/map_config.cpp diff --git a/Tests/InterfaceLibrary/CMakeLists.txt b/Tests/InterfaceLibrary/CMakeLists.txt index b396eb633..81b34e6e4 100644 --- a/Tests/InterfaceLibrary/CMakeLists.txt +++ b/Tests/InterfaceLibrary/CMakeLists.txt @@ -29,3 +29,16 @@ target_link_libraries(iface_whitelist INTERFACE $<$:SPECIAL_MODE> + $<$:DEBUG_MODE> +) +set_property(TARGET iface_imported PROPERTY + MAP_IMPORTED_CONFIG_DEBUG SPECIAL +) + +add_executable(map_config map_config.cpp) +target_link_libraries(map_config iface_imported) diff --git a/Tests/InterfaceLibrary/map_config.cpp b/Tests/InterfaceLibrary/map_config.cpp new file mode 100644 index 000000000..81bb66605 --- /dev/null +++ b/Tests/InterfaceLibrary/map_config.cpp @@ -0,0 +1,15 @@ + +#ifdef DEBUG_MODE +#ifndef SPECIAL_MODE +#error Special configuration should be mapped to debug configuration. +#endif +#else +#ifdef SPECIAL_MODE +#error Special configuration should not be enabled if not debug configuration +#endif +#endif + +int main(int,char**) +{ + return 0; +}