]> code.ossystems Code Review - openembedded-core.git/commit
cmake: fix linking in multilib SDKs
authorRoss Burton <ross.burton@intel.com>
Fri, 3 Aug 2018 14:01:12 +0000 (15:01 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 7 Aug 2018 11:12:55 +0000 (12:12 +0100)
commit47160a8c51310f2b40cabf4c1910b5df6e0a15d6
tree1801a193e8529d1e78de8184fc38b8862ec4e146
parent7080df4b6bc50440eed600e81f2c6fa76a80623d
cmake: fix linking in multilib SDKs

CMake, in it's infinite wisdom, when searching for libraries (using
find_library) will look inside the libraries PREFIX/lib, PREFIX/lib32, and
PREFIX/lib64.  In a multilib SDK more than one of these will exist (potentially
all three) and obviously for a given build configuration only one of those is
valid.  This search path is hard-coded deep inside CMake but by setting
CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX we can bypass it and set an explicit
lib<SUFFIX> to use.

Do this by writing ${baselib} into the environment file, and then stripping
"lib" from this to obtain the suffix in the cmake-specific environment script,
which is then read in the CMake toolchain.

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/toolchain-scripts.bbclass
meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake
meta/recipes-devtools/cmake/cmake/environment.d-cmake.sh