Hi Stefan,
On Wed, 27 Apr 2016 08:35:51 [email protected] 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 Eggleton <[email protected]>
Date: 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 <[email protected]>
---
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 <[email protected]>
Date: Thu, 28 Apr 2016 15:16:52 +1200
Subject: [PATCH 2/2] Use a versioned library
Signed-off-by: Paul Eggleton <[email protected]>
---
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
[email protected]
https://lists.yoctoproject.org/listinfo/yocto