11/9/2023 0 Comments Mark of the ninja 91 download![]() I put a file called /tmp/x which is a wrapper around cc that sleeps to show the serialization occur: #!/bin/bash -e The files foo.c and bar.c are empty, and I'm building in a subdirectory of the CMakeLists.txt directory. The WORKS option conditionally adds the add_custom_target() and add_dependencies() clauses which cause it to work (quickly). The following is a minimal CMakeLists.txt file that shows what happens. So I have a workaround, but is this expected behavior? What's curious is that I also noticed that if an explicit add_custom_target() for the generated file is used with add_dependencies(), the false dependency no longer exists, and the files in the downstream library will compile concurrently with the ones in the upstream library. ![]() With many libraries (more than 50) in my project, this false dependency causes serialization in the build. If a downstream library has a generated file and links to an upstream library, the downstream library sources will not start to compile until the upstream library is completely built. ![]() I've created the generated files using add_custom_command(), but I've discovered something which seems like a false dependency. I'm using cmake to build some libraries, all of which generate some of their files.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |