在wine中编译时CMake源文件名转换

时间:2016-06-29 14:08:21

标签: c++ cmake cross-compiling wine toolchain

我正在编写一个CMake工具链文件,用于在Linux上使用MSVC编译器进行编译:

set(CMAKE_SYSTEM_NAME Windows)

set(CMAKE_C_COMPILER "cl")
set(CMAKE_CXX_COMPILER "cl")

~/bin/cl文件:

wine cmd /c Z:/home/velkan/bin/cl.bat "$@"

~/bin/cl.bat文件:

call Z:\home\velkan\bin\vcvars32.bat
cl %*

~/bin/vcvars32.bat文件:

@echo off
Set INCLUDE=C:\vc\include;C:\sdk\Include;C:\kits\10\Include\10.0.10586.0\ucrt;%INCLUDE%
Set LIB=C:\vc\lib;C:\sdk\Lib;C:\kits\10\Lib\10.0.10586.0\ucrt\x86;%LIB%

将所有需要的东西复制到wine目录中,因此编译器可以工作。

但是当我运行cmake时,它会将类似/home/velkan/build/CMakeFiles/CMakeTmp/testCCompiler.c的Unix风格路径传递给编译器。工具链定义是否有任何CMake解决方法可以将它们无缝转换为Z:/home/velkan/build/CMakeFiles/CMakeTmp/testCCompiler.c之类的内容?

0 个答案:

没有答案