set(CONFIGURE_OPTS
--host=${TOOLCHAIN_PREFIX}
--build=${CMAKE_HOST_SYSTEM_PROCESSOR})
- endif()
- if (CMAKE_CROSSCOMPILING_MACOS)
+
set(CONFIGURE_ENV ${CMAKE_COMMAND} -E
- env "CFLAGS=--target=${TOOLCHAIN_PREFIX}"
- env "LDFLAGS=-arch ${CMAKE_OSX_ARCHITECTURES}")
+ env "CC_FOR_BUILD=cc")
+ if (CMAKE_CROSSCOMPILING_MACOS)
+ set(CONFIGURE_ENV
+ ${CONFIGURE_ENV}
+ env "CFLAGS=--target=${TOOLCHAIN_PREFIX}"
+ env "LDFLAGS=-arch ${CMAKE_OSX_ARCHITECTURES}")
+ endif()
endif()
# `CC_FOR_BUILD`, `--host`, and `--build` are passed to `configure` to ensure