简体   繁体   English

为不同的编译器版本维护多个构建

[英]Maintaining multiple builds for different compiler versions

I am developing a C++ library and I use a Makefile to compile and create a build.我正在开发一个 C++ 库,我使用 Makefile 来编译和创建一个构建。 I wish to maintain multiple builds for different gcc compiler versions.我希望为不同的 gcc 编译器版本维护多个构建。 What is the best way to do this?做这个的最好方式是什么?

If you are ready to go with autotools, autoconf/automake let you do this through out of tree builds .如果您准备好使用 autotools,autoconf/automake 可让您通过树外构建完成此操作。 You can configure as many build you want if you separate each build into its own directory (not the source directory).如果将每个构建分成自己的目录(而不是源目录),则可以配置任意数量的构建。

Configuring compiler and compiler options is usually a simple matter of bash command line.配置编译器和编译器选项通常是 bash 命令行的简单问题。

mkdir mingw-build
cd mingw-build
CXX=mingw32-g++ ../myproject/configure ...
cd ..

mkdir native-build
cd native-build
CXX=g++ ../myproject/configure ...
cd ..

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM