summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeCCompiler.cmake.in
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-09-18 13:09:07 (GMT)
committerBrad King <brad.king@kitware.com>2015-09-18 14:02:53 (GMT)
commit109a7a245acf0c367ac092f6c9a20661e7a31529 (patch)
treeb4e786f43b4bec7a75f4854e10cd0745e82c765d /Modules/CMakeCCompiler.cmake.in
parent828c05b9f567e0652ebbee6df2799a189ff586fe (diff)
downloadCMake-109a7a245acf0c367ac092f6c9a20661e7a31529.zip
CMake-109a7a245acf0c367ac092f6c9a20661e7a31529.tar.gz
CMake-109a7a245acf0c367ac092f6c9a20661e7a31529.tar.bz2
Ninja: Detect MSVC /showIncludes prefix with compiler flags (#15596)
Move detection over to the compiler id logic where we have already constructed the list of compiler flags from ARG1 and CMAKE_<LANG>_FLAGS. Pass the flags when we execute "cl" with "/showIncludes". Also pass "/c" because we only need to compile, not link. Check the compiler process exit code before trusting its output.
Diffstat (limited to 'Modules/CMakeCCompiler.cmake.in')
-rw-r--r--Modules/CMakeCCompiler.cmake.in7
1 files changed, 5 insertions, 2 deletions
diff --git a/Modules/CMakeCCompiler.cmake.in b/Modules/CMakeCCompiler.cmake.in
index 00c6fdf..c72e338 100644
--- a/Modules/CMakeCCompiler.cmake.in
+++ b/Modules/CMakeCCompiler.cmake.in
@@ -53,11 +53,14 @@ if(CMAKE_C_LIBRARY_ARCHITECTURE)
set(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_C_LIBRARY_ARCHITECTURE@")
endif()
+set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "@CMAKE_C_CL_SHOWINCLUDES_PREFIX@")
+if(CMAKE_C_CL_SHOWINCLUDES_PREFIX)
+ set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}")
+endif()
+
@CMAKE_C_SYSROOT_FLAG_CODE@
@CMAKE_C_OSX_DEPLOYMENT_TARGET_FLAG_CODE@
set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "@CMAKE_C_IMPLICIT_LINK_LIBRARIES@")
set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "@CMAKE_C_IMPLICIT_LINK_DIRECTORIES@")
set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "@CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES@")
-
-@SET_CMAKE_CL_SHOWINCLUDES_PREFIX@