summaryrefslogtreecommitdiff
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-01-21 11:09:32 -0500
committerBrad King <brad.king@kitware.com>2019-01-21 11:14:07 -0500
commit15ad8300621eaf9fe23cda30368f90b420505d43 (patch)
tree8ac4188548a5addf9634e0d8f243a875b918197e /Modules
parenta61c061b6143cb6d8920b1b5796a867c0f104556 (diff)
downloadcmake-15ad8300621eaf9fe23cda30368f90b420505d43.tar.gz
Refactor exclusion of -I/usr/include to avoid per-language values
Add a `CMAKE_PLATFORM_IMPLICIT_INCLUDE_DIRECTORIES` to contain the hard-coded list of paths to be excluded from `-I` arguments so that the values remain excluded even if the per-language `CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES` variants change. This is needed to preserve our historical exclusion of `-I/usr/include` even when it is not a real implicit include directory. A policy may be needed to remove it later.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/Platform/UnixPaths.cmake7
1 files changed, 7 insertions, 0 deletions
diff --git a/Modules/Platform/UnixPaths.cmake b/Modules/Platform/UnixPaths.cmake
index 328d3c6d3a..fc22fce0ba 100644
--- a/Modules/Platform/UnixPaths.cmake
+++ b/Modules/Platform/UnixPaths.cmake
@@ -63,6 +63,13 @@ list(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
/lib /lib32 /lib64 /usr/lib /usr/lib32 /usr/lib64
)
+# Platform-wide directories to avoid adding via -I<dir>.
+list(APPEND CMAKE_PLATFORM_IMPLICIT_INCLUDE_DIRECTORIES
+ /usr/include
+ )
+
+# Default per-language values. These may be later replaced after
+# parsing the implicit link directories from compiler output.
list(APPEND CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES
/usr/include
)