diff options
author | André Draszik <andre.draszik@jci.com> | 2018-02-23 14:50:13 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-03-04 11:35:40 +0000 |
commit | 02fa98e66333cf0b5ab41dc5b05b7b8370540725 (patch) | |
tree | dd5ab496f53b89b8d2a7d7daac1df80305ee2445 /meta/classes | |
parent | 10a51d758fa1fda07bb6818045b15716932ad321 (diff) | |
download | poky-02fa98e66333cf0b5ab41dc5b05b7b8370540725.tar.gz |
cmake: refactor compile and install for easier re-use
cmake_do_compile() and cmake_do_install() basically do the
same, except they use a different --target, and at the
moment this is copy/pasted code with a minor modification.
Other recipes which e.g. might want to support compilation
as part of ptest have to do the same. This is a bit
inconvenient.
By factoring out all of this into a common helper,
cmake_runcmake_build(), this is easily re-used. An
(imaginary) recipe can compile ptest support simply by
using
cmake_runcmake_build --target buildtest-TESTS
(assuming such a build target exists).
Also, this now is very similar to oe_runmake().
(From OE-Core rev: 7620dafe7358f017a8cd558b480af73896768f04)
Signed-off-by: André Draszik <andre.draszik@jci.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/cmake.bbclass | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass index d60dad8d66..fcfd5dda4f 100644 --- a/meta/classes/cmake.bbclass +++ b/meta/classes/cmake.bbclass | |||
@@ -159,14 +159,17 @@ cmake_do_configure() { | |||
159 | -Wno-dev | 159 | -Wno-dev |
160 | } | 160 | } |
161 | 161 | ||
162 | cmake_runcmake_build() { | ||
163 | bbnote ${DESTDIR:+DESTDIR=${DESTDIR} }VERBOSE=1 cmake --build '${B}' "$@" -- ${EXTRA_OECMAKE_BUILD} | ||
164 | eval ${DESTDIR:+DESTDIR=${DESTDIR} }VERBOSE=1 cmake --build '${B}' "$@" -- ${EXTRA_OECMAKE_BUILD} | ||
165 | } | ||
166 | |||
162 | cmake_do_compile() { | 167 | cmake_do_compile() { |
163 | bbnote VERBOSE=1 cmake --build '${B}' --target ${OECMAKE_TARGET_COMPILE} -- ${EXTRA_OECMAKE_BUILD} | 168 | cmake_runcmake_build --target ${OECMAKE_TARGET_COMPILE} |
164 | VERBOSE=1 cmake --build '${B}' --target ${OECMAKE_TARGET_COMPILE} -- ${EXTRA_OECMAKE_BUILD} | ||
165 | } | 169 | } |
166 | 170 | ||
167 | cmake_do_install() { | 171 | cmake_do_install() { |
168 | bbnote DESTDIR='${D}' cmake --build '${B}' --target ${OECMAKE_TARGET_INSTALL} -- ${EXTRA_OECMAKE_BUILD} | 172 | DESTDIR='${D}' cmake_runcmake_build --target ${OECMAKE_TARGET_INSTALL} |
169 | DESTDIR='${D}' cmake --build '${B}' --target ${OECMAKE_TARGET_INSTALL} -- ${EXTRA_OECMAKE_BUILD} | ||
170 | } | 173 | } |
171 | 174 | ||
172 | EXPORT_FUNCTIONS do_configure do_compile do_install do_generate_toolchain_file | 175 | EXPORT_FUNCTIONS do_configure do_compile do_install do_generate_toolchain_file |