conda-forge / conda-forge-ci-setup-feedstock

A conda-smithy repository for conda-forge-ci-setup.
BSD 3-Clause "New" or "Revised" License
13 stars 51 forks source link

CMAKE_CROSSCOMPILING_EMULATOR not propagated automatically to cmake #206

Closed duncanmmacleod closed 1 year ago

duncanmmacleod commented 2 years ago

Solution to issue cannot be found in the documentation.

Issue

The ./recipe/cross-compile-support.sh script configures CMAKE_CROSSCOMPILING_EMULATOR as an environment variable that gets propagated to conda-build:

https://github.com/conda-forge/conda-forge-ci-setup-feedstock/blob/df29a72bf13e7083d5e1c4126f94fe756151ffdb/recipe/cross_compile_support.sh#L27-L28

However, AFAICT from https://cmake.org/cmake/help/latest/manual/cmake-env-variables.7.html, that variable isn't one that cmake will automatically pick up from the environment, so one currently needs to include something like -DCMAKE_CROSSCOMPILING_EMULATOR:STRING="${CMAKE_CROSSCOMPILING_EMULATOR}" in the build script to pass it along manually.

See https://github.com/conda-forge/ldas-tools-framecpp-feedstock/pull/26 for a feedstock build that failed because of this, but is resolved by adding the above cmake argument.

I'm not sure where this would be applied, but is it reasonable to add CMAKE_CROSSCOMPILING_EMULATOR to the CMAKE_ARGS variable currently configured by the C compiler activate scripts? Or maybe there's a better way.

Installed packages

-

Environment info

-
isuruf commented 1 year ago

Please open this in ctng-compilers-feedstock