cmake-conan icon indicating copy to clipboard operation
cmake-conan copied to clipboard

Added [buildenv] Field Generation

Open jelin-sh opened this issue 1 year ago • 2 comments

Modified the detect_host_profile function in conan_provider.cmake to support the generation of the [buildenv] field. This enhancement allows for a closer integration with the compilers configured in CMake, thereby improving usability for cross-compilation and cross-platform scenarios.

jelin-sh avatar Sep 05 '23 07:09 jelin-sh

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Sep 05 '23 07:09 CLAassistant

Please note that as of https://github.com/conan-io/cmake-conan/pull/566 - the compiler_executables configuration variable is set and propagated - this should negate the need for CC and CXX. Note that this needs CMake to be aware of both compilers (which is not always the case), so requires both to be specified (either by defining CMAKE_<LANG>_COMPILER, or letting CMake find it if it is defined as a language in the project() call or an enable_language().

The linker is more tricky - since in a lot of scenarios CMake performs linking via the compiler, and CMAKE_LINKER is, to the best of my knowledge, not documented. For cases where it is necessary to define these (via [buildenv] or similar, I would suggest looking at the just-merged feature of customizing the profile: https://github.com/conan-io/cmake-conan/tree/develop2#customizing-conan-profiles

jcar87 avatar Sep 22 '23 12:09 jcar87