pcc/CMake — pull request #2 by jkp (2012-01-30 14:55:36+00:00)
Title: Fix for linking different archs

Hi there

I was looking at trying out Ninja build with our rather large CMake C++ project but I hit a hurdle early on. We force the architecture to i386 even on x86_64 platforms and the targets the Ninja generator spat out seemed to choke when linking.

This is a patch which seems to fix that. I arrived at this by looking at the link rule for CXX (in Modules/CMakeCXXInformation.cmake)

``` -o ```

Although you look up the architecture flags in cmNinjaNormalTargetGenerator::WriteLinkRule, they are only included in the build rule if it references (which this rule doesn't).

I used the code in the makefile generator as a reference - in there they store them in FLAGS and they are picked up from there.