conan-io / conan

Conan - The open-source C and C++ package manager
https://conan.io
MIT License
8.17k stars 974 forks source link

Should CMake bh apply cross build vars together with CMAKE_TOOLCHAIN_FILE? #2683

Closed lasote closed 1 year ago

lasote commented 6 years ago

Previously commented here: https://github.com/conan-io/conan/issues/2671 The issue is, on purpose, when you specify CMAKE_TOOLCHAIN_FILE the rest of variables related to cross building are not currently applied:

CMAKE_SYSTEM_NAME, CMAKE_SYSTEM_VERSION, CONAN_CMAKE_SYSTEM_PROCESSOR, CONAN_CMAKE_FIND_ROOT_PATH, CONAN_CMAKE_FIND_ROOT_PATH_MODE_PROGRAM, CONAN_CMAKE_FIND_ROOT_PATH_MODE_LIBRARY, CONAN_CMAKE_FIND_ROOT_PATH_MODE_INCLUDE

This issue is to discuss is these variables should also be applied irrespective of the user specifies CMAKE_TOOLCHAIN_FILE. It could be a breaking behavior. Probably if the user also specified these variables, should be applied, but it is not the current behavior.

The fix is easy, remove the return ret in _cmake_cross_build_defines.

ClausKlein commented 6 years ago

No, normally all this has to be set at the toolchain file.

see too https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html#cross-compiling

And with conan I can't setup a propriatary toolchain with any compiler not prepared in settings.yam? With my toolchain, I can do what I need!

By the way, what should I setup for QNX, VXWORKS, or GHS Integrity?

Only for building cross compilation tools, 'os_target/arch_target' is the system for

which the tools generate code

os_target: [Windows, Linux, Macos, Android, iOS, watchOS, tvOS, FreeBSD, SunOS, Arduino] arch_target: [x86, x86_64, ppc64le, ppc64, armv6, armv7, armv7hf, armv8, sparc, sparcv9, mips, mips64, avr, armv7s, armv7k]

memsharded commented 1 year ago

CMakeToolchain provided a new toolchain-based integration, that deprecated this one. Closing as outdated.