Conan complains package was "built for newer macOS version"

Viewed 43

Using Conan on an M1 MacBook Pro on macOS 12.3.1, trying to include fmt/8.1.1 and I get this warning:

ld: warning: object file (/Users/myusername/.conan/data/fmt/8.1.1/_/_/package/d278e143d26eb143e4f08750e2284f631c5dce0e/lib/libfmt.a(format.cc.o)) was built for newer macOS version (12.0) than being linked (10.13)

My project's root CMakeLists.txt has

set (CMAKE_OSX_DEPLOYMENT_TARGET 10.13 CACHE STRING "Minimum supported version of OS X")
set (CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "We are forcing intel builds on every Mac architecture" FORCE)

The fmt library "works" in the sense that I can #include <fmt/format.h> and use it, so Conan must be building fmt for x86, but somehow it needs to be told the CMAKE_OSX_DEPLOYMENT_TARGET 10.13 part. How?

I've found tools.apple_deployment_target_env() and tools.apple_deployment_target_flag() which seem related, but can't figure out how to use that in the context of my project's conanfile.py.

0 Answers
Related