On 7/29/19 11:50 AM, Dave Milter wrote: > Only source code are generated, so main.cpp -> main.cpp.o doesn't > depend on anything. > But generated by cmake build.ninja still require link of extern_lib > before starting main.cpp -> main.cpp.o
If there are any custom commands in any targets on which main.cpp's target depends then CMake must pessimistically assume that the custom commands may generate a header needed to compile `main.cpp`. Object libraries can be used to break the dependencies that lead to the assumption. CMake 3.9 made this much better than it used to be: https://gitlab.kitware.com/cmake/cmake/merge_requests/430 Since then all objects in a target can start compiling independently so long as that target does not depend on any targets with custom commands. -Brad -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: https://cmake.org/mailman/listinfo/cmake
