Patchwork cmake.bbclass: Don't use packages from the native build machine

login
register
mail settings
Submitter Stefan Herbrechtsmeier
Date Aug. 14, 2013, 8:47 a.m.
Message ID <1376470064-6391-1-git-send-email-stefan@herbrechtsmeier.net>
Download mbox | patch
Permalink /patch/55593/
State Accepted
Commit 044037d8add3556a90ac4da5991e1e5975d62e25
Headers show

Comments

Stefan Herbrechtsmeier - Aug. 14, 2013, 8:47 a.m.
Signed-off-by: Stefan Herbrechtsmeier <stefan@herbrechtsmeier.net>
---
 meta/classes/cmake.bbclass |    1 +
 1 file changed, 1 insertion(+)
Lukas Bulwahn - Aug. 14, 2013, 12:05 p.m.
Hi Stefan,

I have been working with this patch for quite some time on my
OpenEmbedded-Core repository and I have not seen any problems, but I do not
know if it breaks anything on the complete 'bitbake world'.

Lukas

> -----Urspr√ľngliche Nachricht-----
> Von: openembedded-core-bounces@lists.openembedded.org
> [mailto:openembedded-core-bounces@lists.openembedded.org] Im
> Auftrag von Stefan Herbrechtsmeier
> Gesendet: Mittwoch, 14. August 2013 10:48
> An: openembedded-core@lists.openembedded.org
> Betreff: [OE-core] [PATCH] cmake.bbclass: Don't use packages from the
> native build machine
> 
> Signed-off-by: Stefan Herbrechtsmeier <stefan@herbrechtsmeier.net>
> ---
>  meta/classes/cmake.bbclass |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass index
> 310242e..8e579a7 100644
> --- a/meta/classes/cmake.bbclass
> +++ b/meta/classes/cmake.bbclass
> @@ -49,6 +49,7 @@ set( CMAKE_CXX_LINK_FLAGS
> "${OECMAKE_CXX_LINK_FLAGS}" CACHE STRING "LDFLAGS" )  # only search
> in the paths provided so cmake doesnt pick  # up libraries and tools from
the
> native build machine  set( CMAKE_FIND_ROOT_PATH
> ${STAGING_DIR_HOST} ${STAGING_DIR_NATIVE} ${CROSS_DIR}
> ${OECMAKE_PERLNATIVE_DIR} ${OECMAKE_EXTRA_ROOT_PATH}
> ${EXTERNAL_TOOLCHAIN})
> +set( CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY )
>  set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY )  set(
> CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )  set(
> CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )
> --
> 1.7.9.5
> 
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
Stefan Herbrechtsmeier - Aug. 15, 2013, 7:44 p.m.
Am 14.08.2013 14:05, schrieb Lukas Bulwahn:
> I have been working with this patch for quite some time on my
> OpenEmbedded-Core repository and I have not seen any problems, but I do not
> know if it breaks anything on the complete 'bitbake world'.
The only thing that should be used from the native build machine is the 
detection of the native compiler and this detection is already broken as 
the cmake module expect a CMAKE_C_COMPILER  and CMAKE_CXX_COMPILER 
compiler variable with full paths.

>> -----Urspr√ľngliche Nachricht-----
>> Von: openembedded-core-bounces@lists.openembedded.org
>> [mailto:openembedded-core-bounces@lists.openembedded.org] Im
>> Auftrag von Stefan Herbrechtsmeier
>> Gesendet: Mittwoch, 14. August 2013 10:48
>> An: openembedded-core@lists.openembedded.org
>> Betreff: [OE-core] [PATCH] cmake.bbclass: Don't use packages from the
>> native build machine
>>
>> Signed-off-by: Stefan Herbrechtsmeier <stefan@herbrechtsmeier.net>
>> ---
>>   meta/classes/cmake.bbclass |    1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass index
>> 310242e..8e579a7 100644
>> --- a/meta/classes/cmake.bbclass
>> +++ b/meta/classes/cmake.bbclass
>> @@ -49,6 +49,7 @@ set( CMAKE_CXX_LINK_FLAGS
>> "${OECMAKE_CXX_LINK_FLAGS}" CACHE STRING "LDFLAGS" )  # only search
>> in the paths provided so cmake doesnt pick  # up libraries and tools from
> the
>> native build machine  set( CMAKE_FIND_ROOT_PATH
>> ${STAGING_DIR_HOST} ${STAGING_DIR_NATIVE} ${CROSS_DIR}
>> ${OECMAKE_PERLNATIVE_DIR} ${OECMAKE_EXTRA_ROOT_PATH}
>> ${EXTERNAL_TOOLCHAIN})
>> +set( CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY )
>>   set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY )  set(
>> CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )  set(
>> CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )
>> --
>> 1.7.9.5
>>
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core@lists.openembedded.org
>> http://lists.openembedded.org/mailman/listinfo/openembedded-core

Patch

diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass
index 310242e..8e579a7 100644
--- a/meta/classes/cmake.bbclass
+++ b/meta/classes/cmake.bbclass
@@ -49,6 +49,7 @@  set( CMAKE_CXX_LINK_FLAGS "${OECMAKE_CXX_LINK_FLAGS}" CACHE STRING "LDFLAGS" )
 # only search in the paths provided so cmake doesnt pick
 # up libraries and tools from the native build machine
 set( CMAKE_FIND_ROOT_PATH ${STAGING_DIR_HOST} ${STAGING_DIR_NATIVE} ${CROSS_DIR} ${OECMAKE_PERLNATIVE_DIR} ${OECMAKE_EXTRA_ROOT_PATH} ${EXTERNAL_TOOLCHAIN})
+set( CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY )
 set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY )
 set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )
 set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )