Reputation: 29163
Say I have a single project, with files A.cpp, B.cpp, C.ppp and matching header files (and that's it). The C++ files include system headers or headers from other modules.
I want to compile them to a library with command line actions (e.g., using Make), using 'cl', with the precompiled headers feature.
What are the steps I should do? What are the command line switches?
Upvotes: 3
Views: 435
Reputation: 5105
Upvotes: 1
Reputation: 4772
Since you are using visual studio I would recommend just building the solution:
devenv solutionfile.sln /build [ solutionconfig ] [ /project projectnameorfile [ /projectconfig name ] ]
If you really need to do each of the individual files you can look at the command line option at the bottom of the build properties settings for each file in your project. It will show all the switches that you need.
Regarding the PCH, all you need to do is make sure the cpp that is creating the pch is compiled first.
Upvotes: 0
Reputation: 89232
Precompiled Headers are done by creating a .cpp that includes the headers you want to be pre-compiled. Normally, stdafx.cpp is used for this purpose.
There are other ways, but I find this to be the simplest.
Upvotes: 0