In CMake, if the link command becomes excessively long due to the presence of too many executable files during the linking process, what methods can be used to solve this problem?

In CMake, if the link command becomes excessively long due to the presence of too many executable files during the linking process, what methods can be used to solve this problem?

Not sure about your specific case, but when I get command line too long errors, it typically helps to keep the paths (esp. build directory) short. As far as I know this problem typically only occurs on Windows; I’ve worked on projects where the recommendation was to keep build folder path lengths at or below 10 characters (e.g C:/pro/bld)