Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22002

What is the difference between MACOSX_DEPLOYMENT_TARGET and -mmacosx-version-min?

$
0
0

I often need to target Mac OS X versions that are older than the one I'm currently running. As I prefer to work with a bash shell and Makefiles, I do not use Xcode. Apple explicitly supports targeting older OS X versions, but I've always been confused by the redundancy of the two configuration steps that are usually taken to target older platforms:

  1. gcc is started using --macosx-version-min:

    gcc --mmacosx-version-min=10.6 ....
  2. The MACOSX_DEPLOYMENT_TARGET environment variable is set to the desired platform, e.g.

    export MACOSX_DEPLOYMENT_TARGET=10.6

When trying to figure out the actual difference between the two by searching, you'll come up with different answers. Some people say that they do exactly the same, so it's only necessary to use one of the two. However, there are also voices which say that it's necessary to do both: start gcc with --macosx-version-minand set the environment variable.

Are these two things exactly the same? Is it only necessary to use one of the two but not both? Is there some official documentation available somewhere? Apple mentions MACOSX_DEPLOYMENT_TARGET but doesn't mention --macosx-version-min at all, even though it seems to be much more common.


Viewing all articles
Browse latest Browse all 22002

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>