[cmake-developers] Ninja/Win32: Negating UsingMinGW default to support Windows hosted cross compilers

OKUMURA Yuki mjt at cltn.org
Fri Jun 22 14:15:45 EDT 2012


Hi list,

Current CMake Ninja generator will translate backslashes in the path
into forward slashes iff you are using MinGW(= Windows hosted Windows
compiler).
I feel this behavior should be default because Windows hosted
cross-compilers -- Android NDK for example -- also require this path
translation but they never recognized as MinGW.

Attached patch implements this and my life became much happier with
CMake+Ninja :)
I think this change would break non-MSVC and non-GNU toolchain (e.g.
bcc32) though.

(To implement it precisely, every Ninja generator has to know whether
to escape response file which will feed to the compiler/linker/...
I posted around this before at Ninja-build group:
https://groups.google.com/d/msg/ninja-build/KrxvzcSJQbY/140CDdXKGVIJ
Of course, current workaround; not to use backslashes in the filenames
for MinGW; is smart enough but it would break if user fed too many -D
options to the compiler and rspfile used.)

Any thoughts?
-- oku
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Ninja-win32-Negate-UsingMinGW-default.patch
Type: application/octet-stream
Size: 1209 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20120623/d456a5c2/attachment-0002.obj>


More information about the cmake-developers mailing list