Its only the output binary size that matters. If the libraries are in there then it counts. Where it gets a bit funny is graphics libraries and gpu features. You wouldn't include vulkan in your size but you get a bunch of features that weren't available on older hardware.