diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-01-22 23:40:27 +0100 |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-01-23 00:08:18 +0100 |
commit | ee38062be8ccdb7f4c53156ef00db0d42a41a6a7 (patch) | |
tree | 00ecedc8bcceb7bf2a548f0ee4e34ce69cc0f83e /Tests | |
parent | 98bf613cd09e2187fa5002dac06e63d5450dbcf0 (diff) | |
download | cmake-ee38062be8ccdb7f4c53156ef00db0d42a41a6a7.tar.gz |
IncludeDirectories: Respect SYSTEM flag when using CONFIG genex.
Update the Makefile and Ninja generators to use the config when
requesting the include flags.
Diffstat (limited to 'Tests')
3 files changed, 23 insertions, 1 deletions
diff --git a/Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt b/Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt index abe9f74d97..0215e9322f 100644 --- a/Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt +++ b/Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt @@ -14,8 +14,14 @@ target_include_directories(upstream SYSTEM PUBLIC $<TARGET_PROPERTY:systemlib,INTERFACE_INCLUDE_DIRECTORIES> ) +add_library(config_specific INTERFACE) +set(testConfig ${CMAKE_BUILD_TYPE}) +target_include_directories(config_specific SYSTEM INTERFACE + "$<$<CONFIG:${testConfig}>:${CMAKE_CURRENT_SOURCE_DIR}/config_specific>" +) + add_library(consumer consumer.cpp) -target_link_libraries(consumer upstream) +target_link_libraries(consumer upstream config_specific) target_compile_options(consumer PRIVATE -Werror=unused-variable) add_library(iface IMPORTED INTERFACE) diff --git a/Tests/IncludeDirectories/SystemIncludeDirectories/config_specific/config_iface.h b/Tests/IncludeDirectories/SystemIncludeDirectories/config_specific/config_iface.h new file mode 100644 index 0000000000..05d3604eb8 --- /dev/null +++ b/Tests/IncludeDirectories/SystemIncludeDirectories/config_specific/config_iface.h @@ -0,0 +1,14 @@ + +#ifndef CONFIG_IFACE_H +#define CONFIG_IFACE_H + +#ifdef _WIN32 +__declspec(dllexport) +#endif +int configUnusedFunc() +{ + int unused; + return 0; +} + +#endif diff --git a/Tests/IncludeDirectories/SystemIncludeDirectories/consumer.cpp b/Tests/IncludeDirectories/SystemIncludeDirectories/consumer.cpp index 197dae86d5..be18ebf522 100644 --- a/Tests/IncludeDirectories/SystemIncludeDirectories/consumer.cpp +++ b/Tests/IncludeDirectories/SystemIncludeDirectories/consumer.cpp @@ -1,6 +1,8 @@ #include "upstream.h" +#include "config_iface.h" + int consumer() { return upstream(); |