Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

`make mingw` should forward/use CC, CXX, HOST variables if set

Abierto
#484 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
42/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
c, cmake
Área
build-system

Línea de trabajo

Comienza con el objetivo mingw en Makefile y la configuración de toolchain-mingw32.cmake; reproduce el problema usando el comando mostrado con valores personalizados para CC, CXX y HOST. El trabajo estará terminado cuando make mingw reenvíe o use esos valores para que CMake seleccione los compiladores MinGW especificados en lugar de nombres codificados de forma fija.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
C
Estrellas
2k
Forks
698
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de commonmark/cmark

Todos los issues de commonmark/cmark

Issues similares

Más issues de C

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.