summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2018-08-03 15:01:12 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-08-07 12:13:03 +0100
commit05f2bf79700b3f745417bc0b27cf636db650928a (patch)
tree4e7a981584c17f3ac0d57ca0ed98bf90293eb6c8 /meta/classes
parentbf02f255def72584a4437efafb50a8325ad8364e (diff)
downloadpoky-05f2bf79700b3f745417bc0b27cf636db650928a.tar.gz
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. (From OE-Core rev: 47160a8c51310f2b40cabf4c1910b5df6e0a15d6) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/toolchain-scripts.bbclass1
1 files changed, 1 insertions, 0 deletions
diff --git a/meta/classes/toolchain-scripts.bbclass b/meta/classes/toolchain-scripts.bbclass
index 0ff5301530..63b07c802f 100644
--- a/meta/classes/toolchain-scripts.bbclass
+++ b/meta/classes/toolchain-scripts.bbclass
@@ -51,6 +51,7 @@ toolchain_create_sdk_env_script () {
51 echo "export OECORE_NATIVE_SYSROOT=\"$sdkpathnative\"" >> $script 51 echo "export OECORE_NATIVE_SYSROOT=\"$sdkpathnative\"" >> $script
52 echo 'export OECORE_TARGET_SYSROOT="$SDKTARGETSYSROOT"' >> $script 52 echo 'export OECORE_TARGET_SYSROOT="$SDKTARGETSYSROOT"' >> $script
53 echo "export OECORE_ACLOCAL_OPTS=\"-I $sdkpathnative/usr/share/aclocal\"" >> $script 53 echo "export OECORE_ACLOCAL_OPTS=\"-I $sdkpathnative/usr/share/aclocal\"" >> $script
54 echo 'export OECORE_BASELIB="${baselib}"' >> $script
54 echo 'unset command_not_found_handle' >> $script 55 echo 'unset command_not_found_handle' >> $script
55 56
56 toolchain_shared_env_script 57 toolchain_shared_env_script