Thanks

So, first, I thought - as I had seen examples that I had to put these flags 
etc. in the configuration function but it appears that was a wrong thing.
Now my recipe looks like:
SUMMARY = "mylib"
DESCRIPTION = "Fetch and build mylibi"
LICENSE = "CLOSED"
LIC_FILES_CHKSUM = ""

##EXTRA_OECMAKE = "all"
inherit cmake

python do_display_banner() {
    bb.plain("***********************************************");
    bb.plain("*                                             *");
    bb.plain("*  mylibrecipe created by mei         *");
    bb.plain("*                                             *");
    bb.plain("***********************************************");
}

addtask display_banner before do_build

# where and how to get source
## this is via git
SRC_URI = "git://git@correct git - this works;"

# where to source is stored
S = "${WORKDIR}/git"

## was using target flags but Mikko suggested EXTRA_OECMAKE which at least 
doesnt complain
##TARGET_CFLAGS += "-DBUILD_PYTHON_BINDINGS=ON -DBUILD_SHARED=ON 
-DBUILD_TOOLS=ON"
##TARGET_CXXFLAGS += "-DBUILD_PYTHON_BINDINGS=ON -DBUILD_SHARED=ON 
-DBUILD_TOOLS=ON"
EXTRA_OECMAKE += "-DBUILD_PYTHON_BINDINGS=ON -DBUILD_SHARED=ON -DBUILD_TOOLS=ON"

## this I think is needed to ensure the correct compilers are used... I think 
anyway.
export CXX="/usr/bin/arm-none-gnueabi-g++"
export CMAKE_CXX_COMPILER="/usr/bin/arm-none-gnueabi-g++"




However:
| DEBUG: Python function extend_recipe_sysroot finished
| DEBUG: Executing shell function do_configure
| -- The CXX compiler identification is GNU 9.4.0
| -- The C compiler identification is GNU 9.4.0
| -- Detecting CXX compiler ABI info
| -- Detecting CXX compiler ABI info - failed
| -- Check for working CXX compiler: /usr/bin/g++
| -- Check for working CXX compiler: /usr/bin/g++ - broken
| CMake Error at 
/home/dave/Documents/Kymati/yocto/build/tmp/work/cortexa53-crypto-phytec-linux/libkymati/1.0-r0/recipe-sysroot-native/usr/share/cmake-3.19/Modules/CMakeTestCXXCompiler.cmake:59
 (message):
|   The C++ compiler
|
|     "/usr/bin/g++"
|
|   is not able to compile a simple test program.
|





suggesting it is not using the c++ I thought it should be.
________________________________
From: Mikko Rapeli <mikko.rap...@linaro.org>
Sent: 17 October 2023 11:52
To: Dave Hitchman <dave.hitch...@kymati.com>
Cc: yocto@lists.yoctoproject.org <yocto@lists.yoctoproject.org>
Subject: Re: [yocto] Using cmake... how?

Hi,

On Tue, Oct 17, 2023 at 09:21:27AM +0000, Dave Hitchman wrote:
> Oh I dont know. This is getting to be a bit annoying.
> I had already included the inherit cmake line but now it seems maybe that you 
> dont need to put any cmake commands in... not 100% sure, no one seems to 
> explain this, I am not convinced.
> However I want some extra flags and I have read that you should be able to:
> TARGET_CFLAGS += "-DBUILD_PYTHON_BINDINGS=ON -DBUILD_SHARED=ON 
> -DBUILD_TOOLS=ON"

Don't put these into CFLAGS. I presume you want to give these to CMake via 
EXTRA_OECMAKE
variable to be used at do_configure time. Check poky tree for documentation and 
examples,
docs are also here:

https://docs.yoctoproject.org/dev/singleindex.html#cmake

> but building that gives me
> + cd 
> /home/dave/Documents/Kymati/yocto/build/tmp/work/cortexa53-crypto-phytec-linux/libkymati/1.0-r0/build
> + do_configure
> + cd 
> /home/dave/Documents/Kymati/yocto/build/tmp/work/cortexa53-crypto-phytec-linux/libkymati/1.0-r0/git
> + TARGET_CFLAGS:=-DBUILD_PYTHON_BINDINGS=ON -DBUILD_SHARED=ON -DBUILD_TOOLS=ON
>
> /home/dave/Documents/Kymati/yocto/build/tmp/work/cortexa53-crypto-phytec-linux/libkymati/1.0-r0/temp/run.do_configure.991537:
>  159: TARGET_CFLAGS:=-DBUILD_PYTHON_BINDINGS=ON -DBUILD_SHARED=ON 
> -DBUILD_TOOLS=ON: not found
>
> Is there a good, really works, actually sets extra flags, really shows and 
> explains with comments and everything example I can look at?  This bitbake is 
> clearly clever, so is cmake, but in honesty I really gave up trying to 
> understand any of it and just want it to work, writing the code is one thing 
> but these build systems are a fight all of their own that takes longer than 
> the code to solve the universe

Build systems are hard. I'm sure someone will invent another one to solve all 
issues
and resurrect all old ones. :)

Cheers,

-Mikko
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#61369): https://lists.yoctoproject.org/g/yocto/message/61369
Mute This Topic: https://lists.yoctoproject.org/mt/101998042/21656
Group Owner: yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to