cmake misses parallelization opportunity between add_library and add_executable
My code builds a static library my-library
, and then compiles the executable my-exe
from another C++ source and my-library
.
add_library(my-library STATIC)
verilate(my-library SOURCES test.v)
add_executable(my-exe main.cpp)
target_link_libraries(my-exe PRIVATE my-library)
The problem is that it doesn't begin to compile main.cpp before my-library
is ready even though main.cpp
doesn't depend on my-library
.
This problem causes the overall build time to be longer.
cmake-3.18.2
gmake-4.3_2
FreeBSD 12.2