CMake:使用自定义链接器 [英] CMake: use a custom linker
本文介绍了CMake:使用自定义链接器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想用qmake设置一个自定义工具链。我设置了编译器,但我不知道如何设置链接器。报告此错误,因为cmake尝试使用编译器链接:
I want to setup a custom toolchain with qmake. I've set the compiler but I don't know how to set the linker. This error is reported because cmake try to use the compiler to link:
The C compiler "xgcc.exe" is not able to compile a simple test program.
这里有我的工具链文件的片段
Here there is a snippet of my toolchain file
# specify the cross compiler
INCLUDE(CMakeForceCompiler)
SET(CMAKE_C_COMPILER xgcc.exe)
SET(CMAKE_CXX_COMPILER xgcc.exe)
#CMAKE_FORCE_C_COMPILER(xgcc.exe GNU)
#CMAKE_FORCE_CXX_COMPILER(xgcc.exe GNU)
推荐答案
我必须使用CMAKE_CXX_LINK_EXECUTABLE,CMAKE_C_LINK_EXECUTABLE变量:
I have to use CMAKE_CXX_LINK_EXECUTABLE, CMAKE_C_LINK_EXECUTABLE variable:
SET(CMAKE_C_LINK_EXECUTABLE "c:\\MoSync\\bin\\pipe-tool.exe")
这篇关于CMake:使用自定义链接器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文