Visual Studio Makefile Project Sync

I have inherited some C99 code that I plan to reuse in a C ++ oriented solution. Unfortunately, even the latest Microsoft compiler practically does not support the nontrivial functions of C99.

The code in question was tested to death, and I would prefer not to rewrite it in C ++. This means that in order for me to reuse the code verbatim, I will have to rely on the appropriate third-party compiler.

Looking back, it seems to me best to integrate this code by adding the “Makefile Project” to my solution. Only one problem. It seems like now my responsibility is to keep the “Build Command Line” property in sync with the files that I add to the project through Visual Studio.

At first glance, I could not find a way to get the list of files in my project using regular Visual Studio $ () macros. I could always write a shell script that would list the * .c files in my source tree and pass their paths to a third-party compiler. However, I expected Visual Studio to do at least this part of the work for me, since it already has this information in the corresponding * .vc ​​[x] proj file.

It is very unlikely that I will need to add new source files to this project, but, nevertheless, manual synchronization (i.e. without a script) looks pretty fragile for me.

What are my options besides writing a helper script?

+3
source share
1 answer

Hans Passant:

" Makefile" , , "", . make. VS2010. , C99 , make .

+2

Source: https://habr.com/ru/post/1767073/


All Articles