tpoechtrager / osxcross

Mac OS X cross toolchain for Linux, FreeBSD, OpenBSD and Android (Termux)
GNU General Public License v2.0
2.85k stars 320 forks source link

Fix cmake wrapper breaking cmake build options #316

Closed realnc closed 2 years ago

realnc commented 2 years ago

Since cmake 3.20, "-D" prevents any build options (--build, --target, -j, etc) from working. It will abort with an "unrecognized argument" error.

Fix the issue by passing the toolchain file as an env variable to cmake, not with -D.

danilaml commented 1 year ago

This seems to break all pre 3.20 (and maybe 3.20 as well) builds since CMake doesn't initialize CMAKE_TOOLCHAIN_FILE from environment before 3.21: https://gitlab.kitware.com/cmake/cmake/-/blob/v3.21.7/Help/envvar/CMAKE_TOOLCHAIN_FILE.rst