Ninja: don't set cmcldeps vars to empty string when they are not defined

This commit is contained in:
Peter Kuemmel 2012-06-09 11:36:53 +02:00
parent 64c5752d93
commit 8b27a94f28
3 changed files with 7 additions and 10 deletions

View File

@ -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_LIBRARIES "@CMAKE_C_IMPLICIT_LINK_LIBRARIES@")
SET(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "@CMAKE_C_IMPLICIT_LINK_DIRECTORIES@") SET(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "@CMAKE_C_IMPLICIT_LINK_DIRECTORIES@")
IF(MSVC_CXX_ARCHITECTURE_ID) @SET_CMAKE_CMCLDEPS_EXECUTABLE@
SET(CMAKE_CMCLDEPS_EXECUTABLE "@CMAKE_CMCLDEPS_EXECUTABLE@") @SET_CMAKE_CL_SHOWINCLUDE_PREFIX@
SET(CMAKE_CL_SHOWINCLUDE_PREFIX "@CMAKE_CL_SHOWINCLUDE_PREFIX@")
ENDIF()

View File

@ -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_LIBRARIES "@CMAKE_CXX_IMPLICIT_LINK_LIBRARIES@")
SET(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "@CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES@") SET(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "@CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES@")
IF(MSVC_CXX_ARCHITECTURE_ID) @SET_CMAKE_CMCLDEPS_EXECUTABLE@
SET(CMAKE_CMCLDEPS_EXECUTABLE "@CMAKE_CMCLDEPS_EXECUTABLE@") @SET_CMAKE_CL_SHOWINCLUDE_PREFIX@
SET(CMAKE_CL_SHOWINCLUDE_PREFIX "@CMAKE_CL_SHOWINCLUDE_PREFIX@")
ENDIF()

View File

@ -17,7 +17,7 @@
# in front of each include path, so it can remove it. # 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}) STRING(REPLACE "cmake.exe" "cmcldeps.exe" CMAKE_CMCLDEPS_EXECUTABLE ${CMAKE_COMMAND})
SET(showdir ${CMAKE_BINARY_DIR}/CMakeFiles/ShowIncludes) SET(showdir ${CMAKE_BINARY_DIR}/CMakeFiles/ShowIncludes)
FILE(WRITE ${showdir}/foo.h "\n") 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(TOLOWER ${header1} header2)
STRING(REPLACE ${header2} "" showOut2 ${showOut1}) STRING(REPLACE ${header2} "" showOut2 ${showOut1})
STRING(REPLACE "\n" "" showOut3 ${showOut2}) 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() ENDIF()