我正在尝试在Windows上构建zxing的C++端口,但是scons失败了:
cl : Command line error D8021 : invalid numeric argument '/Wextra'
Run Code Online (Sandbox Code Playgroud)
我安装了VS2010和MinGW,并且scons尝试使用MSVC编译器,即使SConscript文件假定gcc并使用gcc特定的参数,这会导致错误.
我如何告诉scons使用MinGW?
我需要为C编译器设置其他选项,例如添加标志以打开所有警告,具体取决于编译器的类型.例如,我应该使用MSVC
env.Append(CPPFLAGS = "/Wall")
Run Code Online (Sandbox Code Playgroud)
但对于mingw(gcc)我需要使用:
env.Append(CCFLAGS = "-Wall")
Run Code Online (Sandbox Code Playgroud)
我怎样才能以scons的方式做到这一点?