本文介绍了如何在cygwin/mingw工具链中使用CMake?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用cygwin随附的mingw工具链的当前流程是什么?

What is the current process to use the mingw toolchain that is included with cygwin?

曾经有一个-mno-cygwin选项与gcc一起使用.

There use to be a -mno-cygwin option used with gcc.

mingw版本的exe名称中添加了x86_64-w64-mingw32-或i686-w64-mingw32-.目前,我只是直接使用这些,但我想使用cmake.

The mingw versions have x86_64-w64-mingw32- or i686-w64-mingw32- added to their exe names. Currently I just use these directly but I want to use cmake.

Cygwin还包括cmake.如何配置它以使用cygwin随附的mingw工具集?我还看到Qt5库中包含了一些用于mingw的Qt5 * .cmake模块.

Cygwin also includes cmake. How would I configure it to use the mingw toolset that is included with cygwin? I also see some Qt5 *.cmake modules included in the Qt5 libraries for mingw.

谢谢.

推荐答案

我找到了一个临时解决方法.只需定义以下两个环境变量:

I've found a temporary workaround. Just define these two environment variables:

set CC=/usr/bin/x86_64-w64-mingw32-gcc.exe
set CXX=/usr/bin/x86_64-w64-mingw32-g++.exe

在运行cygwin随附的cmake之前定义它们.似乎可以正常工作.

Define them before running the cmake that is included with cygwin.Seems to work.

这篇关于如何在cygwin/mingw工具链中使用CMake?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-05 01:38