Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#484 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
42/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
c, cmake
Lĩnh vực
build-system

Hướng nghiên cứu

Bắt đầu với target mingw trong Makefile và các thiết lập trong toolchain-mingw32.cmake; tái hiện vấn đề bằng lệnh được hiển thị với các giá trị tùy chỉnh cho CC, CXX và HOST. Được xem là hoàn tất khi make mingw chuyển tiếp hoặc sử dụng các giá trị đó để CMake chọn các trình biên dịch MinGW được chỉ định thay vì các tên được hardcode.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
C
Star
2k
Fork
698
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của commonmark/cmark

Tất cả issue của commonmark/cmark

Issue tương tự

Thêm issue về C

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.