[OE-core] [PATCH] cmake.bbclass: set archiver, linker and ranlib in toolchain.cmake

Stefan Herbrechtsmeier stefan at herbrechtsmeier.net
Fri Jul 17 13:23:15 UTC 2015


Am 17.07.2015 um 14:23 schrieb Bach, Pascal:
> Hi
>
>> -----Original Message-----
>> From: Stefan Herbrechtsmeier [mailto:stefan at herbrechtsmeier.net]
>> Sent: Freitag, 17. Juli 2015 12:56
>> To: Bach, Pascal; openembedded-core at lists.openembedded.org
>> Subject: Re: [OE-core] [PATCH] cmake.bbclass: set archiver, linker and ranlib
>> in toolchain.cmake
>>
>> Am 17.07.2015 um 09:44 schrieb Pascal Bach:
>>> Setting CMAKE_AR, CMAKE_LINKER and CMAKE_RANLIB correctly in
>>> toolchain.cmake is necessary to correctly build -native packages using
>>> CMake.
>>>
>>> The reason is that CMake is not able to find the above utilities by
>>> itself because CMAKE_FIND_ROOT_PATH_MODE_PROGRAM is set to
>> ONLY so we
>>> need to tell it explicitly where to look.
>> Which version do you use? The master sets
>> CMAKE_FIND_ROOT_PATH_MODE_PROGRAM to BOTH for native packages.
>>
> I tested it with 1.7.2. I didn't notice that change in master.
> So I retested with master and it is working there without modifications.
Good

>> If this don't work you could set the
>> CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN
>> path (without /bin).
>>
>>> Signed-off-by: Pascal Bach <pascal.bach at siemens.com>
>>> ---
>>>    meta/classes/cmake.bbclass | 8 ++++++++
>>>    1 file changed, 8 insertions(+)
>>>
>>> diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass
>>> index 995ddf1..cae0ad2 100644
>>> --- a/meta/classes/cmake.bbclass
>>> +++ b/meta/classes/cmake.bbclass
>>> @@ -13,6 +13,9 @@ inherit autotools
>>>    # C/C++ Compiler (without cpu arch/tune arguments)
>>>    OECMAKE_C_COMPILER ?= "`echo ${CC} | sed 's/^\([^ ]*\).*/\1/'`"
>>>    OECMAKE_CXX_COMPILER ?= "`echo ${CXX} | sed 's/^\([^ ]*\).*/\1/'`"
>>> +OECMAKE_AR ?= "`echo ${AR} | sed 's/^\([^ ]*\).*/\1/'`"
>> This is already set in master.
>>
> Just saw this.
>
>>> +OECMAKE_LINKER ?= "`echo ${LD} | sed 's/^\([^ ]*\).*/\1/'`"
>>> +OECMAKE_RANLIB ?= "`echo ${RANLIB} | sed 's/^\([^ ]*\).*/\1/'`"
>> You don't need the sed for ranlib.
>>
> I wasn't sure it is needed I just keept it to be on the safe side.
>
> The question is if the two above lines are needed at all. As I wrote above it is now working without them.
> For consistency reasons one could add them but currently I wouldn't do it.
They aren't needed because they aren't used anywhere.




More information about the Openembedded-core mailing list