【发布时间】:2019-06-24 10:29:42
【问题描述】:
我有一个现有的 makefile 项目,我正在迁移到 scons。
makefile 使用 gcc 和 g++ 构建多个 Windows 可执行文件。
不过,我还安装了用于 C# 开发的 Visual Studio。
scons 似乎正在尝试使用 Visual Studio 工具而不是 gcc 工具:
cl /Fofoo\bar.o /c foo\bar.c /nologo -g -mno-ms-bitfields -fshort-enums -ftest-coverage -fprofile-arcs /D-DUNIT_TESTS /I. <more includes follow...>
cl : Command line warning D9002 : ignoring unknown option '-g'
我已经阅读了几个答案并尝试添加:
env["CC"] = "gcc"
env["CXX"] = "g++"
env["LINK"] = "g++"
在我的Sconstruct 文件中。这具有正确更改工具的效果,但不是命令语法:
gcc /Fofoo\bar.o /c foo\bar.c /nologo -g -mno-ms-bitfields -fshort-enums -ftest-coverage -fprofile-arcs /D-DUNIT_TESTS /I. <more includes follow...>
gcc: error: /Fofoo\bar.o: No such file or directory
我如何确保 scons 使用我想要的工具,并使用正确的命令行选项语法(例如 -I 而不是 /I)?
【问题讨论】:
-
请发布一个简单的 SConstruct 来演示您的问题。