add_custom_command silently fails under Ninja 1/10 times
Confirmed this is happening in Ubuntu 16.04 LTS and Ubuntu 16.10 under both CMake 3.5 and 3.11.
Reproduce with the following repo:
https://github.com/RPGillespie6/cmake_potential_bug
mkdir build && cd build
cmake .. -G Ninja
Simply run ninja
over and over. ~1/10 times you will see the following:
user@cobalt:~/cmake_cc/build$ ninja
[1/3] Generating CM-related libraries and files
[]
/home/user/cmake_cc/src/cm_writer.cpp
user@cobalt:~/cmake_cc/build$
Note how it silently stops after 1/3 and gave no error or reason why.
Normal output looks like this:
user@cobalt:~/cmake_cc/build$ ninja
[1/3] Generating CM-related libraries and files
[]
/home/user/cmake_cc/src/cm_writer.cpp
[3/3] Linking CXX executable src/cm_writer
user@cobalt:~/cmake_cc/build$ ninja
This likely has to do with the fact that the python script only generates 1 of the 2 output files.
Edited by RPGillespie6