[CMake] GHS - specify cpu option to CMake generator?

Geoffroy J geoffroy.jabouley at gmail.com
Tue Jul 23 03:55:30 EDT 2019


In fact, while looking at a "project" file, i found the following:

#!gbuild
primaryTarget=arm_standalone.tgt
#component top_level_project
[Project]

*  -bsp generic*  -object_dir=objs
 *-cpu=cortexa7*

And when specifying the GHS_BSP_NAME, GHS generator ends-up adding the -bsp
line into the generated project file.
So i was somehow assuming that same behavior was needed for the -cpu flag

Anyway, i changed the approach to just ask CMake to generate plain
makefiles using a toolchain file listing all the required options for
cxarm/ar.

Thanks for your support ;)



On Sat, 20 Jul 2019 at 02:13, frodak17 <frodak17 at gmail.com> wrote:

>
> On Fri, Jul 19, 2019 at 2:52 PM Geoffroy J <geoffroy.jabouley at gmail.com>
> wrote:
>
>> Hello
>>
>> i have tried today to build a library using CMake Green Hills MULTI
>> generator.
>>
>> It seemed to work quite well, but i end up not being able to configure
>> the "-cpu" option for gbuild, which i need to set to "cortexa7".
>>
>> I've went through the CMake code, i think something similar to
>> variable GHS_BSP_NAME would work, but does not seems available at the
>> moment. Does it means it cannot be done at the moment?
>>
>> Do you know how to achieve this? Would using CFLAGS/LDFLAGS a viable
>> solution?
>>
>> Thanks in advance for your answer
>> Regards
>>
>>
> I see -cpu as an option for armcc not for gbuild.
>
> You should be able to pass the -cpu option per target like any other
> compiler option.
> So try using target_compile_options().
> Some options are builder options so they don't start with a dash but with
> a colon but it still should work with target_compile_options().
>
> However my experience has been that is handled by the BSP .bld files for
> the particular target / platform.
> If the BSP target file has the wrong cpu in it then it probably could just
> get updated and then it should "just work".
> For example some of the .bld files contain a ":arm_cputype=cortexa8".
> But I couldn't tell you exactly which files would need to be updated.
>
> --
> F
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20190723/80e3cdf1/attachment-0001.html>


More information about the CMake mailing list