CMake/Modules/Platform
Brad King 9502276f82 Prefix implicit include directories with sysroot on construction
Since commit 7cd65c97fa (Add CMAKE_SYSROOT variable to set --sysroot
when cross compiling., 2013-04-13, v3.0.0-rc1~342^2) we have prefixed
the value of `CMAKE_SYSROOT` to implicit include directories.  This was
done because we hard-coded `/usr/include` as an implicit include
directory without accounting for the sysroot.  Instead we should prefix
the hard-coded paths when they are constructed.  Update the
`Platform/UnixPaths` module to do this as `Platform/Darwin` already
does.

Since commit 5990ecb741 (Compute implicit include directories from
compiler output, 2018-12-07, v3.14.0-rc1~108^2) the values of the
`CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES` variables are computed from
a real compiler invocation so they already account for the sysroot
prefix.  In commit 6fc3382944 (Update logic for sysroot in detected
implicit include directories, 2019-02-13, v3.14.0-rc2~6^2) we attempted
to apply the prefix conditionally, but that is incorrect because the
compiler's real implicit include directories are not all under the
sysroot.  Instead assume that all implicit include directories in
`CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES` already have the sysroot
prefix if needed.  Code that constructs the value must be responsible
for that because it is the only place that knows.
2019-02-18 17:09:26 -05:00
..
Android POSITION_INDEPENDENT_CODE: Manage link flags for executables 2018-11-11 17:34:09 +01:00
AIX-Clang-C.cmake
AIX-Clang-CXX.cmake
AIX-GNU-ASM.cmake
AIX-GNU-C.cmake
AIX-GNU-CXX.cmake
AIX-GNU-Fortran.cmake
AIX-GNU.cmake GNU: Use -fvisibility on AIX when supported 2018-01-12 11:50:10 -05:00
AIX-VisualAge-C.cmake
AIX-VisualAge-CXX.cmake
AIX-VisualAge-Fortran.cmake
AIX-XL-ASM.cmake
AIX-XL-C.cmake XL: Fix the use of the -qhalt flag for varying OSs 2017-04-27 13:29:28 -04:00
AIX-XL-CXX.cmake XL: Fix the use of the -qhalt flag for varying OSs 2017-04-27 13:29:28 -04:00
AIX-XL-Fortran.cmake
AIX-XL.cmake
AIX.cmake
Android-Clang-ASM.cmake Android: Set compiler target platform when compiling ASM with Clang 2017-01-10 14:12:46 -05:00
Android-Clang-C.cmake
Android-Clang-CXX.cmake Android: Suppress implicit -lstdc++ linker flag 2018-04-03 14:34:57 -04:00
Android-Clang.cmake Android: Add clang --target= flag to compiler predefines command 2018-10-05 10:23:52 -04:00
Android-Common.cmake Android: Add support for NDK r18 2018-08-28 09:27:26 -04:00
Android-Determine-C.cmake
Android-Determine-CXX.cmake
Android-Determine.cmake IN_LIST: Ensure policy allows if(IN_LIST) if used by a module 2018-09-12 14:50:16 +08:00
Android-GNU-C.cmake
Android-GNU-CXX.cmake Android: Suppress implicit -lstdc++ linker flag 2018-04-03 14:34:57 -04:00
Android-GNU.cmake
Android-Initialize.cmake Android: Add support for unified headers 2017-06-12 11:47:30 -04:00
Android.cmake
Apple-Absoft-Fortran.cmake Apple: Use CMAKE_EFFECTIVE_SYSTEM_NAME to share compiler info 2018-04-18 07:41:42 -04:00
Apple-AppleClang-C.cmake Apple: Use CMAKE_EFFECTIVE_SYSTEM_NAME to share compiler info 2018-04-18 07:41:42 -04:00
Apple-AppleClang-CXX.cmake Apple: Use CMAKE_EFFECTIVE_SYSTEM_NAME to share compiler info 2018-04-18 07:41:42 -04:00
Apple-Clang-C.cmake Apple: Use CMAKE_EFFECTIVE_SYSTEM_NAME to share compiler info 2018-04-18 07:41:42 -04:00
Apple-Clang-CXX.cmake Apple: Use CMAKE_EFFECTIVE_SYSTEM_NAME to share compiler info 2018-04-18 07:41:42 -04:00
Apple-Clang.cmake Apple: Use include_guard() within compiler config 2018-04-18 07:41:44 -04:00
Apple-GNU-C.cmake Apple: Use CMAKE_EFFECTIVE_SYSTEM_NAME to share compiler info 2018-04-18 07:41:42 -04:00
Apple-GNU-CXX.cmake Apple: Use CMAKE_EFFECTIVE_SYSTEM_NAME to share compiler info 2018-04-18 07:41:42 -04:00
Apple-GNU-Fortran.cmake Apple: Use CMAKE_EFFECTIVE_SYSTEM_NAME to share compiler info 2018-04-18 07:41:42 -04:00
Apple-GNU.cmake Apple: Use include_guard() within compiler config 2018-04-18 07:41:44 -04:00
Apple-Intel-C.cmake Apple: Use CMAKE_EFFECTIVE_SYSTEM_NAME to share compiler info 2018-04-18 07:41:42 -04:00
Apple-Intel-CXX.cmake Apple: Use CMAKE_EFFECTIVE_SYSTEM_NAME to share compiler info 2018-04-18 07:41:42 -04:00
Apple-Intel-Fortran.cmake Apple: Use CMAKE_EFFECTIVE_SYSTEM_NAME to share compiler info 2018-04-18 07:41:42 -04:00
Apple-Intel.cmake LINK_OPTIONS: Add support of "LINKER:" prefix 2018-06-06 17:22:41 +02:00
Apple-NAG-Fortran.cmake Apple: Use CMAKE_EFFECTIVE_SYSTEM_NAME to share compiler info 2018-04-18 07:41:42 -04:00
Apple-NVIDIA-CUDA.cmake Apple: Use CMAKE_EFFECTIVE_SYSTEM_NAME to share compiler info 2018-04-18 07:41:42 -04:00
Apple-PGI-C.cmake Apple: Use CMAKE_EFFECTIVE_SYSTEM_NAME to share compiler info 2018-04-18 07:41:42 -04:00
Apple-PGI-CXX.cmake Apple: Use CMAKE_EFFECTIVE_SYSTEM_NAME to share compiler info 2018-04-18 07:41:42 -04:00
Apple-PGI-Fortran.cmake Apple: Use CMAKE_EFFECTIVE_SYSTEM_NAME to share compiler info 2018-04-18 07:41:42 -04:00
Apple-PGI.cmake Apple: Use include_guard() within compiler config 2018-04-18 07:41:44 -04:00
Apple-VisualAge-C.cmake Apple: Use CMAKE_EFFECTIVE_SYSTEM_NAME to share compiler info 2018-04-18 07:41:42 -04:00
Apple-VisualAge-CXX.cmake Apple: Use CMAKE_EFFECTIVE_SYSTEM_NAME to share compiler info 2018-04-18 07:41:42 -04:00
Apple-XL-C.cmake Apple: Use CMAKE_EFFECTIVE_SYSTEM_NAME to share compiler info 2018-04-18 07:41:42 -04:00
Apple-XL-CXX.cmake Apple: Use CMAKE_EFFECTIVE_SYSTEM_NAME to share compiler info 2018-04-18 07:41:42 -04:00
ARTOS-GNU-C.cmake
ARTOS.cmake
BeOS.cmake
BlueGeneL.cmake
BlueGeneP-base.cmake
BlueGeneP-dynamic-GNU-C.cmake
BlueGeneP-dynamic-GNU-CXX.cmake
BlueGeneP-dynamic-GNU-Fortran.cmake
BlueGeneP-dynamic-XL-C.cmake XL: Fix the use of the -qhalt flag for varying OSs 2017-04-27 13:29:28 -04:00
BlueGeneP-dynamic-XL-CXX.cmake XL: Fix the use of the -qhalt flag for varying OSs 2017-04-27 13:29:28 -04:00
BlueGeneP-dynamic-XL-Fortran.cmake
BlueGeneP-dynamic.cmake
BlueGeneP-static-GNU-C.cmake
BlueGeneP-static-GNU-CXX.cmake
BlueGeneP-static-GNU-Fortran.cmake
BlueGeneP-static-XL-C.cmake XL: Fix the use of the -qhalt flag for varying OSs 2017-04-27 13:29:28 -04:00
BlueGeneP-static-XL-CXX.cmake XL: Fix the use of the -qhalt flag for varying OSs 2017-04-27 13:29:28 -04:00
BlueGeneP-static-XL-Fortran.cmake
BlueGeneP-static.cmake
BlueGeneQ-base.cmake
BlueGeneQ-dynamic-GNU-C.cmake
BlueGeneQ-dynamic-GNU-CXX.cmake
BlueGeneQ-dynamic-GNU-Fortran.cmake
BlueGeneQ-dynamic-XL-C.cmake XL: Fix the use of the -qhalt flag for varying OSs 2017-04-27 13:29:28 -04:00
BlueGeneQ-dynamic-XL-CXX.cmake XL: Fix the use of the -qhalt flag for varying OSs 2017-04-27 13:29:28 -04:00
BlueGeneQ-dynamic-XL-Fortran.cmake
BlueGeneQ-dynamic.cmake
BlueGeneQ-static-GNU-C.cmake
BlueGeneQ-static-GNU-CXX.cmake
BlueGeneQ-static-GNU-Fortran.cmake
BlueGeneQ-static-XL-C.cmake XL: Fix the use of the -qhalt flag for varying OSs 2017-04-27 13:29:28 -04:00
BlueGeneQ-static-XL-CXX.cmake XL: Fix the use of the -qhalt flag for varying OSs 2017-04-27 13:29:28 -04:00
BlueGeneQ-static-XL-Fortran.cmake
BlueGeneQ-static.cmake
BSDOS.cmake
Catamount.cmake
CrayLinuxEnvironment.cmake
CYGWIN-Clang-C.cmake
CYGWIN-Clang-CXX.cmake
CYGWIN-Determine-CXX.cmake
CYGWIN-GNU-C.cmake
CYGWIN-GNU-CXX.cmake
CYGWIN-GNU-Fortran.cmake
CYGWIN-GNU.cmake PIE link options: Update strategy to fix performance regression 2018-12-19 19:41:27 +11:00
CYGWIN-windres.cmake
CYGWIN.cmake Cygwin: Move Cygwin-specific paths to the cygwin platform 2017-03-16 06:04:29 -04:00
Darwin-Determine-CXX.cmake
Darwin-Initialize.cmake Apple: Introduce separate system name for iOS, tvOS, and watchOS 2019-02-04 09:03:35 -05:00
Darwin.cmake macOS: Fix addition of <sdk>/usr/include to default implicit include dirs 2019-02-13 09:52:19 -05:00
DragonFly.cmake RPATH: Record support for $ORIGIN on various *BSD 2018-10-26 09:27:29 -04:00
eCos.cmake
Euros.cmake
FreeBSD-Determine-CXX.cmake FreeBSD prefers to call the C++ compiler c++ (just like Linux, Darwin, ..) 2017-09-20 10:52:29 +02:00
FreeBSD.cmake POSITION_INDEPENDENT_CODE: Manage link flags for executables 2018-11-11 17:34:09 +01:00
Fuchsia.cmake PIE link options: Update strategy to fix performance regression 2018-12-19 19:41:27 +11:00
gas.cmake
Generic-ADSP-ASM.cmake
Generic-ADSP-C.cmake LINK_OPTIONS: Add support of "LINKER:" prefix 2018-06-06 17:22:41 +02:00
Generic-ADSP-Common.cmake
Generic-ADSP-CXX.cmake LINK_OPTIONS: Add support of "LINKER:" prefix 2018-06-06 17:22:41 +02:00
Generic-SDCC-C.cmake LINK_OPTIONS: Add support of "LINKER:" prefix 2018-06-06 17:22:41 +02:00
Generic.cmake
GHS-MULTI-Initialize.cmake GHS: Only print bsp and os directives if specified by user 2019-01-16 10:40:59 -05:00
GHS-MULTI.cmake
GNU.cmake Platform/GNU: Add Debian shared library permissions policy 2018-10-03 13:12:21 -04:00
GNUtoMS_lib.bat.in GNUToMS: Tolerate existence of a %USERPROFILE%/source directory 2017-08-25 14:24:24 -04:00
GNUtoMS_lib.cmake
Haiku.cmake RPATH: Record support for $ORIGIN on Haiku and Solaris 2018-10-26 09:26:47 -04:00
HP-UX-GNU-ASM.cmake
HP-UX-GNU-C.cmake
HP-UX-GNU-CXX.cmake
HP-UX-GNU-Fortran.cmake
HP-UX-GNU.cmake Use string(APPEND) in Modules 2017-05-17 11:26:11 -06:00
HP-UX-HP-ASM.cmake
HP-UX-HP-C.cmake
HP-UX-HP-CXX.cmake
HP-UX-HP-Fortran.cmake
HP-UX-HP.cmake
HP-UX.cmake
iOS-Determine-CXX.cmake Apple: Introduce separate system name for iOS, tvOS, and watchOS 2019-02-04 09:03:35 -05:00
iOS-Initialize.cmake Apple: Introduce separate system name for iOS, tvOS, and watchOS 2019-02-04 09:03:35 -05:00
iOS.cmake Apple: Introduce separate system name for iOS, tvOS, and watchOS 2019-02-04 09:03:35 -05:00
kFreeBSD.cmake
Linux-Absoft-Fortran.cmake
Linux-CCur-Fortran.cmake
Linux-Clang-C.cmake
Linux-Clang-CXX.cmake
Linux-como.cmake
Linux-Determine-CXX.cmake
Linux-GNU-C.cmake
Linux-GNU-CXX.cmake
Linux-GNU-Fortran.cmake
Linux-GNU.cmake Move GNU COMPILER_PREDEFINES_COMMAND from Platform to Compiler 2018-06-01 09:21:06 +02:00
Linux-Intel-C.cmake
Linux-Intel-CXX.cmake
Linux-Intel-Fortran.cmake
Linux-Intel.cmake PIE link options: Update strategy to fix performance regression 2018-12-19 19:41:27 +11:00
Linux-NAG-Fortran.cmake
Linux-PathScale-C.cmake
Linux-PathScale-CXX.cmake
Linux-PathScale-Fortran.cmake
Linux-PathScale.cmake
Linux-PGI-C.cmake
Linux-PGI-CXX.cmake
Linux-PGI-Fortran.cmake
Linux-PGI.cmake PIE link options: Update strategy to fix performance regression 2018-12-19 19:41:27 +11:00
Linux-SunPro-CXX.cmake
Linux-TinyCC-C.cmake TinyCC: Support ENABLE_EXPORT property 2017-04-17 17:34:52 +02:00
Linux-VisualAge-C.cmake
Linux-VisualAge-CXX.cmake
Linux-VisualAge-Fortran.cmake
Linux-XL-C.cmake
Linux-XL-CXX.cmake
Linux-XL-Fortran.cmake
Linux.cmake RPATH: Add option for using $ORIGIN in build tree 2018-10-26 09:25:51 -04:00
Midipix.cmake Midipix: Add minimal platform file 2017-09-20 14:44:30 -04:00
MirBSD.cmake
MP-RAS.cmake
NetBSD.cmake POSITION_INDEPENDENT_CODE: Manage link flags for executables 2018-11-11 17:34:09 +01:00
OpenBSD.cmake RPATH: Record support for $ORIGIN on various *BSD 2018-10-26 09:27:29 -04:00
OpenVMS.cmake
OSF1.cmake
QNX.cmake
RISCos.cmake
SCO_SV.cmake
SINIX.cmake PIE link options: Update strategy to fix performance regression 2018-12-19 19:41:27 +11:00
SunOS-GNU-C.cmake
SunOS-GNU-CXX.cmake
SunOS-GNU-Fortran.cmake
SunOS-GNU.cmake RPATH: Record support for $ORIGIN on Haiku and Solaris 2018-10-26 09:26:47 -04:00
SunOS-PathScale-C.cmake
SunOS-PathScale-CXX.cmake
SunOS-PathScale-Fortran.cmake
SunOS-PathScale.cmake
SunOS.cmake SunOS: Move solaris-specific paths to the solaris platform 2017-03-16 06:00:49 -04:00
syllable.cmake
Tru64.cmake
tvOS-Determine-CXX.cmake Apple: Introduce separate system name for iOS, tvOS, and watchOS 2019-02-04 09:03:35 -05:00
tvOS-Initialize.cmake Apple: Introduce separate system name for iOS, tvOS, and watchOS 2019-02-04 09:03:35 -05:00
tvOS.cmake Apple: Introduce separate system name for iOS, tvOS, and watchOS 2019-02-04 09:03:35 -05:00
ULTRIX.cmake
UNIX_SV.cmake PIE link options: Update strategy to fix performance regression 2018-12-19 19:41:27 +11:00
UnixPaths.cmake Prefix implicit include directories with sysroot on construction 2019-02-18 17:09:26 -05:00
UnixWare.cmake PIE link options: Update strategy to fix performance regression 2018-12-19 19:41:27 +11:00
watchOS-Determine-CXX.cmake Apple: Introduce separate system name for iOS, tvOS, and watchOS 2019-02-04 09:03:35 -05:00
watchOS-Initialize.cmake Apple: Introduce separate system name for iOS, tvOS, and watchOS 2019-02-04 09:03:35 -05:00
watchOS.cmake Apple: Introduce separate system name for iOS, tvOS, and watchOS 2019-02-04 09:03:35 -05:00
Windows-Borland-C.cmake
Windows-Borland-CXX.cmake
Windows-Clang-C.cmake
Windows-Clang-CXX.cmake Clang: Use -TP flag for C++ sources with clang-cl 2017-10-25 07:36:10 -04:00
Windows-Clang.cmake Clang: Use -TP flag for C++ sources with clang-cl 2017-10-25 07:36:10 -04:00
Windows-Determine-CXX.cmake
Windows-df.cmake Drop Visual Studio 8 2005 generator 2018-04-02 10:08:10 -04:00
Windows-Embarcadero-C.cmake
Windows-Embarcadero-CXX.cmake
Windows-Embarcadero.cmake LINK_OPTIONS: Add support of "LINKER:" prefix 2018-06-06 17:22:41 +02:00
Windows-Flang-Fortran.cmake Flang: Add support for compiling sources on Windows 2017-10-31 08:48:15 -04:00
Windows-G95-Fortran.cmake
Windows-GNU-C-ABI.cmake
Windows-GNU-C.cmake
Windows-GNU-CXX-ABI.cmake
Windows-GNU-CXX.cmake
Windows-GNU-Fortran-ABI.cmake
Windows-GNU-Fortran.cmake
Windows-GNU.cmake PIE link options: Update strategy to fix performance regression 2018-12-19 19:41:27 +11:00
Windows-Intel-ASM.cmake
Windows-Intel-C.cmake Ninja: Use deps=gcc for Intel Compiler on Windows 2019-01-30 14:59:23 -05:00
Windows-Intel-CXX.cmake Ninja: Use deps=gcc for Intel Compiler on Windows 2019-01-30 14:59:23 -05:00
Windows-Intel-Fortran.cmake
Windows-Intel.cmake Intel: Use xilib as librarian on Windows 2018-08-07 08:32:31 -04:00
Windows-MSVC-C.cmake
Windows-MSVC-CXX.cmake
Windows-MSVC.cmake MSVC: Respect CMAKE_RC_COMPILER and CMAKE_MT in vs_link_{dll,exe} 2018-10-29 13:40:47 -04:00
Windows-NVIDIA-CUDA.cmake MSVC: Respect CMAKE_RC_COMPILER and CMAKE_MT in vs_link_{dll,exe} 2018-10-29 13:40:47 -04:00
Windows-OpenWatcom-C.cmake
Windows-OpenWatcom-CXX.cmake
Windows-OpenWatcom.cmake
Windows-PGI-C.cmake Windows-PGI: Add platform definitions 2017-05-20 20:02:51 +02:00
Windows-PGI-Fortran.cmake Windows-PGI: Add platform definitions 2017-05-20 20:02:51 +02:00
Windows-PGI.cmake Windows-PGI: Add platform definitions 2017-05-20 20:02:51 +02:00
Windows-Watcom-C.cmake
Windows-Watcom-CXX.cmake
Windows-windres.cmake
Windows.cmake VS: Treat libraries ending in .targets as msbuild imports 2016-11-09 16:19:07 -05:00
WindowsCE-MSVC-C.cmake
WindowsCE-MSVC-CXX.cmake
WindowsCE.cmake
WindowsPaths.cmake
WindowsPhone-Clang-C.cmake Add WindowsPhone and WindowsStore platform modules for Clang/GNU C/CXX 2018-07-08 00:06:37 +03:00
WindowsPhone-Clang-CXX.cmake Add WindowsPhone and WindowsStore platform modules for Clang/GNU C/CXX 2018-07-08 00:06:37 +03:00
WindowsPhone-GNU-C.cmake Add WindowsPhone and WindowsStore platform modules for Clang/GNU C/CXX 2018-07-08 00:06:37 +03:00
WindowsPhone-GNU-CXX.cmake Add WindowsPhone and WindowsStore platform modules for Clang/GNU C/CXX 2018-07-08 00:06:37 +03:00
WindowsPhone-MSVC-C.cmake
WindowsPhone-MSVC-CXX.cmake
WindowsPhone.cmake
WindowsStore-Clang-C.cmake Add WindowsPhone and WindowsStore platform modules for Clang/GNU C/CXX 2018-07-08 00:06:37 +03:00
WindowsStore-Clang-CXX.cmake Add WindowsPhone and WindowsStore platform modules for Clang/GNU C/CXX 2018-07-08 00:06:37 +03:00
WindowsStore-GNU-C.cmake Add WindowsPhone and WindowsStore platform modules for Clang/GNU C/CXX 2018-07-08 00:06:37 +03:00
WindowsStore-GNU-CXX.cmake Add WindowsPhone and WindowsStore platform modules for Clang/GNU C/CXX 2018-07-08 00:06:37 +03:00
WindowsStore-MSVC-C.cmake
WindowsStore-MSVC-CXX.cmake
WindowsStore.cmake
Xenix.cmake