Clang compile a project

How can I use Clang to compile a project? And I load simulateneously.

The following command can compile a single .cpp file.

  ../build/skeleton/  // here is

And my problem is: how can I compile a project using similar approch?

A project, such as, main.cpp dep1.cpp dep2.cpp dep3.cpp.

Whatever build system you would normally use to build the project should let you specify command-line options to use when invoking the compiler.

I don’t think -Xclang -load works, pretty sure it needs to be -Xclang -load -Xclang

Yes, you are right. I made a typo. And I wanna know how to compile a project in a similar way. :smiley: Could you give me some recommendations? Tks~

I used VSCode, so I have to write command line myself. So do you have any suggestion for build system automatically compiling a project with Clang? Tks!

Switch to a proper build system. Something like CMake or Make.

Sorry, I think cmake also need to write commd?

So, how to write CMakeLists.txt for clang to compie a project?Tks!

I don’t think this forum is the best for CMake help. You can find many good tutorials on and similar sites.