summaryrefslogtreecommitdiffstats
path: root/Tests/IncludeDirectories/SystemIncludeDirectories
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-01-22 22:40:27 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-01-22 23:08:18 (GMT)
commitee38062be8ccdb7f4c53156ef00db0d42a41a6a7 (patch)
tree00ecedc8bcceb7bf2a548f0ee4e34ce69cc0f83e /Tests/IncludeDirectories/SystemIncludeDirectories
parent98bf613cd09e2187fa5002dac06e63d5450dbcf0 (diff)
downloadCMake-ee38062be8ccdb7f4c53156ef00db0d42a41a6a7.zip
CMake-ee38062be8ccdb7f4c53156ef00db0d42a41a6a7.tar.gz
CMake-ee38062be8ccdb7f4c53156ef00db0d42a41a6a7.tar.bz2
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/IncludeDirectories/SystemIncludeDirectories')
-rw-r--r--Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt8
-rw-r--r--Tests/IncludeDirectories/SystemIncludeDirectories/config_specific/config_iface.h14
-rw-r--r--Tests/IncludeDirectories/SystemIncludeDirectories/consumer.cpp2
3 files changed, 23 insertions, 1 deletions
diff --git a/Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt b/Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt
index abe9f74..0215e93 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 0000000..05d3604
--- /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 197dae8..be18ebf 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();