Repository navigation
Open
Description
Right now, make mingw seems to have some notion of MinGW hardcoded. This is nice as a start until you try to run it on a distribution where it's named differently. So I thought why not just specify CXX, CXX, and HOST, like the cmake error actually encourages me to, but it's all ignored:
$ make mingw CC=/usr/bin/x86_64-w64-mingw32-gcc CXX=/usr/bin/x86_64-w64-mingw32-g++ HOST=/usr/bin/x86_64-w64-mingw32 CFLAGS="-m64"
mkdir -p build-mingw; \
cd build-mingw; \
cmake .. -DCMAKE_TOOLCHAIN_FILE=../toolchain-mingw32.cmake -DCMAKE_INSTALL_PREFIX=windows ;\
make && make install
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:2 (project):
The CMAKE_C_COMPILER:
i686-w64-mingw32-gcc
is not a full path and was not found in the PATH.
Tell CMake where to find the compiler by setting either the environment
variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
the compiler, or to the compiler name if it is in the PATH.
CMake Error at CMakeLists.txt:2 (project):
The CMAKE_CXX_COMPILER:
i686-w64-mingw32-g++
is not a full path and was not found in the PATH.
Tell CMake where to find the compiler by setting either the environment
variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.
-- Configuring incomplete, errors occurred!
See also "/home/user/commonmark/build-mingw/CMakeFiles/CMakeOutput.log".
See also "/home/user/commonmark/build-mingw/CMakeFiles/CMakeError.log".
make[1]: Entering directory '/home/user/commonmark/build-mingw'
make[1]: *** No targets specified and no makefile found. Stop.
make[1]: Leaving directory '/home/user/commonmark/build-mingw'
make: *** [Makefile:102: mingw] Error 2
I even tried to modify cmark's Makefile to pass on the CC, CXX, HOST vars to the cmake call (which I think they should be), but cmake still ignores it. If that could be made to work that would be great, because with autotools and similar, setting CC/CXX and specifying the --host version works perfectly, same for most plain Makefiles that don't use cmake behind the scenes.
Metadata
Metadata
Assignees
Labels
No labels
Activity
ell1e commentedon Sep 25, 2023
Funnily enough, with this hacky 3 line edit, it works just fine:
Now the problem is, obviously that will break it for users who are not overriding CC and CXX via the command line.
Maybe someone who actually knows their way around cmake can fix this? Ideally what it should do is see if the compilers set in the toolchain file actually exist, and only if they don't, use CC and CXX from the command line as provided to
make mingw. Funnily enough, the error message seems to suggest that it does that, but it doesn't and just always ignores CC and CXX no matter how I pass it into cmake.ell1e commentedon Sep 29, 2023
I've switched to a different markdown library now that is easier to build for more unusual platforms. Would be cool though if at least for others this could be eventually addressed.