Can create a visual studio-2010 project?

I have a visual studio-2010 project that contains many source files and header files. Now I need to auto-update this project under the latest Debian GNU / Linux. Therefore, I prefer to use MinGW. But I need a make file for this visual studio project. Is there an easy way to translate a vs project into a makefile? Or can MinGW directly create a visual studio project with additional packages or libraries? Any ideas would be appreciated.

+6
source share
2 answers

If you want to constantly build the port of your program in GNU / Linux, I would recommend switching to autotools (autoconf and automake). Autoinstalls are very common and have excellent cross-compilation support. (On the other hand, a reputation for oddity has also earned.) Although there is no automatic translation from VS projects that I know of, compiling one program can be just as simple as finding all the source and header files, listing them accordingly in Makefile.am and writing down a rule for Windows objects.

If the transition to MinGW is not written in stone or a build script with two compilers, most likely go to cmake, as suggested by commentators. Although I have always considered CMake a serious pain for unattended builders (common for open source software), it has a good reputation for creating all types of build description files, such as Makefile and VS projects.

One way or another, you will have to convert your project manually. This can be quite easy for the normal structure of the project, but it needs to be done.

+1
source

I do not know a single toolchain capable of doing this out of the box. CMake (and all other meta-make file generators) offer one-way conversion: they can generate a Visual Studio project / solution once, but there is no way to automatically synchronize with the changes made to the VS / MSBuild configuration. Writing and maintaining CMake configurations (or PreMake or whatever) is a pain, and it makes sense if your main development platform is outside the Microsoft platform.

There is an interesting alternative: xbuild - MSBuild port, which is a build system for VS intelligence. Theoretically, you can expand the system to support the MSBuild configurations generated by Visual Studio and define conversion rules for the correct C ++ tool chains on other platforms (even in two directions). The declarative, XML-based nature of MSBuild / XBuild is a huge victory over autotools / make, which cost me too much time and inconvenience in my developer life. MSBuild / XBuild is implemented as a purely managed infrastructure with a well-designed architecture, so extensions are fairly easy to implement. Of course, this only pays off if you (or your company) are seriously thinking about large-scale support for cross-platform.

+1
source

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


All Articles