Re: [yocto] problems with cmake finding the c++ includes
Hi Stefan, On Wed, 27 Apr 2016 08:35:51 s.jar...@esa-grimma.de wrote: > Thank you for taking time to check my problem. I fixed that. Maybe not how > you will do it. > My main problem still exists - the compiling problem when the std. c++ > includes needed to be compiled. Maybee you have an idea how to tell the > cmake class where to search it's header files. The problem is Build.cmake in the g3log sources is setting CMAKE_CXX_FLAGS outright instead of adding to it, with the result that the default arguments set by OE (most importantly --sysroot) aren't being supplied to the compiler, so it can't find the standard headers. Really that file needs to be patched - I've attached a patch to fix it which you can put in a "files" or "g3log" directory alongside the recipe and add a file:// pointer to in SRC_URI, see other recipes for examples). Also attached is a patch to fix the fact that the libg3log.so library produced wasn't versioned, which our build system expects and if it's not the case you will get a QA error. It is possible to disable that check but this is a little neater. (I wouldn't normally go this far, but I was in a curious mood this afternoon.) Cheers, Paul PS if you could please retain the mailing list on replies (unless they need to be private) that would be great. -- Paul Eggleton Intel Open Source Technology Centre>From d8cd848f5b52c7b494da721e313462fe058e8561 Mon Sep 17 00:00:00 2001 From: Paul EggletonDate: Thu, 28 Apr 2016 15:15:55 +1200 Subject: [PATCH 1/2] Ensure default CXX flags such as --sysroot don't get wiped out Signed-off-by: Paul Eggleton --- Build.cmake | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Build.cmake b/Build.cmake index 6b583f9..41bfaf5 100644 --- a/Build.cmake +++ b/Build.cmake @@ -23,7 +23,7 @@ SET(ACTIVE_CPP0xx_DIR "Release") IF ("${CMAKE_CXX_COMPILER_ID}" MATCHES ".*Clang") MESSAGE("") MESSAGE("cmake for Clang ") - SET(CMAKE_CXX_FLAGS "-Wall -std=c++11 -Wunused -D_GLIBCXX_USE_NANOSLEEP") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++11 -Wunused -D_GLIBCXX_USE_NANOSLEEP") IF (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libstdc++ -pthread") ELSE() @@ -47,12 +47,12 @@ IF ("${CMAKE_CXX_COMPILER_ID}" MATCHES ".*Clang") ELSEIF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") MESSAGE("cmake for GCC ") IF (APPLE) - set(CMAKE_CXX_FLAGS "-Wall -Wunused -std=c++11 -pthread -D_GLIBCXX_USE_NANOSLEEP") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wunused -std=c++11 -pthread -D_GLIBCXX_USE_NANOSLEEP") ELSEIF (MINGW) - set(CMAKE_CXX_FLAGS "-Wall -Wunused -std=c++11 -pthread -D_GLIBCXX_USE_NANOSLEEP -D_GLIBCXX_USE_SCHED_YIELD") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wunused -std=c++11 -pthread -D_GLIBCXX_USE_NANOSLEEP -D_GLIBCXX_USE_SCHED_YIELD") ELSE() set(PLATFORM_LINK_LIBRIES rt) - set(CMAKE_CXX_FLAGS "-Wall -rdynamic -Wunused -std=c++11 -pthread -D_GLIBCXX_USE_NANOSLEEP -D_GLIBCXX_USE_SCHED_YIELD") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -rdynamic -Wunused -std=c++11 -pthread -D_GLIBCXX_USE_NANOSLEEP -D_GLIBCXX_USE_SCHED_YIELD") ENDIF() ENDIF() -- 2.5.5 >From b8090456a448f8623734b857be597b8eb242a869 Mon Sep 17 00:00:00 2001 From: Paul Eggleton Date: Thu, 28 Apr 2016 15:16:52 +1200 Subject: [PATCH 2/2] Use a versioned library Signed-off-by: Paul Eggleton --- Build.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Build.cmake b/Build.cmake index 41bfaf5..7ec73f6 100644 --- a/Build.cmake +++ b/Build.cmake @@ -107,7 +107,9 @@ if(ADD_BUILD_WIN_SHARED OR NOT(MSVC OR MINGW)) set_target_properties(g3logger_shared PROPERTIES LINKER_LANGUAGE CXX OUTPUT_NAME g3logger - CLEAN_DIRECT_OUTPUT 1) + CLEAN_DIRECT_OUTPUT 1 + VERSION "0.0.0" + SOVERSION 0) IF(APPLE) set_target_properties(g3logger_shared PROPERTIES MACOSX_RPATH TRUE) ENDIF(APPLE) -- 2.5.5 -- ___ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto
Re: [yocto] problems with cmake finding the c++ includes
On 27 April 2016 at 03:12, Paul Eggletonwrote: > On Tue, 26 Apr 2016 09:39:26 Burton, Ross wrote: >> > SUMMARY = "g3log" >> > SECTION = "sek4" >> > LICENSE = "MIT" >> > LIC_FILES_CHKSUM = "file://$ >> > {COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" > > This appears to be the Unlicense [1]. It's worth noting that we seem to be > missing this in our common licenses, though it's listed by SPDX [2]. As an > aside, maybe it's time for us to bring in new license files from SPDX if there > are any others like this? Ross and I were discussing an update for this. There are a lot of new SPDX licenses and I want a day or so with this patch I'm working on because enough has changed I don't want any breakage. -b > >> This should point to the LICENSE file in the clone, and that license file >> doesn't say MIT. >> >> > DEPENDS ="boost" > > I don't think this is correct - at least I can't see any sign upstream that it > needs boost. It even claims that it needs no external libraries. > > Cheers, > Paul > > [1] http://unlicense.org/ > [2] https://spdx.org/licenses/Unlicense.html > > -- > > Paul Eggleton > Intel Open Source Technology Centre -- Elizabeth Flanagan Yocto Project Build and Release -- ___ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto
Re: [yocto] problems with cmake finding the c++ includes
On Tue, 26 Apr 2016 09:39:26 Burton, Ross wrote: > > SUMMARY = "g3log" > > SECTION = "sek4" > > LICENSE = "MIT" > > LIC_FILES_CHKSUM = "file://$ > > {COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" This appears to be the Unlicense [1]. It's worth noting that we seem to be missing this in our common licenses, though it's listed by SPDX [2]. As an aside, maybe it's time for us to bring in new license files from SPDX if there are any others like this? > This should point to the LICENSE file in the clone, and that license file > doesn't say MIT. > > > DEPENDS ="boost" I don't think this is correct - at least I can't see any sign upstream that it needs boost. It even claims that it needs no external libraries. Cheers, Paul [1] http://unlicense.org/ [2] https://spdx.org/licenses/Unlicense.html -- Paul Eggleton Intel Open Source Technology Centre -- ___ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto
Re: [yocto] problems with cmake finding the c++ includes
On 26 April 2016 at 09:04,wrote: > I am new to yocto. I like to create an recipe for the g3log library. I > managed to get the git sources and start the cmake compile. But it stops > when it tries to compile "#include ". Do you have an idea how to > fix that? > Actually including the output of do_configure would be helpful to see what the errors are. It's fairly common for cmake-using recipes to override the CFLAGS/CXXFLAGS provided by the user (in this case, bitbake) which tell it where the compiler is, so the CMakeLists need fixing. I'll also review your recipe. Below there is the content of the "g3log.bb": > > SUMMARY = "g3log" > SECTION = "sek4" > LICENSE = "MIT" > LIC_FILES_CHKSUM = "file://$ > {COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" > This should point to the LICENSE file in the clone, and that license file doesn't say MIT. DEPENDS ="boost" > > SRC_URI[md5sum] = "0dd4767bd072159e64ad69052bb1dbba" > SRC_URI[sha256sum] = > "4fbcc9afe24f6d8b5b90ff04481e88dd0b34f6a797825dab02cd88f129d3ccb7" > If you're doing a git clone then you don't need SRC_URI checksums. > SRC_URI = "git://github.com/KjellKod/g3log.git;rev=1.2" > It's best practise to use a SHA instead of a tag name, as the tag name needs to be resolved on every build which means a network operation. Ross -- ___ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto
[yocto] problems with cmake finding the c++ includes
Hej, I am new to yocto. I like to create an recipe for the g3log library. I managed to get the git sources and start the cmake compile. But it stops when it tries to compile "#include ". Do you have an idea how to fix that? Below there is the content of the "g3log.bb": SUMMARY = "g3log" SECTION = "sek4" LICENSE = "MIT" LIC_FILES_CHKSUM = "file://$ {COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" DEPENDS ="boost" SRC_URI[md5sum] = "0dd4767bd072159e64ad69052bb1dbba" SRC_URI[sha256sum] = "4fbcc9afe24f6d8b5b90ff04481e88dd0b34f6a797825dab02cd88f129d3ccb7" SRC_URI = "git://github.com/KjellKod/g3log.git;rev=1.2" S = "${WORKDIR}/git" inherit pkgconfig cmake Mit freundlichen Grüßen Stefan Jaritz Entwickler ESA Elektroschaltanlagen Grimma GmbH Broner Ring 30 04668 Grimma Telefon: +49 3437 9211 176 Telefax: +49 3437 9211 26 E-Mail: s.jar...@esa-grimma.de Internet: www.esa-grimma.de Geschäftsführer: Dipl.-Ing. Jörg Gaitzsch Jörg Reinker Sitz der Gesellschaft: Grimma Ust.-ID: DE 141784437 Amtsgericht: Leipzig, HRB 5159 Steuernummer: 238/108/00755 Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und löschen Sie diese Nachricht. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet. This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.-- ___ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto