cmake-utils.eclass: Split multi-arg CC/CXX/FC correctly, #542530
authorMichał Górny <mgorny@gentoo.org>
Fri, 2 Dec 2016 10:43:16 +0000 (11:43 +0100)
committerMichał Górny <mgorny@gentoo.org>
Thu, 8 Dec 2016 08:00:17 +0000 (09:00 +0100)
commit4e427b97d5579b858e76b68fbecdfb811e0c24a1
treef24e0a74357cfafce17807ce3189eddf101596fc
parent9b89c468ac772e9a79b55bd8e2e3f2a4b9463596
cmake-utils.eclass: Split multi-arg CC/CXX/FC correctly, #542530

Split multi-argument CC/CXX/FC into a CMake array consisting of one
element containing the compiler path (name) and the other containing all
command-line options, space-separated. This is how CMake splits
the environment variables CC/CXX/FC internally.

The alternative would be to set CC/CXX/FC directly, and let CMake handle
the splitting. However, changing that had unforeseen consequences like
assembler not being set correctly (#601292) which in turn was impossible
to set via environment variables due to bugs in CMake.

Therefore, splitting the values into CMAKE_*_COMPILER correctly seems
the simplest and safest way forward, at least until we can rely on fixed
CMake versions being sufficiently deployed.
eclass/cmake-utils.eclass