[oe-commits] [openembedded-core] 05/28: cmake.bbclass: use `cmake --build` to build & install

git at git.openembedded.org git at git.openembedded.org
Tue May 23 16:46:34 UTC 2017


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master
in repository openembedded-core.

commit 2b06cb961edbe52ff66e8edccd007edd0795c30b
Author: Cody P Schafer <dev at codyps.com>
AuthorDate: Thu May 4 13:50:42 2017 -0400

    cmake.bbclass: use `cmake --build` to build & install
    
    Rather than presuming `make` is the generator, use cmake's generic
    `cmake --build` feature (which knows to call the appropriate generator).
    
    Both DESTDIR and VERBOSE still behave as intended when used as
    environment variables instead of make variable-arguments.
    
    As cmake-based builds don't do any configuration with `make`
    invocations, we only pass `PARALLEL_MAKE{,INST}` (via a
    EXTRA_OECMAKE_BUILD variable) to the underlying build tool. Make &
    ninja support the same `-j N` option (and a few others), so this does
    happen to work for both.
    
    This makes it more straight forward for others to select other cmake
    generators (many folks have been reaching for `ninja` lately).
    
    CC: Andre McCurdy <armccurdy at gmail.com>
    Signed-off-by: Cody P Schafer <dev at codyps.com>
    Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 meta/classes/cmake.bbclass | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass
index 8b5f18d..ac2c151 100644
--- a/meta/classes/cmake.bbclass
+++ b/meta/classes/cmake.bbclass
@@ -31,6 +31,9 @@ OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM_class-native = "BOTH"
 
 EXTRA_OECMAKE_append = " ${PACKAGECONFIG_CONFARGS}"
 
+EXTRA_OECMAKE_BUILD_prepend_task-compile = "${PARALLEL_MAKE} "
+EXTRA_OECMAKE_BUILD_prepend_task-install = "${PARALLEL_MAKEINST} "
+
 # CMake expects target architectures in the format of uname(2),
 # which do not always match TARGET_ARCH, so all the necessary
 # conversions should happen here.
@@ -135,11 +138,13 @@ cmake_do_configure() {
 
 do_compile[progress] = "percent"
 cmake_do_compile()  {
-	base_do_compile VERBOSE=1
+	bbnote VERBOSE=1 cmake --build '${B}' -- ${EXTRA_OECMAKE_BUILD}
+	VERBOSE=1 cmake --build '${B}' -- ${EXTRA_OECMAKE_BUILD}
 }
 
 cmake_do_install() {
-	oe_runmake 'DESTDIR=${D}' install
+	bbnote DESTDIR='${D}' cmake --build '${B}' --target install -- ${EXTRA_OECMAKE_BUILD}
+	DESTDIR='${D}' cmake --build '${B}' --target install -- ${EXTRA_OECMAKE_BUILD}
 }
 
 EXPORT_FUNCTIONS do_configure do_compile do_install do_generate_toolchain_file

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list