Merge topic 'cmcldeps-icl'
0af27f1
Ninja: also detect /showInclude prefix for icl
This commit is contained in:
commit
bbcd177f30
|
@ -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}/foo.h "\n")
|
||||||
file(WRITE ${showdir}/main.c "#include \"foo.h\" \nint main(){}\n")
|
file(WRITE ${showdir}/main.c "#include \"foo.h\" \nint main(){}\n")
|
||||||
execute_process(COMMAND ${CMAKE_C_COMPILER} /nologo /showIncludes ${showdir}/main.c
|
execute_process(COMMAND ${CMAKE_C_COMPILER} /nologo /showIncludes ${showdir}/main.c
|
||||||
WORKING_DIRECTORY ${showdir} OUTPUT_VARIABLE showOut)
|
WORKING_DIRECTORY ${showdir} OUTPUT_VARIABLE outLine)
|
||||||
string(REPLACE main.c "" showOut1 ${showOut})
|
string(REGEX MATCH "\n([^:]*:[^:]*:[ \t]*)" tmp "${outLine}")
|
||||||
string(REPLACE "/" "\\" header1 ${showdir}/foo.h)
|
set(localizedPrefix "${CMAKE_MATCH_1}")
|
||||||
string(TOLOWER ${header1} header2)
|
|
||||||
string(REPLACE ${header2} "" showOut2 ${showOut1})
|
|
||||||
string(REPLACE "\n" "" showOut3 ${showOut2})
|
|
||||||
set(SET_CMAKE_CMCLDEPS_EXECUTABLE "set(CMAKE_CMCLDEPS_EXECUTABLE \"${CMAKE_CMCLDEPS_EXECUTABLE}\")")
|
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()
|
endif()
|
||||||
|
|
Loading…
Reference in New Issue