Closed hsorby closed 1 year ago
std::any
is part of C++17 and we require C++17 to build libCellML, so why this issue?
When building on macOS it tries to use the oldest SDK it can, it doesn't appear to take into account the C++17 setting. Old SDKs don't support std::any, which leaves you with errors like:
/workspace/srcdir/libcellml/src/annotator.cpp:412:31: error: 'any_cast<std::weak_ptr<libcellml::Component>>' is unavailable: introduced in macOS 10.14
--
| [10:55:39] auto component = std::any_cast<ComponentWeakPtr>(item->mPimpl->mItem).lock();
```.
What about using CMAKE_OSX_DEPLOYMENT_TARGET
to specify the minimum version of macOS that we want to support (and therefore the minimum version of the C++ standard that we want to support)?
I thought that was what I was getting at.
Not all OSX development targets support std::any, we should set the minimum target before the CMake
project
command to avoid compilation errors on some macOS platforms.