The sh.exe
is only a problem when you run CMake the first time when trying to build the project. You can rerun it afterwords and CMake will continue with normal processing. I saw a patch that removes this check and should be part of a future release of CMake.
On SO it was shown that gcc
was printing an error message of Error 1
.
Run Build Command(s):C:/ProgramData/chocolatey/bin/mingw32-make.exe cmTC_ffa53/fast && C:/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin/mingw32-make -f CMakeFiles\cmTC_ffa53.dir\build.make CMakeFiles/cmTC_ffa53.dir/build
mingw32-make[1]: Entering directory 'C:/gitlab-runner/builds/zjE1Mkfg/0/mlz/kww/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_ffa53.dir/testCCompiler.c.obj
C:\ProgramData\chocolatey\bin\x86_64-w64-mingw32-gcc.exe -o CMakeFiles\cmTC_ffa53.dir\testCCompiler.c.obj -c C:\gitlab-runner\builds\zjE1Mkfg\0\mlz\kww\build\CMakeFiles\CMakeTmp\testCCompiler.c
mingw32-make[1]: *** [CMakeFiles\cmTC_ffa53.dir\build.make:65: CMakeFiles/cmTC_ffa53.dir/testCCompiler.c.obj] Error 1
mingw32-make[1]: Leaving directory 'C:/gitlab-runner/builds/zjE1Mkfg/0/mlz/kww/build/CMakeFiles/CMakeTmp'
mingw32-make: *** [Makefile:120: cmTC_ffa53/fast] Error 2
I have doubts that x86_64-w64-mingw32-gcc
is installed correctly. You can paste the command, C:\ProgramData\chocolatey\bin\x86_64-w64-mingw32-gcc.exe -o CMakeFiles\cmTC_ffa53.dir\testCCompiler.c.obj -c C:\gitlab-runner\builds\zjE1Mkfg\0\mlz\kww\build\CMakeFiles\CMakeTmp\testCCompiler.c
, directly into your command shell and see what it does (if the files still exist).
For these kinds of problems you can run CMake with the -debug-trycompile
option and the test project won’t be automatically cleaned up.
The first message in the output was -- The C compiler identification is unknown
which is pretty clear your compiler isn’t working. All of the output for this step is in the log and error files that CMake generates in the build folder. You’ll be able to see how it invoked the compiler and with which options. Again this is pointing to a compiler installation problem.