All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cmake bbclass: fix support for native builds
@ 2015-06-30 13:18 Koen Kooi
  2015-06-30 13:28 ` Stefan Herbrechtsmeier
  0 siblings, 1 reply; 3+ messages in thread
From: Koen Kooi @ 2015-06-30 13:18 UTC (permalink / raw)
  To: openembedded-core; +Cc: Koen Kooi

For native builds  of recipes (e.g. mariadb-native) cmake *must* look outside of its sysroot to find the compiler, so instruct it to do so.

Signed-off-by: Koen Kooi <koen.kooi@linaro.org>
---
 meta/classes/cmake.bbclass | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass
index b0a3972..29a78e5 100644
--- a/meta/classes/cmake.bbclass
+++ b/meta/classes/cmake.bbclass
@@ -27,6 +27,9 @@ OECMAKE_RPATH ?= ""
 OECMAKE_PERLNATIVE_DIR ??= ""
 OECMAKE_EXTRA_ROOT_PATH ?= ""
 
+OECMAKE_PATHS ?= ""
+OECMAKE_PATHS_class-native = "set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH )"
+
 cmake_do_generate_toolchain_file() {
 	cat > ${WORKDIR}/toolchain.cmake <<EOF
 # CMake system name must be something like "Linux".
@@ -67,6 +70,8 @@ list(APPEND CMAKE_MODULE_PATH "${STAGING_DATADIR}/cmake/Modules/")
 # add for non /usr/lib libdir, e.g. /usr/lib64
 set( CMAKE_LIBRARY_PATH ${libdir} ${base_libdir})
 
+${OECMAKE_PATHS}
+
 EOF
 }
 
-- 
1.9.3



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] cmake bbclass: fix support for native builds
  2015-06-30 13:18 [PATCH] cmake bbclass: fix support for native builds Koen Kooi
@ 2015-06-30 13:28 ` Stefan Herbrechtsmeier
  2015-07-01  6:49   ` Koen Kooi
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Herbrechtsmeier @ 2015-06-30 13:28 UTC (permalink / raw)
  To: Koen Kooi, openembedded-core

Am 30.06.2015 um 15:18 schrieb Koen Kooi:
> For native builds  of recipes (e.g. mariadb-native) cmake *must* look outside of its sysroot to find the compiler, so instruct it to do so.
>
> Signed-off-by: Koen Kooi <koen.kooi@linaro.org>
> ---
>   meta/classes/cmake.bbclass | 5 +++++
>   1 file changed, 5 insertions(+)
>
> diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass
> index b0a3972..29a78e5 100644
> --- a/meta/classes/cmake.bbclass
> +++ b/meta/classes/cmake.bbclass
> @@ -27,6 +27,9 @@ OECMAKE_RPATH ?= ""
>   OECMAKE_PERLNATIVE_DIR ??= ""
>   OECMAKE_EXTRA_ROOT_PATH ?= ""
>   
> +OECMAKE_PATHS ?= ""
> +OECMAKE_PATHS_class-native = "set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH )"
> +
>   cmake_do_generate_toolchain_file() {
>   	cat > ${WORKDIR}/toolchain.cmake <<EOF
>   # CMake system name must be something like "Linux".
> @@ -67,6 +70,8 @@ list(APPEND CMAKE_MODULE_PATH "${STAGING_DATADIR}/cmake/Modules/")
>   # add for non /usr/lib libdir, e.g. /usr/lib64
>   set( CMAKE_LIBRARY_PATH ${libdir} ${base_libdir})
>   
> +${OECMAKE_PATHS}
> +
>   EOF
>   }
>   
This would generate a second set of the 
CMAKE_FIND_ROOT_PATH_MODE_PROGRAM with a different value.

Why not add a new variable and use it in the existing set:

+OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM = "ONLY"
+OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM_class-native = "BOTH"

-set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY )
+set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM 
${OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM})



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] cmake bbclass: fix support for native builds
  2015-06-30 13:28 ` Stefan Herbrechtsmeier
@ 2015-07-01  6:49   ` Koen Kooi
  0 siblings, 0 replies; 3+ messages in thread
From: Koen Kooi @ 2015-07-01  6:49 UTC (permalink / raw)
  To: Stefan Herbrechtsmeier; +Cc: Koen Kooi, openembedded-core


> Op 30 jun. 2015, om 15:28 heeft Stefan Herbrechtsmeier <stefan@herbrechtsmeier.net> het volgende geschreven:
> 
> Am 30.06.2015 um 15:18 schrieb Koen Kooi:
>> For native builds  of recipes (e.g. mariadb-native) cmake *must* look outside of its sysroot to find the compiler, so instruct it to do so.
>> 
>> Signed-off-by: Koen Kooi <koen.kooi@linaro.org>
>> ---
>>  meta/classes/cmake.bbclass | 5 +++++
>>  1 file changed, 5 insertions(+)
>> 
>> diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass
>> index b0a3972..29a78e5 100644
>> --- a/meta/classes/cmake.bbclass
>> +++ b/meta/classes/cmake.bbclass
>> @@ -27,6 +27,9 @@ OECMAKE_RPATH ?= ""
>>  OECMAKE_PERLNATIVE_DIR ??= ""
>>  OECMAKE_EXTRA_ROOT_PATH ?= ""
>>  +OECMAKE_PATHS ?= ""
>> +OECMAKE_PATHS_class-native = "set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH )"
>> +
>>  cmake_do_generate_toolchain_file() {
>>  	cat > ${WORKDIR}/toolchain.cmake <<EOF
>>  # CMake system name must be something like "Linux".
>> @@ -67,6 +70,8 @@ list(APPEND CMAKE_MODULE_PATH "${STAGING_DATADIR}/cmake/Modules/")
>>  # add for non /usr/lib libdir, e.g. /usr/lib64
>>  set( CMAKE_LIBRARY_PATH ${libdir} ${base_libdir})
>>  +${OECMAKE_PATHS}
>> +
>>  EOF
>>  }
>>  
> This would generate a second set of the CMAKE_FIND_ROOT_PATH_MODE_PROGRAM with a different value.
> 
> Why not add a new variable and use it in the existing set:
> 
> +OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM = "ONLY"
> +OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM_class-native = "BOTH"
> 
> -set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY )
> +set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ${OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM})

That’s a much better solution, v2 coming up. Thanks for the feedback!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-07-01  6:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-30 13:18 [PATCH] cmake bbclass: fix support for native builds Koen Kooi
2015-06-30 13:28 ` Stefan Herbrechtsmeier
2015-07-01  6:49   ` Koen Kooi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.