Ninja: also detect /showInclude prefix for icl
This commit is contained in:
parent
f32e7957b4
commit
0af27f1f2a
|
@ -26,12 +26,9 @@ if(MSVC_C_ARCHITECTURE_ID AND CMAKE_GENERATOR MATCHES "Ninja" AND CMAKE_C_COMPIL
|
|||
file(WRITE ${showdir}/foo.h "\n")
|
||||
file(WRITE ${showdir}/main.c "#include \"foo.h\" \nint main(){}\n")
|
||||
execute_process(COMMAND ${CMAKE_C_COMPILER} /nologo /showIncludes ${showdir}/main.c
|
||||
WORKING_DIRECTORY ${showdir} OUTPUT_VARIABLE showOut)
|
||||
string(REPLACE main.c "" showOut1 ${showOut})
|
||||
string(REPLACE "/" "\\" header1 ${showdir}/foo.h)
|
||||
string(TOLOWER ${header1} header2)
|
||||
string(REPLACE ${header2} "" showOut2 ${showOut1})
|
||||
string(REPLACE "\n" "" showOut3 ${showOut2})
|
||||
WORKING_DIRECTORY ${showdir} OUTPUT_VARIABLE outLine)
|
||||
string(REGEX MATCH "\n([^:]*:[^:]*:[ \t]*)" tmp "${outLine}")
|
||||
set(localizedPrefix "${CMAKE_MATCH_1}")
|
||||
set(SET_CMAKE_CMCLDEPS_EXECUTABLE "set(CMAKE_CMCLDEPS_EXECUTABLE \"${CMAKE_CMCLDEPS_EXECUTABLE}\")")
|
||||
set(SET_CMAKE_CL_SHOWINCLUDE_PREFIX "set(CMAKE_CL_SHOWINCLUDE_PREFIX \"${showOut3}\")")
|
||||
set(SET_CMAKE_CL_SHOWINCLUDE_PREFIX "set(CMAKE_CL_SHOWINCLUDE_PREFIX \"${localizedPrefix}\")")
|
||||
endif()
|
||||
|
|
Loading…
Reference in New Issue