[foreign] Running tests on Windows

Jorn Vernee jbvernee at xs4all.nl
Wed Sep 19 21:44:58 UTC 2018


Maurizio Cimadamore schreef op 2018-09-19 23:11:
> So it seems like your issue is: if you try to compile a c/cpp file
> with an include to clang-c/Index.h using MSVC from cygwin, that fails,
> correct? Which in turns trips up the build configure script.

Yes, I've tried with both .c and .cpp files.

I've also tested with renaming the LLVM folder (since I read there can 
be naming conflicts with cygwin), no success.

I've also tried using a dummy header file `dummy.h` in a J:\test folder, 
and also putting it in a folder somewhere in the cygwin file system and 
that is not being picked up either, so it does not seem to be a problem 
with the LLVM binary.

I have found a way that it does work, if I use a windows style path, but 
also escape the the slashes i.e. :

$ ~/cl.exe -c -I J:\\LLVM\\include /showIncludes main.c
Microsoft (R) C/C++ Optimizing Compiler Version 19.14.26430 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

main.c
Note: including file: J:\LLVM\include\clang-c/Index.h
J:\LLVM\include\clang-c/Index.h(19): fatal error C1083: Cannot open 
include file: 'time.h': No such file or directory

It seems like cygwin is not translating the unix style path, since that 
should work according to cygpath:

$ cygpath -w /cygdrive/j/LLVM/include/clang-c/Index.h
J:\LLVM\include\clang-c\Index.h

But it _is_ trying to translate the windows style path, which doesn't 
work:

$ cygpath -w J:\LLVM\include\clang-c\Index.h
J:LLVMincludeclang-cIndex.h

So adding escapes for the slashes seems to work:

$ cygpath -w \J:\\LLVM\\include\\clang-c\\Index.h
J:\LLVM\include\clang-c\Index.h

I noticed that the -I option is also being used in other places in 
config, so maybe there is a missing configuration step of cygwin path 
mangling before trying to find the header files.

Jorn


More information about the panama-dev mailing list