cannot link to dynamic library during parallel build

I met a compile fail problem, which is caused by parallel build. Please see this bug report for detail:
https://bugs.llvm.org/show_bug.cgi?id=46617

how can I fix this in CMakeList.txt? I have explicitly change target_link_libraries to .so, but during parallel build, if .a is generated first, it is possbile that .a is used, and make the build fail, is this bug of cmake?

Thanks

It seems like the build graph is not well-defined if this can happen. Inside of CMake code, using the target names rather than -L/path -llibname would avoid any confusion like this. I’m not sure how the ambiguous command line ends up appearing though.

thanks. this seems decide by gcc link order, and build graph. so I will close this issue.