On 2019-07-29 18:50+0300 Dave Milter wrote:
On Mon, Jul 29, 2019 at 1:48 PM Bruce Stephens <[email protected]> wrote:I think it's reasonable for CMake/Ninja to require the headers be generated, especially since main.cpp does include one of them (though CMake/Ninja doesn't know that until later). lib/lib1.cpp is more arguable, but I imagine there's no real distinction made: main.cpp.o depends on all the dependencies of the libraries.In my initial example headers files are not generated in cmake scripts. 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
Thanks, Bruce, for spotting that issue with the first version of my simple example which I oversimplified. I have now corrected it (see attached tarball) to follow the use case of pre-existing headers and an app that links to a library (internal for my corrected test case, and external for David's test case). The issue (compilation of main.cpp is unreasonably delayed for parallel builds until after the library (internal or external) is built) still shows up in my corrected test case for both -G"Ninja" and -G"Unix Makefiles" just like happens for David's test case for an external library. So the question remains why does CMake constrain parallel builds this way (to the point that it is a bottlneck for David's real project with external libraries) for this general use case? Alan __________________________ Alan W. Irwin Programming affiliations with the FreeEOS equation-of-state implementation for stellar interiors (freeeos.sf.net); the Time Ephemerides project (timeephem.sf.net); PLplot scientific plotting software package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________
corrected_add_internal_library.tar.gz
Description: tarball containing corrected test case of app with pre-existing headers and internal library
-- 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
