Git submodules are not supported by Arduino Library Manager (sort of a package manager for Arduino Libraries which is integrated into the IDE, web editor, and Arduino CLI). Their presence in the repository won't block the acceptance of a library into the Library Manager index, but there will only be an empty folder where the submodule will be, just the same as when you use GitHub's "Download ZIP" button. Of course it's not mandatory that your library be in the Library Manager index, but it is a very convenient way to distribute the library and its updates to the users, so worth at least giving some consideration.
It recurses through everything under src and compiles all the source files.
There isn't any way to exclude paths from this recursion. This was actually the main reason Edge Impulse had to set up a repackaging script for their library. You can see here they requested an exclude capability: