Closed robertlinux closed 3 years ago
Hi Robert,
Thanks for the PR.
Is there a reason that the samples for the aws-iot-device-sdk-cpp-v2 package can't be built at the same time as the main library by enabling BUILDSAMPLES and a ${PN}-samples defined in the recipe with corresponding FILES${PN}-samples?
Hi Scott,
From git/CMakeLists.txt: if (BUILD_SAMPLES) message(WARNING "BUILD_SAMPLES has been deprecated. Please build each sample separately.") endif()
So it does nothing when set BUILD_SAMPLES=ON
And from git/samples/README.md:
====================
mkdir build
cd build
cmake -DCMAKE_PREFIX_PATH="
#### Note
* `-DCMAKE_PREFIX_PATH` needs to be set to the path aws-iot-device-sdk-cpp-v2 installed.
================
So the samples should be built after aws-iot-device-sdk-cpp-v2 is installed, I tried to make -DCMAKE_PREFIX_PATH point to build dir, but it didn't work, it only worked when point to image dir (the installed dir), if we need build the samples in the same recipe, we need add tasks like:
addtask do_configure_samples after do_install
addtask do_compile_samples after do_configure_samples
[snip]
And the problem is that it's hard to rerun cmake_do_configure with a different OECMAKE_SOURCEPATH (for do_configure_samples) since it is a value which is assigned during parsring, so we have to do either:
1) Copy the whole code of cmake_do_configure into the recipe
2) Patch cmake.bbclass to use a argument as OECMAKE_SOURCEPATH
Either of them don't look good, so the easy way is building the samples in another recipes.
// Robert
>
> Otherwise this looks good to me.
>
> Thanks.
Thanks for the explanation Robert. In this instance I agree that a separate recipe is the easiest approach.
Should we also remove BUILD_SAMPLES from EXTRA_OECMAKE if it is now deprecated?
Thanks for the explanation Robert. In this instance I agree that a separate recipe is the easiest approach.
Should we also remove BUILD_SAMPLES from EXTRA_OECMAKE if it is now deprecated?
Makes sense, I will send a new single PULL to remove it, or should I drop this PULL and send a new one with the removed BUILD_SAMPLES, please?
A new PR is fine. I will merge this now.
Thanks.
A new PR is fine. I will merge this now.
Thanks.
Hi Robert,
Thanks for the PR.
Is there a reason that the samples for the aws-iot-device-sdk-cpp-v2 package can't be built at the same time as the main library by enabling BUILDSAMPLES and a ${PN}-samples defined in the recipe with corresponding FILES${PN}-samples?
Otherwise this looks good to me.
Thanks.