Ninja: don't set cmcldeps vars to empty string when they are not defined
This commit is contained in:
parent
64c5752d93
commit
8b27a94f28
|
@ -49,7 +49,5 @@ SET(CMAKE_C_HAS_ISYSROOT "@CMAKE_C_HAS_ISYSROOT@")
|
|||
SET(CMAKE_C_IMPLICIT_LINK_LIBRARIES "@CMAKE_C_IMPLICIT_LINK_LIBRARIES@")
|
||||
SET(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "@CMAKE_C_IMPLICIT_LINK_DIRECTORIES@")
|
||||
|
||||
IF(MSVC_CXX_ARCHITECTURE_ID)
|
||||
SET(CMAKE_CMCLDEPS_EXECUTABLE "@CMAKE_CMCLDEPS_EXECUTABLE@")
|
||||
SET(CMAKE_CL_SHOWINCLUDE_PREFIX "@CMAKE_CL_SHOWINCLUDE_PREFIX@")
|
||||
ENDIF()
|
||||
@SET_CMAKE_CMCLDEPS_EXECUTABLE@
|
||||
@SET_CMAKE_CL_SHOWINCLUDE_PREFIX@
|
||||
|
|
|
@ -50,7 +50,5 @@ SET(CMAKE_CXX_HAS_ISYSROOT "@CMAKE_CXX_HAS_ISYSROOT@")
|
|||
SET(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "@CMAKE_CXX_IMPLICIT_LINK_LIBRARIES@")
|
||||
SET(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "@CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES@")
|
||||
|
||||
IF(MSVC_CXX_ARCHITECTURE_ID)
|
||||
SET(CMAKE_CMCLDEPS_EXECUTABLE "@CMAKE_CMCLDEPS_EXECUTABLE@")
|
||||
SET(CMAKE_CL_SHOWINCLUDE_PREFIX "@CMAKE_CL_SHOWINCLUDE_PREFIX@")
|
||||
ENDIF()
|
||||
@SET_CMAKE_CMCLDEPS_EXECUTABLE@
|
||||
@SET_CMAKE_CL_SHOWINCLUDE_PREFIX@
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
# in front of each include path, so it can remove it.
|
||||
#
|
||||
|
||||
IF(MSVC_C_ARCHITECTURE_ID AND CMAKE_GENERATOR MATCHES "Ninja" AND CMAKE_C_COMPILER)
|
||||
IF(MSVC_C_ARCHITECTURE_ID AND CMAKE_GENERATOR MATCHES "Ninja" AND CMAKE_C_COMPILER AND CMAKE_COMMAND)
|
||||
STRING(REPLACE "cmake.exe" "cmcldeps.exe" CMAKE_CMCLDEPS_EXECUTABLE ${CMAKE_COMMAND})
|
||||
SET(showdir ${CMAKE_BINARY_DIR}/CMakeFiles/ShowIncludes)
|
||||
FILE(WRITE ${showdir}/foo.h "\n")
|
||||
|
@ -29,5 +29,6 @@ IF(MSVC_C_ARCHITECTURE_ID AND CMAKE_GENERATOR MATCHES "Ninja" AND CMAKE_C_COMPIL
|
|||
STRING(TOLOWER ${header1} header2)
|
||||
STRING(REPLACE ${header2} "" showOut2 ${showOut1})
|
||||
STRING(REPLACE "\n" "" showOut3 ${showOut2})
|
||||
SET(CMAKE_CL_SHOWINCLUDE_PREFIX ${showOut3} CACHE STRING "cl.exe's /showInclides prefix" FORCE)
|
||||
SET(SET_CMAKE_CMCLDEPS_EXECUTABLE "SET(CMAKE_CMCLDEPS_EXECUTABLE \"${CMAKE_CMCLDEPS_EXECUTABLE}\")")
|
||||
SET(SET_CMAKE_CL_SHOWINCLUDE_PREFIX "SET(CMAKE_CL_SHOWINCLUDE_PREFIX \"${showOut3}\")")
|
||||
ENDIF()
|
||||
|
|
Loading…
Reference in New Issue