Closed mcandre closed 2 years ago
I see now. As the README indicates, the default macOS target version is not the maximum supported version, but a few releases behind.
I am following the documentation and configuring an environment variable like MACOSX_DEPLOYMENT_TARGET=10.15
, which can see the more modern C++17 features.
cmake notes:
set()
is bad at writing to environment variables in terms of child processes.CMAKE_OSX_DEPLOYMENT_TARGET
is explicitly ignored when the build environment is not Apple, which means that variable is rendered useless for cross-compilation builds.
I recently compiled osxcross using HEAD Apple Clang with a MacOSX 11.3 tarball. But osxcross complains that many C++17 features are missing.
Trace:
Source:
https://github.com/mcandre/rez/blob/606fb58159e648a60599fea0278bd00a44a4068d/include/rez/rez.hpp
Toolchain build steps:
https://github.com/mcandre/snek/blob/b16f63adb67adf7a908171b984d06494ed6180f6/docker/darwin/Dockerfile
For comparison, I am able to build this file easily using the official Xcode toolchain directly on physical Apple macOS hardware.
Something is lost in osxcross regarding C++17 support, which Xcode Clang ordinarily provides.
How can we fix missing C++17 features in osxcross?
One interesting thing, this StackOverflow post claims that the dylib for libstdc++ implements such features.
https://stackoverflow.com/a/54834871/350106
However, the toolchain built by
./build.sh
did not preserve any dylib files. These are missing from my Docker image.There are even a handful of original dylibs in the MacOSX SDK tarball. Not even those appear in my osxcross build artifact directory tree.
The only libs I have right now in the osxcross toolchain are:
Apple Clang on Docker comes with a huge collection of
.a
format library files. Maybe I'll try to force osxcross to search through these.