summaryrefslogtreecommitdiffstats
path: root/meta/classes/cmake.bbclass
diff options
context:
space:
mode:
authorCody P Schafer <dev@codyps.com>2017-05-04 13:50:42 -0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-05-23 17:45:36 +0100
commit579d17ba5f722edb9fe79682480c4a9508ad0ed4 (patch)
tree4f71f96fdf3332020673cd550219bbf3a0f3208f /meta/classes/cmake.bbclass
parent74ed0a2615a56460be913191af78152d7fdad593 (diff)
downloadpoky-579d17ba5f722edb9fe79682480c4a9508ad0ed4.tar.gz
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@gmail.com> (From OE-Core rev: 2b06cb961edbe52ff66e8edccd007edd0795c30b) Signed-off-by: Cody P Schafer <dev@codyps.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/cmake.bbclass')
-rw-r--r--meta/classes/cmake.bbclass9
1 files changed, 7 insertions, 2 deletions
diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass
index 8b5f18d8e0..ac2c1519b0 100644
--- a/meta/classes/cmake.bbclass
+++ b/meta/classes/cmake.bbclass
@@ -31,6 +31,9 @@ OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM_class-native = "BOTH"
31 31
32EXTRA_OECMAKE_append = " ${PACKAGECONFIG_CONFARGS}" 32EXTRA_OECMAKE_append = " ${PACKAGECONFIG_CONFARGS}"
33 33
34EXTRA_OECMAKE_BUILD_prepend_task-compile = "${PARALLEL_MAKE} "
35EXTRA_OECMAKE_BUILD_prepend_task-install = "${PARALLEL_MAKEINST} "
36
34# CMake expects target architectures in the format of uname(2), 37# CMake expects target architectures in the format of uname(2),
35# which do not always match TARGET_ARCH, so all the necessary 38# which do not always match TARGET_ARCH, so all the necessary
36# conversions should happen here. 39# conversions should happen here.
@@ -135,11 +138,13 @@ cmake_do_configure() {
135 138
136do_compile[progress] = "percent" 139do_compile[progress] = "percent"
137cmake_do_compile() { 140cmake_do_compile() {
138 base_do_compile VERBOSE=1 141 bbnote VERBOSE=1 cmake --build '${B}' -- ${EXTRA_OECMAKE_BUILD}
142 VERBOSE=1 cmake --build '${B}' -- ${EXTRA_OECMAKE_BUILD}
139} 143}
140 144
141cmake_do_install() { 145cmake_do_install() {
142 oe_runmake 'DESTDIR=${D}' install 146 bbnote DESTDIR='${D}' cmake --build '${B}' --target install -- ${EXTRA_OECMAKE_BUILD}
147 DESTDIR='${D}' cmake --build '${B}' --target install -- ${EXTRA_OECMAKE_BUILD}
143} 148}
144 149
145EXPORT_FUNCTIONS do_configure do_compile do_install do_generate_toolchain_file 150EXPORT_FUNCTIONS do_configure do_compile do_install do_generate_toolchain_file