How to set up and use ccache (with cygwin) on wind

2020-07-29 17:16发布

问题:

I am not able to set up Ccache on Windows using Cygwin.

What do i want to do ? I want to install CCache on a Windows PC so i could use it to compile C and C++ projects.

I have almost no Knowledge about C/C++ and the whole GCC/G++ Compiler thing.
main sources for my approaches:
- https://wiki.archlinux.org/index.php/ccache
- http://charette.no-ip.com:81/programming/2016-02-07_CCache/index.html
- https://askubuntu.com/questions/470545/how-do-i-set-up-ccache

Ccache is made for Unix-systems only so in order to get the bash commands i installed Cygwin for windows.
I have also installed MinGW32 on my C:/ drive. In Cygwin I installed the following packages: (View: Picked)

- autoconfig                    13-1
- ccache                        3.1.9-2
- ccache-debuginfo              3.1.9-2
- fish                          2.7.0-1
- gcc-tools-epoch2-autoconf     2.64-2
- gperf                         3.1-1
- libgcc1                       7.4.0-1
- make                          4.2.1-2
- mingw64x86_64-gcc-core        7.4.0-1
- mingw64x86_64-gcc-debuginfo   7.4.0-1
- mingw64x86_64-gcc-g++         7.4.0-1

After the installation i can use "ccache -V" inside Cygwin and it tells me i got version 3.1.9

according to the tutorials i am following i should get:

/usr/lib/ccache/gcc 
/usr/lib/ccache/g++

if i type the command: "which gcc g++".
But i am getting as default the following:

/cygdrive/c/mingw/bin/gcc
/cygdrive/c/mingw/bin/g++

So i wanted to change the path. But the structure of ccache inside cygwin seems to be way different then it is when you install it with sudo on a unix machine.
I cant find any gcc or g++ compilers inside ccache or at all in cygwin.
But ccache is also not at usr/lib/ccache in cygwin. If i type in "which ccache" it gives me the path usr/bin/ccache.

I am out of ideas and it seems like i just dont have enough knowledge about C compilers in general to get an idea of what to do / where to search.