summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-02-20 13:31:57 (GMT)
committerKitware Robot <kwrobot@kitware.com>2023-02-20 13:32:11 (GMT)
commit4e39c25fcef2516fca6e8bb12d7cf17270379e87 (patch)
tree8f6fd1d395f8d03b8511b1bafdbf9a9f956de0a1 /Tests
parent28f5af4ec5e955c2714abca90b2e305a95d5a6ba (diff)
parent841272eb35cbc76e18609d1b447aaabf1ffd6cda (diff)
downloadCMake-4e39c25fcef2516fca6e8bb12d7cf17270379e87.zip
CMake-4e39c25fcef2516fca6e8bb12d7cf17270379e87.tar.gz
CMake-4e39c25fcef2516fca6e8bb12d7cf17270379e87.tar.bz2
Merge topic 'xcode-revert-header-map'
841272eb35 Xcode: Restore suppression of header maps Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8218
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CMakeCommands/target_include_directories/CMakeLists.txt5
-rw-r--r--Tests/CMakeCommands/target_include_directories/same.c7
-rw-r--r--Tests/CMakeCommands/target_include_directories/same_one/same.h1
-rw-r--r--Tests/CMakeCommands/target_include_directories/same_two/same.h1
4 files changed, 14 insertions, 0 deletions
diff --git a/Tests/CMakeCommands/target_include_directories/CMakeLists.txt b/Tests/CMakeCommands/target_include_directories/CMakeLists.txt
index 0702ab5..3de9ef7 100644
--- a/Tests/CMakeCommands/target_include_directories/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_include_directories/CMakeLists.txt
@@ -83,3 +83,8 @@ get_target_property(_res imp INCLUDE_DIRECTORIES)
if (_res)
message(SEND_ERROR "include_directories populated the INCLUDE_DIRECTORIES target property")
endif()
+
+# Test selecting lexicographically-later header of same name via include order.
+# Xcode 'USE_HEADERMAP = YES' breaks this.
+add_library(same STATIC same.c same_one/same.h same_two/same.h)
+target_include_directories(same PRIVATE same_two)
diff --git a/Tests/CMakeCommands/target_include_directories/same.c b/Tests/CMakeCommands/target_include_directories/same.c
new file mode 100644
index 0000000..8fb8d29
--- /dev/null
+++ b/Tests/CMakeCommands/target_include_directories/same.c
@@ -0,0 +1,7 @@
+#include "same.h"
+#ifndef CORRECT_SAME_H_INCLUDED
+# error "Correct \"same.h\" not included!"
+#endif
+void same(void)
+{
+}
diff --git a/Tests/CMakeCommands/target_include_directories/same_one/same.h b/Tests/CMakeCommands/target_include_directories/same_one/same.h
new file mode 100644
index 0000000..e71fe01
--- /dev/null
+++ b/Tests/CMakeCommands/target_include_directories/same_one/same.h
@@ -0,0 +1 @@
+#error "Wrong \"same.h\" included!"
diff --git a/Tests/CMakeCommands/target_include_directories/same_two/same.h b/Tests/CMakeCommands/target_include_directories/same_two/same.h
new file mode 100644
index 0000000..91ac63c
--- /dev/null
+++ b/Tests/CMakeCommands/target_include_directories/same_two/same.h
@@ -0,0 +1 @@
+#define CORRECT_SAME_H_INCLUDED