cmake support shortname on windows


We use cmake 3.20.0 with ninja 1.9 on windows and linux.
Is there a cmake function to convert path names like
C:\Program Files (x86)\compilerpath
to short names (dos naming)

As I see in the ninja file the compiler path is transformed into shortname notation for calling.
Unfortunately the compiler (intel) generated dependency files contain the path with white spaces, so that ninja always thinks they are dirty and trigger a new build.
For example, ninja rule file:
command = C:\PROGRA~2\INTELS~1\COMPIL~1.216\windows\bin\intel64\icl.exe

Best regards

It looks like a problem with the dependencies generated by icl compiler.
Can you add an example of what the compiler generates for dependencies in case of paths with spaces?

Hi, this is what C/C++ Intel parallel studio 2020 update 1 produce:

C:\Program\ Files\ (x86)\Microsoft\ Visual\ Studio\2019\Professional\VC\Tools\MSVC\14.25.28610\include\concurrencysal.h
C:\Program\ Files\ (x86)\Microsoft\ Visual\ Studio\2019\Professional\VC\Tools\MSVC\14.25.28610\include\sal.h
C:\Program\ Files\ (x86)\Windows\ Kits\10\Include\10.0.18362.0\um\commctrl.rh
C:\Program\ Files\ (x86)\Windows\ Kits\10\Include\10.0.18362.0\um\dde.rh
C:\Program\ Files\ (x86)\Windows\ Kits\10\Include\10.0.18362.0\um\dlgs.h
C:\Program\ Files\ (x86)\Windows\ Kits\10\Include\10.0.18362.0\um\verrsrc.h
C:\Program\ Files\ (x86)\Windows\ Kits\10\Include\10.0.18362.0\um\winnt.rh
C:\Program\ Files\ (x86)\Windows\ Kits\10\Include\10.0.18362.0\um\winres.h
C:\Program\ Files\ (x86)\Windows\ Kits\10\Include\10.0.18362.0\um\winresrc.h
C:\Program\ Files\ (x86)\Windows\ Kits\10\Include\10.0.18362.0\um\winuser.rh
C:\Program\ Files\ (x86)\Windows\ Kits\10\Include\10.0.18362.0\um\winver.h
C:\Program\ Files\ (x86)\Windows\ Kits\10\include\10.0.18362.0\shared\SpecStrings.h
C:\Program\ Files\ (x86)\Windows\ Kits\10\include\10.0.18362.0\shared\driverspecs.h
C:\Program\ Files\ (x86)\Windows\ Kits\10\include\10.0.18362.0\shared\sdv_driverspecs.h
C:\Program\ Files\ (x86)\Windows\ Kits\10\include\10.0.18362.0\shared\winapifamily.h
C:\Program\ Files\ (x86)\Windows\ Kits\10\include\10.0.18362.0\shared\winpackagefamily.h \

after building with ninja and calling ninja again, it begins to build again because everything is dirty

Best regards

Ok after posting this the double backslashes disappear:
this e.g. is the original line
C:\\Program\ Files\ (x86)\\Windows\ Kits\\10\\Include\\10.0.18362.0\\um\\commctrl.rh \

I seems like C/C++ Intel oneApi 2021.2.0 does produce correct dependency files without double backslashes.


thanks for the awesome information.