Currently, all executables and shared libraries are expected to add the exe_and_shlib_deps dependency manually. However, it is easy to forget to do this. In such cases, the build will likely fail at the link step due to missing libc++ symbols. It may not be obvious how to fix this issue.
The alternative is the following:
set_defaults("executable") {
...
deps = [ "//build/config:exe_and_shlib_deps "]
}
set_defaults("shared_library") {
...
deps = [ "//build/config:exe_and_shlib_deps "]
}
The disadvantage here is that many targets will need to update "deps = " to "deps +=". Fortunately, gn warns when overwriting a non-empty list, so it's easy to identify these cases.
Comment 1 by thomasanderson@chromium.org
, May 22 2018