I'm getting this error for C++ library I'm using. It uses GNU Automake for building. Which flag(s) I should supply for the make
command to lower the target build platform to avoid seeing this warning in Xcode project where I'm trying to link against the library?

- 2,942
- 4
- 32
- 49
3 Answers
You need to set the compiler flag -mmacosx-version-min
to the version number of the SDK you want to build against. I don't use automake
, but in cmake
you'd set the variable CMAKE_OSX_DEPLOYMENT_TARGET
, and in qmake
you'd set the variable QMAKE_MACOSX_DEPLOYMENT_TARGET
.

- 1,564
- 1
- 14
- 28
-
4If you're having this problem with QtCreator, simply add `QMAKE_MACOSX_DEPLOYMENT_TARGET = xx.xx` to your project file, where xx.xx is the version number of the SDK used to compile the library – Dissident penguin Jul 22 '19 at 08:45
-
1Thanks a lot `SET(CMAKE_OSX_DEPLOYMENT_TARGET 12.0)` worked for me – Rishabh Deep Singh Jul 20 '22 at 21:29
As cbrnr answered, you have to use -mmacosx-version-min compiler flag. To pass compiler flag through make, you can use CXXFLAGS environment variable:
make CXXFLAGS="-mmacosx-version-min=10.10" <target or other make params>

- 2,751
- 25
- 38
When using ./configure
for a number of packages the macosx-version-min
setting defaults to particular OS version - which can lead to the mentioned warning message if that OS version is lower than the macosx-version-min
version that the linked library was compiled. However, this can be controlled by setting the MACOSX_DEPLOYMENT_TARGET
environment variable before running configure e.g.
MACOSX_DEPLOYMENT_TARGET=10.14 ./configure

- 7,064
- 52
- 59