MantisBT - CMake
View Issue Details
0013158CMakeCMakepublic2012-04-20 15:202012-12-03 07:46
Andrey Kamaev 
Peter Collingbourne 
normalfeaturealways
closedfixed 
Windows
CMake 2.8.8 
 
0013158: Ninja: patch fixing Windows builds
Thank you guys for your great work and please consider my small patch making possible to use ninja on Windows.

With this patch I've successfully compiled OpenCV library (http://opencv.willowgarage.com/wiki/ [^]) with MS compiler from VS2010 and cross-compiled it for Android (also on Windows).

mingw build also works, but it fails if any sub-directory has more than one library/executable target because of problem not handled by this patch (mingw ar does not automatically generate directories).
Patch is made for 2.8.8 release
No tags attached.
patch win_ninja.patch (559) 2012-04-20 15:20
https://public.kitware.com/Bug/file/4312/win_ninja.patch
Issue History
2012-04-20 15:20Andrey KamaevNew Issue
2012-04-20 15:20Andrey KamaevFile Added: win_ninja.patch
2012-04-20 15:51Bill HoffmanNote Added: 0029284
2012-04-20 15:54Brad KingAssigned To => Peter Collingbourne
2012-04-20 15:54Brad KingStatusnew => assigned
2012-04-20 16:12Andrey KamaevNote Added: 0029285
2012-04-20 16:22Bill HoffmanNote Added: 0029286
2012-04-20 18:21Andrey KamaevNote Added: 0029287
2012-06-19 16:13Peter KuemmelNote Added: 0029747
2012-07-03 05:51Peter KuemmelStatusassigned => resolved
2012-07-03 05:51Peter KuemmelResolutionopen => fixed
2012-12-03 07:46David ColeNote Added: 0031813
2012-12-03 07:46David ColeStatusresolved => closed

Notes
(0029284)
Bill Hoffman   
2012-04-20 15:51   
Thanks for the patch, I will forward to the ninja developers. Once thing to note on windows with the MS compiler ninja currently has no file level depend information at all. So, expect incremental builds to fail as you change header files....
(0029285)
Andrey Kamaev   
2012-04-20 16:12   
Yes, incremental build with MS compiler is broken.
But I'm still happy because I wished speedup for Android build which was extremely slow on Windows.
(0029286)
Bill Hoffman   
2012-04-20 16:22   
What about jom?
(0029287)
Andrey Kamaev   
2012-04-20 18:21   
It is not so impressive as ninja. On my laptop jom is up to 2 times slower. And I have not measured but from my feeling incremental build with jom (when I need to rebuild only 1 or 2 files and relink) goes even slower than build with GNU make port from Google's Android NDK.

Also jom generator used without MSVC console spams output with the following message which is irrelevant for cross-compilation:

  To use the JOM generator, cmake must be run from a shell that can use the
  compiler cl from the command line. This environment does not contain
  INCLUDE, LIB, or LIBPATH, and these must be set for the cl compiler to
  work.
(0029747)
Peter Kuemmel   
2012-06-19 16:13   
Is fixed with the merge of 'ninja-cldeps'.
(0031813)
David Cole   
2012-12-03 07:46   
Closing resolved issues that have not been updated in more than 4 months.