The following issue has been SUBMITTED. ====================================================================== http://public.kitware.com/Bug/view.php?id=14597 ====================================================================== Reported By: tisi Assigned To: ====================================================================== Project: CMake Issue ID: 14597 Category: CMake Reproducibility: always Severity: major Priority: normal Status: new ====================================================================== Date Submitted: 2013-11-26 04:17 EST Last Modified: 2013-11-26 04:17 EST ====================================================================== Summary: Ninja: several add_custom_command(Target ... POST_BUILD ...) may lead to a command which breaks the command line limit Description: We encountered the following problem with a project for an embedded microcontroller, but it is reproducable on normal x86 machines. We use the command add_custom_command(Target <Target> POST_BUILD <Commands>) to run severeal commands after linking (some hex-file manipulations like calculating crc32, moving of memory and so on).
In the past we used the makefile generator and our project worked fine, but we want to switch to ninja for some other reasons. We found the following issue: The ninja generator combines the linker command and all the add_custom_commands to one large command (all commands are combinded by &&, so linker-command && custom1 && custom2 && custom3 && ...), which breaks the command line limit of windows (8kB). I think the same issue would be true on linux with an higher limit (i think 32kb). Is it possible to change the behavior of the generator to support something like that (e.g. intermediate targets for the add_custom_commands)? Right now we make a shell script and use only one add_custom_command, but its not nice that there is a different behavior between the make and the ninja build at all. Steps to Reproduce: I've uploaded a file with a cmake project, which demonstrates that. You will need a c compiler, but it doesn't matter which one. Just run cmake -G "Ninja" <source_path> && ninja on Windows and you should see the issue. ====================================================================== Issue History Date Modified Username Field Change ====================================================================== 2013-11-26 04:17 tisi New Issue 2013-11-26 04:17 tisi File Added: AddCustomCommandDemo.zip ====================================================================== -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers