Crossplatform compilation Windows -> MacOS

Greetings to all.
Does anyone have experience compiling from Windows to MacOS? When I try to do it, I get error in SDK headers,like:

/MacOSX13.1.sdk/usr/include/c++/v1/__config:66:19: fatal error: cannot open file
      'H:/repository/workspace/build/targets/MacOSX13.1.sdk/usr/include/c++/v1/RTK_device_methods.h': No such file or
#if __has_include(<RTK_device_methods.h>) && defined(_LIBCPP_HAS_NO_RANDOM_DEVICE) && defined(_LIBCPP_HAS_NO_LOC...
1 error generated.

i do like this:

clang++ -v -fuse-ld=lld --sysroot=blabla/MacOSX13.1.sdk main.cpp -o run_out

But if I use the header files from Linux GCC, and link it with libstdc++.dylib from the old MacOS - its perfectly works. So what should I do to compile with Clang + MacOS SDK for modern Darwin?

PS: I tried releases of Clang: 13-16, and all have this behavior.

Thank you!

Don’t know if it’s possible to placate clang to solve your issue but I know that tpoechtrager/osxcross: Mac OS X cross toolchain for Linux, FreeBSD, OpenBSD and Android (Termux) ( exists that could be useful (might need WSL on windows).

So, finally I resolve this problem for the windows. The solution is…I just build Clang from the sources on the my machine with the clang from winlibs with BUILD_SHARED_LIBS=ON and without -static.