diff options
author | Ross Burton <ross.burton@intel.com> | 2018-01-16 13:25:15 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-01-18 12:50:36 +0000 |
commit | 0c0a239011515d1b62951818c1dbe43c0f474160 (patch) | |
tree | 244a428934bfca875bf74b600af93d054d358058 /meta/classes | |
parent | 9b302481982cb6ca92342f9bd5c9b54168424f57 (diff) | |
download | poky-0c0a239011515d1b62951818c1dbe43c0f474160.tar.gz |
cmake: allow target names to be overridden
Don't hardcode the targets used in do_compile and do_install, instead build
"all" and "install" by default but respect OECMAKE_TARGET_COMPILE and
OECMAKE_TARGET_INSTALL variables.
(From OE-Core rev: 806765ec466597d38231d4be303cb48c26e21466)
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 a4079dab0d..10c4edcf1a 100644 --- a/meta/classes/cmake.bbclass +++ b/meta/classes/cmake.bbclass | |||
@@ -34,6 +34,9 @@ EXTRA_OECMAKE_append = " ${PACKAGECONFIG_CONFARGS}" | |||
34 | EXTRA_OECMAKE_BUILD_prepend_task-compile = "${PARALLEL_MAKE} " | 34 | EXTRA_OECMAKE_BUILD_prepend_task-compile = "${PARALLEL_MAKE} " |
35 | EXTRA_OECMAKE_BUILD_prepend_task-install = "${PARALLEL_MAKEINST} " | 35 | EXTRA_OECMAKE_BUILD_prepend_task-install = "${PARALLEL_MAKEINST} " |
36 | 36 | ||
37 | OECMAKE_TARGET_COMPILE ?= "all" | ||
38 | OECMAKE_TARGET_INSTALL ?= "install" | ||
39 | |||
37 | FILES_${PN}-dev += "${libdir}/cmake ${datadir}/cmake" | 40 | FILES_${PN}-dev += "${libdir}/cmake ${datadir}/cmake" |
38 | 41 | ||
39 | # CMake expects target architectures in the format of uname(2), | 42 | # CMake expects target architectures in the format of uname(2), |
@@ -140,13 +143,13 @@ cmake_do_configure() { | |||
140 | 143 | ||
141 | do_compile[progress] = "percent" | 144 | do_compile[progress] = "percent" |
142 | cmake_do_compile() { | 145 | cmake_do_compile() { |
143 | bbnote VERBOSE=1 cmake --build '${B}' -- ${EXTRA_OECMAKE_BUILD} | 146 | bbnote VERBOSE=1 cmake --build '${B}' --target ${OECMAKE_TARGET_COMPILE} -- ${EXTRA_OECMAKE_BUILD} |
144 | VERBOSE=1 cmake --build '${B}' -- ${EXTRA_OECMAKE_BUILD} | 147 | VERBOSE=1 cmake --build '${B}' --target ${OECMAKE_TARGET_COMPILE} -- ${EXTRA_OECMAKE_BUILD} |
145 | } | 148 | } |
146 | 149 | ||
147 | cmake_do_install() { | 150 | cmake_do_install() { |
148 | bbnote DESTDIR='${D}' cmake --build '${B}' --target install -- ${EXTRA_OECMAKE_BUILD} | 151 | bbnote DESTDIR='${D}' cmake --build '${B}' --target ${OECMAKE_TARGET_INSTALL} -- ${EXTRA_OECMAKE_BUILD} |
149 | DESTDIR='${D}' cmake --build '${B}' --target install -- ${EXTRA_OECMAKE_BUILD} | 152 | DESTDIR='${D}' cmake --build '${B}' --target ${OECMAKE_TARGET_INSTALL} -- ${EXTRA_OECMAKE_BUILD} |
150 | } | 153 | } |
151 | 154 | ||
152 | EXPORT_FUNCTIONS do_configure do_compile do_install do_generate_toolchain_file | 155 | EXPORT_FUNCTIONS do_configure do_compile do_install do_generate_toolchain_file |