c++macoscmakecross-compilingconan

How to compile C++ program for older version of MacOS?


here are my build steps:

conan install . --build=missing
cmake --preset conan-default
cmake --build --preset conan-release

this results in a binary that is compatible with only the current (last) version of MacOS

otool -l mybin
platform 1
    minos 14.5
      sdk 14.5

How to change this builds steps to compile for MacOS 10.14?


Solution

  • I was able to build my program for MacOS 10.15 by adding os.version=10.15 to a conan2 profile located in ~/.conan2/profiles. here is what the new binary output:

     platform 1
        minos 10.15
          sdk 14.5