Building Clang - which source files are included in libraries?

As I understand it, most of the modules that comprise the clang executable (even when we talk about the clang-specific modules, apart from those that are part of llvm in general) are actually in the clang libraries. Which is useful because other programs that need front-end functionality can just link those libraries.

Which source files are /not/ incorporated into the clang libraries? I’m guessing C:\llvm\tools\clang\tools\driver\driver.cpp is one such file because it contains a main function; would this be correct? What about the other two source files in that directory, cc1_main.cpp and cc1as_main.cpp; are they in libraries? Are there any others that aren’t?

Is there somewhere I should have looked for the answer to questions like this? I tried generating and examining msbuild.log, but it’s on the verbose side (over thirty megabytes) so it’s not easy to see exactly what’s going on.

My guess would be that everything in lib directory is a library including libclang in tools directory, rest of the tools directory are, well tools :slight_smile:

Well, you'll have to have a look at the CMake files or the one of the build
system files it generates.

What about reading the files (very simple, easy to read)?

Generate with 'cmake -G Ninja ...', then read With a bit of
pattern matching you could figure out which source files are /not/ part of

Hope that helps,