* [Buildroot] CMake package requires out of source build @ 2021-02-15 21:28 mattwood2000 at gmail.com 2021-02-15 23:07 ` Peter Seiderer 0 siblings, 1 reply; 11+ messages in thread From: mattwood2000 at gmail.com @ 2021-02-15 21:28 UTC (permalink / raw) To: buildroot Hi, I've found myself in a bit of a dilemma with a piece of software I'm trying to integrate into a custom cmake package. The software is the amazon avs-device-sdk: https://github.com/alexa/avs-device-sdk For whatever reason, it does not support building within the source tree. Under normal circumstances one would set <PKG>_SUPPORTS_IN_SOURCE_BUILD=NO, but in this case the sdk will not support a build directory in the source SDK whatsoever, so that config option is useless. The only way I can see to get around this short of Amazon fixing their weird build requirement is to do a dirty hack like below. Does anyone have any other suggestions? Thanks, Matt. --- a/package/pkg-cmake.mk +++ b/package/pkg-cmake.mk @@ -66,7 +66,8 @@ $(3)_SUPPORTS_IN_SOURCE_BUILD ?= YES ifeq ($$($(3)_SUPPORTS_IN_SOURCE_BUILD),YES) $(2)_BUILDDIR = $$($(2)_SRCDIR) else -$(2)_BUILDDIR = $$($(2)_SRCDIR)/buildroot-build +$(2)_BUILDDIR = $$($(2)_SRCDIR)/../$(1)_buildroot-build endif ^ permalink raw reply [flat|nested] 11+ messages in thread
* [Buildroot] CMake package requires out of source build 2021-02-15 21:28 [Buildroot] CMake package requires out of source build mattwood2000 at gmail.com @ 2021-02-15 23:07 ` Peter Seiderer 2021-02-17 14:20 ` mattwood2000 at gmail.com 0 siblings, 1 reply; 11+ messages in thread From: Peter Seiderer @ 2021-02-15 23:07 UTC (permalink / raw) To: buildroot Hello Matt, On Mon, 15 Feb 2021 16:28:28 -0500, mattwood2000 at gmail.com wrote: > Hi, > > I've found myself in a bit of a dilemma with a piece of software I'm > trying to integrate into a custom cmake package. > > The software is the amazon avs-device-sdk: > https://github.com/alexa/avs-device-sdk > > For whatever reason, it does not support building within the source > tree. Under normal circumstances one would set > <PKG>_SUPPORTS_IN_SOURCE_BUILD=NO, but in this case the sdk will not > support a build directory in the source SDK whatsoever, so that config > option is useless. > > The only way I can see to get around this short of Amazon fixing their > weird build requirement is to do a dirty hack like below. > > Does anyone have any other suggestions? You can try it the other way round, overwrite the extract step via <PKG>_EXTRACT_CMDS to extract into build/<package>-<version>/some_sub_dir and use <PKGC>_SUBDIR=some_sub_dir then (did not test the solution).... If it works it would have the advantage to not touch pkg-cmake.mk and keep all files in the package build directory... Regards, Peter > > Thanks, Matt. > > --- a/package/pkg-cmake.mk > +++ b/package/pkg-cmake.mk > @@ -66,7 +66,8 @@ $(3)_SUPPORTS_IN_SOURCE_BUILD ?= YES > ifeq ($$($(3)_SUPPORTS_IN_SOURCE_BUILD),YES) > $(2)_BUILDDIR = $$($(2)_SRCDIR) > else > -$(2)_BUILDDIR = $$($(2)_SRCDIR)/buildroot-build > +$(2)_BUILDDIR = $$($(2)_SRCDIR)/../$(1)_buildroot-build > endif > _______________________________________________ > buildroot mailing list > buildroot at busybox.net > http://lists.busybox.net/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 11+ messages in thread
* [Buildroot] CMake package requires out of source build 2021-02-15 23:07 ` Peter Seiderer @ 2021-02-17 14:20 ` mattwood2000 at gmail.com 2021-02-17 15:52 ` Alexander Dahl 2021-02-17 22:51 ` Peter Seiderer 0 siblings, 2 replies; 11+ messages in thread From: mattwood2000 at gmail.com @ 2021-02-17 14:20 UTC (permalink / raw) To: buildroot Hi Peter, On Mon, Feb 15, 2021 at 6:07 PM Peter Seiderer <ps.report@gmx.net> wrote: > > Hello Matt, > > On Mon, 15 Feb 2021 16:28:28 -0500, mattwood2000 at gmail.com wrote: > > > Hi, > > > > I've found myself in a bit of a dilemma with a piece of software I'm > > trying to integrate into a custom cmake package. > > > > The software is the amazon avs-device-sdk: > > https://github.com/alexa/avs-device-sdk > > > > For whatever reason, it does not support building within the source > > tree. Under normal circumstances one would set > > <PKG>_SUPPORTS_IN_SOURCE_BUILD=NO, but in this case the sdk will not > > support a build directory in the source SDK whatsoever, so that config > > option is useless. > > > > The only way I can see to get around this short of Amazon fixing their > > weird build requirement is to do a dirty hack like below. > > > > Does anyone have any other suggestions? > > You can try it the other way round, overwrite the extract step > via <PKG>_EXTRACT_CMDS to extract into build/<package>-<version>/some_sub_dir > and use <PKGC>_SUBDIR=some_sub_dir then (did not test the solution).... > > If it works it would have the advantage to not touch pkg-cmake.mk and keep > all files in the package build directory... Well, that sounded like a great solution but unfortunately the buildroot still tries to build within the <PKG>_SUBDIR. The main issue is Amazon's rule to disallow in-source building, even within a separate directory. I worked around this by not including their iterate function to detect an in-source build and using SUPPORTS_IN_SOURCE_BUILD=NO. Thanks for the suggestion though. > > Regards, > Peter > > > > > Thanks, Matt. > > > > --- a/package/pkg-cmake.mk > > +++ b/package/pkg-cmake.mk > > @@ -66,7 +66,8 @@ $(3)_SUPPORTS_IN_SOURCE_BUILD ?= YES > > ifeq ($$($(3)_SUPPORTS_IN_SOURCE_BUILD),YES) > > $(2)_BUILDDIR = $$($(2)_SRCDIR) > > else > > -$(2)_BUILDDIR = $$($(2)_SRCDIR)/buildroot-build > > +$(2)_BUILDDIR = $$($(2)_SRCDIR)/../$(1)_buildroot-build > > endif > > _______________________________________________ > > buildroot mailing list > > buildroot at busybox.net > > http://lists.busybox.net/mailman/listinfo/buildroot > ^ permalink raw reply [flat|nested] 11+ messages in thread
* [Buildroot] CMake package requires out of source build 2021-02-17 14:20 ` mattwood2000 at gmail.com @ 2021-02-17 15:52 ` Alexander Dahl 2021-02-17 16:59 ` mattwood2000 at gmail.com 2021-02-17 22:51 ` Peter Seiderer 1 sibling, 1 reply; 11+ messages in thread From: Alexander Dahl @ 2021-02-17 15:52 UTC (permalink / raw) To: buildroot Hei hei, On Wed, Feb 17, 2021 at 09:20:03AM -0500, mattwood2000 at gmail.com wrote: > Well, that sounded like a great solution but unfortunately the > buildroot still tries to build within the <PKG>_SUBDIR. The main > issue is Amazon's rule to disallow in-source building, even within a > separate directory. I worked around this by not including their > iterate function to detect an in-source build and using > SUPPORTS_IN_SOURCE_BUILD=NO. Just out of curiousity: why would you want to build in source anyways? Why not build out of source as usually recommended and first class supported by CMake? Greets Alex -- /"\ ASCII RIBBON | ?With the first link, the chain is forged. The first \ / CAMPAIGN | speech censured, the first thought forbidden, the X AGAINST | first freedom denied, chains us all irrevocably.? / \ HTML MAIL | (Jean-Luc Picard, quoting Judge Aaron Satie) -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20210217/2897d884/attachment.asc> ^ permalink raw reply [flat|nested] 11+ messages in thread
* [Buildroot] CMake package requires out of source build 2021-02-17 15:52 ` Alexander Dahl @ 2021-02-17 16:59 ` mattwood2000 at gmail.com 2021-02-17 18:16 ` Alexander Dahl 0 siblings, 1 reply; 11+ messages in thread From: mattwood2000 at gmail.com @ 2021-02-17 16:59 UTC (permalink / raw) To: buildroot Hi Alex, On Wed, Feb 17, 2021 at 10:52 AM Alexander Dahl <post@lespocky.de> wrote: > Just out of curiousity: why would you want to build in source anyways? > Why not build out of source as usually recommended and first class > supported by CMake? I would prefer to build the source like a normal cmake package, however Amazon disallows building their SDK anywhere within the original source directory. Normally, there should not be any issue with: ./cmake_pkg_src ./cmake_pkg_src/buildroot-build // PKG_SUPPORTS_IN_SOURCE_BUILD = NO But in this case there is a cmake rule that iterates over the entire source directory to check if the build directory is present: https://github.com/alexa/avs-device-sdk/blob/master/build/cmake/DisallowOutOfSourceBuilds.cmake Removing the rule from BuildDefaults.cmake gets around this issue. Also, the source builds perfectly fine this way. I'm not sure why Amazon forces this. Thanks, Matt. > > Greets > Alex > > -- > /"\ ASCII RIBBON | ?With the first link, the chain is forged. The first > \ / CAMPAIGN | speech censured, the first thought forbidden, the > X AGAINST | first freedom denied, chains us all irrevocably.? > / \ HTML MAIL | (Jean-Luc Picard, quoting Judge Aaron Satie) ^ permalink raw reply [flat|nested] 11+ messages in thread
* [Buildroot] CMake package requires out of source build 2021-02-17 16:59 ` mattwood2000 at gmail.com @ 2021-02-17 18:16 ` Alexander Dahl 2021-02-17 20:58 ` Adam Duskett 2021-02-17 21:17 ` mattwood2000 at gmail.com 0 siblings, 2 replies; 11+ messages in thread From: Alexander Dahl @ 2021-02-17 18:16 UTC (permalink / raw) To: buildroot Hello Matt, On Wed, Feb 17, 2021 at 11:59:36AM -0500, mattwood2000 at gmail.com wrote: > On Wed, Feb 17, 2021 at 10:52 AM Alexander Dahl <post@lespocky.de> wrote: > > Just out of curiousity: why would you want to build in source anyways? > > Why not build out of source as usually recommended and first class > > supported by CMake? > > I would prefer to build the source like a normal cmake package, > however Amazon disallows building their SDK anywhere within the > original source directory. Normally, there should not be any issue > with: > > ./cmake_pkg_src > ./cmake_pkg_src/buildroot-build // PKG_SUPPORTS_IN_SOURCE_BUILD = NO Oh, my bad. Of course building in a subfolder "build" (or with another name like above) is quite common with CMake. I usually don't do this, but that's of course only my personal preference. > But in this case there is a cmake rule that iterates over the entire > source directory to check if the build directory is present: > https://github.com/alexa/avs-device-sdk/blob/master/build/cmake/DisallowOutOfSourceBuilds.cmake That makes no sense to me. In that script they link to https://gitlab.kitware.com/cmake/community/-/wikis/FAQ#cmake-does-not-generate-a-make-distclean-target-why but that only covers in source builds. > Removing the rule from BuildDefaults.cmake gets around this issue. > Also, the source builds perfectly fine this way. I'm not sure why > Amazon forces this. Agreed. So why not patch 'build/BuildDefaults.cmake' like that and add the patch to the buildroot package for that avs-device-sdk instead of changing buildroot core? Greets Alex -- /"\ ASCII RIBBON | ?With the first link, the chain is forged. The first \ / CAMPAIGN | speech censured, the first thought forbidden, the X AGAINST | first freedom denied, chains us all irrevocably.? / \ HTML MAIL | (Jean-Luc Picard, quoting Judge Aaron Satie) -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20210217/9f8c4a0e/attachment.asc> ^ permalink raw reply [flat|nested] 11+ messages in thread
* [Buildroot] CMake package requires out of source build 2021-02-17 18:16 ` Alexander Dahl @ 2021-02-17 20:58 ` Adam Duskett 2021-02-18 15:23 ` mattwood2000 at gmail.com 2021-02-17 21:17 ` mattwood2000 at gmail.com 1 sibling, 1 reply; 11+ messages in thread From: Adam Duskett @ 2021-02-17 20:58 UTC (permalink / raw) To: buildroot Hello; I have been porting several aws-iot packages to buildroot in an external tree found here: https://github.com/aduskett/buildroot-aws-iot/ I added avs-device-sdk in the alexa-packages branch along with a small patch to allow for in-source builds. https://github.com/aduskett/buildroot-aws-iot/tree/alexa-packages Thanks! Adam On Wed, Feb 17, 2021 at 10:16 AM Alexander Dahl <post@lespocky.de> wrote: > > Hello Matt, > > On Wed, Feb 17, 2021 at 11:59:36AM -0500, mattwood2000 at gmail.com wrote: > > On Wed, Feb 17, 2021 at 10:52 AM Alexander Dahl <post@lespocky.de> wrote: > > > Just out of curiousity: why would you want to build in source anyways? > > > Why not build out of source as usually recommended and first class > > > supported by CMake? > > > > I would prefer to build the source like a normal cmake package, > > however Amazon disallows building their SDK anywhere within the > > original source directory. Normally, there should not be any issue > > with: > > > > ./cmake_pkg_src > > ./cmake_pkg_src/buildroot-build // PKG_SUPPORTS_IN_SOURCE_BUILD = NO > > Oh, my bad. Of course building in a subfolder "build" (or with another name like above) is > quite common with CMake. I usually don't do this, but that's of course > only my personal preference. > > > But in this case there is a cmake rule that iterates over the entire > > source directory to check if the build directory is present: > > https://github.com/alexa/avs-device-sdk/blob/master/build/cmake/DisallowOutOfSourceBuilds.cmake > > That makes no sense to me. In that script they link to > https://gitlab.kitware.com/cmake/community/-/wikis/FAQ#cmake-does-not-generate-a-make-distclean-target-why > but that only covers in source builds. > > > Removing the rule from BuildDefaults.cmake gets around this issue. > > Also, the source builds perfectly fine this way. I'm not sure why > > Amazon forces this. > > Agreed. So why not patch 'build/BuildDefaults.cmake' like that and add > the patch to the buildroot package for that avs-device-sdk instead of > changing buildroot core? > > Greets > Alex > > -- > /"\ ASCII RIBBON | ?With the first link, the chain is forged. The first > \ / CAMPAIGN | speech censured, the first thought forbidden, the > X AGAINST | first freedom denied, chains us all irrevocably.? > / \ HTML MAIL | (Jean-Luc Picard, quoting Judge Aaron Satie) > _______________________________________________ > buildroot mailing list > buildroot at busybox.net > http://lists.busybox.net/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 11+ messages in thread
* [Buildroot] CMake package requires out of source build 2021-02-17 20:58 ` Adam Duskett @ 2021-02-18 15:23 ` mattwood2000 at gmail.com 2021-02-18 16:35 ` Adam Duskett 0 siblings, 1 reply; 11+ messages in thread From: mattwood2000 at gmail.com @ 2021-02-18 15:23 UTC (permalink / raw) To: buildroot Hi Adam, Thanks for this, sorry I somehow missed your email yesterday. I'll take a look at what you did and compare it to my patches, but as of now I have a working solution. Thanks ,Matt. On Wed, Feb 17, 2021, 3:58 PM Adam Duskett <aduskett@gmail.com> wrote: > Hello; > > I have been porting several aws-iot packages to buildroot in an > external tree found here: > https://github.com/aduskett/buildroot-aws-iot/ > > I added avs-device-sdk in the alexa-packages branch along with a small > patch to allow for > in-source builds. > > https://github.com/aduskett/buildroot-aws-iot/tree/alexa-packages > > Thanks! > > Adam > > On Wed, Feb 17, 2021 at 10:16 AM Alexander Dahl <post@lespocky.de> wrote: > > > > Hello Matt, > > > > On Wed, Feb 17, 2021 at 11:59:36AM -0500, mattwood2000 at gmail.com wrote: > > > On Wed, Feb 17, 2021 at 10:52 AM Alexander Dahl <post@lespocky.de> > wrote: > > > > Just out of curiousity: why would you want to build in source > anyways? > > > > Why not build out of source as usually recommended and first class > > > > supported by CMake? > > > > > > I would prefer to build the source like a normal cmake package, > > > however Amazon disallows building their SDK anywhere within the > > > original source directory. Normally, there should not be any issue > > > with: > > > > > > ./cmake_pkg_src > > > ./cmake_pkg_src/buildroot-build // PKG_SUPPORTS_IN_SOURCE_BUILD = NO > > > > Oh, my bad. Of course building in a subfolder "build" (or with another > name like above) is > > quite common with CMake. I usually don't do this, but that's of course > > only my personal preference. > > > > > But in this case there is a cmake rule that iterates over the entire > > > source directory to check if the build directory is present: > > > > https://github.com/alexa/avs-device-sdk/blob/master/build/cmake/DisallowOutOfSourceBuilds.cmake > > > > That makes no sense to me. In that script they link to > > > https://gitlab.kitware.com/cmake/community/-/wikis/FAQ#cmake-does-not-generate-a-make-distclean-target-why > > but that only covers in source builds. > > > > > Removing the rule from BuildDefaults.cmake gets around this issue. > > > Also, the source builds perfectly fine this way. I'm not sure why > > > Amazon forces this. > > > > Agreed. So why not patch 'build/BuildDefaults.cmake' like that and add > > the patch to the buildroot package for that avs-device-sdk instead of > > changing buildroot core? > > > > Greets > > Alex > > > > -- > > /"\ ASCII RIBBON | ?With the first link, the chain is forged. The first > > \ / CAMPAIGN | speech censured, the first thought forbidden, the > > X AGAINST | first freedom denied, chains us all irrevocably.? > > / \ HTML MAIL | (Jean-Luc Picard, quoting Judge Aaron Satie) > > _______________________________________________ > > buildroot mailing list > > buildroot at busybox.net > > http://lists.busybox.net/mailman/listinfo/buildroot > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20210218/331d0a3b/attachment.html> ^ permalink raw reply [flat|nested] 11+ messages in thread
* [Buildroot] CMake package requires out of source build 2021-02-18 15:23 ` mattwood2000 at gmail.com @ 2021-02-18 16:35 ` Adam Duskett 0 siblings, 0 replies; 11+ messages in thread From: Adam Duskett @ 2021-02-18 16:35 UTC (permalink / raw) To: buildroot No worries; I also added two other Alexa packages in case you need them. Adam On Thu, Feb 18, 2021 at 7:23 AM <mattwood2000@gmail.com> wrote: > > Hi Adam, > > Thanks for this, sorry I somehow missed your email yesterday. > > I'll take a look at what you did and compare it to my patches, but as of now I have a working solution. > > Thanks ,Matt. > > On Wed, Feb 17, 2021, 3:58 PM Adam Duskett <aduskett@gmail.com> wrote: >> >> Hello; >> >> I have been porting several aws-iot packages to buildroot in an >> external tree found here: >> https://github.com/aduskett/buildroot-aws-iot/ >> >> I added avs-device-sdk in the alexa-packages branch along with a small >> patch to allow for >> in-source builds. >> >> https://github.com/aduskett/buildroot-aws-iot/tree/alexa-packages >> >> Thanks! >> >> Adam >> >> On Wed, Feb 17, 2021 at 10:16 AM Alexander Dahl <post@lespocky.de> wrote: >> > >> > Hello Matt, >> > >> > On Wed, Feb 17, 2021 at 11:59:36AM -0500, mattwood2000 at gmail.com wrote: >> > > On Wed, Feb 17, 2021 at 10:52 AM Alexander Dahl <post@lespocky.de> wrote: >> > > > Just out of curiousity: why would you want to build in source anyways? >> > > > Why not build out of source as usually recommended and first class >> > > > supported by CMake? >> > > >> > > I would prefer to build the source like a normal cmake package, >> > > however Amazon disallows building their SDK anywhere within the >> > > original source directory. Normally, there should not be any issue >> > > with: >> > > >> > > ./cmake_pkg_src >> > > ./cmake_pkg_src/buildroot-build // PKG_SUPPORTS_IN_SOURCE_BUILD = NO >> > >> > Oh, my bad. Of course building in a subfolder "build" (or with another name like above) is >> > quite common with CMake. I usually don't do this, but that's of course >> > only my personal preference. >> > >> > > But in this case there is a cmake rule that iterates over the entire >> > > source directory to check if the build directory is present: >> > > https://github.com/alexa/avs-device-sdk/blob/master/build/cmake/DisallowOutOfSourceBuilds.cmake >> > >> > That makes no sense to me. In that script they link to >> > https://gitlab.kitware.com/cmake/community/-/wikis/FAQ#cmake-does-not-generate-a-make-distclean-target-why >> > but that only covers in source builds. >> > >> > > Removing the rule from BuildDefaults.cmake gets around this issue. >> > > Also, the source builds perfectly fine this way. I'm not sure why >> > > Amazon forces this. >> > >> > Agreed. So why not patch 'build/BuildDefaults.cmake' like that and add >> > the patch to the buildroot package for that avs-device-sdk instead of >> > changing buildroot core? >> > >> > Greets >> > Alex >> > >> > -- >> > /"\ ASCII RIBBON | ?With the first link, the chain is forged. The first >> > \ / CAMPAIGN | speech censured, the first thought forbidden, the >> > X AGAINST | first freedom denied, chains us all irrevocably.? >> > / \ HTML MAIL | (Jean-Luc Picard, quoting Judge Aaron Satie) >> > _______________________________________________ >> > buildroot mailing list >> > buildroot at busybox.net >> > http://lists.busybox.net/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 11+ messages in thread
* [Buildroot] CMake package requires out of source build 2021-02-17 18:16 ` Alexander Dahl 2021-02-17 20:58 ` Adam Duskett @ 2021-02-17 21:17 ` mattwood2000 at gmail.com 1 sibling, 0 replies; 11+ messages in thread From: mattwood2000 at gmail.com @ 2021-02-17 21:17 UTC (permalink / raw) To: buildroot Hi Alex, On Wed, Feb 17, 2021 at 1:16 PM Alexander Dahl <post@lespocky.de> wrote: > > > Oh, my bad. Of course building in a subfolder "build" (or with another name like above) is > quite common with CMake. I usually don't do this, but that's of course > only my personal preference. No problem at all! > > > But in this case there is a cmake rule that iterates over the entire > > source directory to check if the build directory is present: > > https://github.com/alexa/avs-device-sdk/blob/master/build/cmake/DisallowOutOfSourceBuilds.cmake > > That makes no sense to me. In that script they link to > https://gitlab.kitware.com/cmake/community/-/wikis/FAQ#cmake-does-not-generate-a-make-distclean-target-why > but that only covers in source builds. > Agreed, very strange indeed. And, like I said it builds perfectly fine overriding their rule. > > Removing the rule from BuildDefaults.cmake gets around this issue. > > Also, the source builds perfectly fine this way. I'm not sure why > > Amazon forces this. > > Agreed. So why not patch 'build/BuildDefaults.cmake' like that and add > the patch to the buildroot package for that avs-device-sdk instead of > changing buildroot core? Yup, thats exactly what I did, I reverted my patch against the core and all works now Thanks, Matt. > > Greets > Alex > > -- > /"\ ASCII RIBBON | ?With the first link, the chain is forged. The first > \ / CAMPAIGN | speech censured, the first thought forbidden, the > X AGAINST | first freedom denied, chains us all irrevocably.? > / \ HTML MAIL | (Jean-Luc Picard, quoting Judge Aaron Satie) ^ permalink raw reply [flat|nested] 11+ messages in thread
* [Buildroot] CMake package requires out of source build 2021-02-17 14:20 ` mattwood2000 at gmail.com 2021-02-17 15:52 ` Alexander Dahl @ 2021-02-17 22:51 ` Peter Seiderer 1 sibling, 0 replies; 11+ messages in thread From: Peter Seiderer @ 2021-02-17 22:51 UTC (permalink / raw) To: buildroot Hello Matt, On Wed, 17 Feb 2021 09:20:03 -0500, mattwood2000 at gmail.com wrote: > Hi Peter, > > On Mon, Feb 15, 2021 at 6:07 PM Peter Seiderer <ps.report@gmx.net> wrote: > > > > Hello Matt, > > > > On Mon, 15 Feb 2021 16:28:28 -0500, mattwood2000 at gmail.com wrote: > > > > > Hi, > > > > > > I've found myself in a bit of a dilemma with a piece of software I'm > > > trying to integrate into a custom cmake package. > > > > > > The software is the amazon avs-device-sdk: > > > https://github.com/alexa/avs-device-sdk > > > > > > For whatever reason, it does not support building within the source > > > tree. Under normal circumstances one would set > > > <PKG>_SUPPORTS_IN_SOURCE_BUILD=NO, but in this case the sdk will not > > > support a build directory in the source SDK whatsoever, so that config > > > option is useless. > > > > > > The only way I can see to get around this short of Amazon fixing their > > > weird build requirement is to do a dirty hack like below. > > > > > > Does anyone have any other suggestions? > > > > You can try it the other way round, overwrite the extract step > > via <PKG>_EXTRACT_CMDS to extract into build/<package>-<version>/some_sub_dir > > and use <PKGC>_SUBDIR=some_sub_dir then (did not test the solution).... > > > > If it works it would have the advantage to not touch pkg-cmake.mk and keep > > all files in the package build directory... > > Well, that sounded like a great solution but unfortunately the > buildroot still tries to build within the <PKG>_SUBDIR. The main > issue is Amazon's rule to disallow in-source building, even within a > separate directory. I worked around this by not including their > iterate function to detect an in-source build and using > SUPPORTS_IN_SOURCE_BUILD=NO. Yes your are right, the actual buildroot logic moves even in the case of _SUPPORTS_IN_SOURCE_BUILD = NO and given _SUBDIR the buildroot-build to $(<PKG>_SUBDIR)/buildroot-build, maybe time to change it for this case to do a real out-of-source-tree build... Tested the following patch for e.g. jpeg-turbo package: --- a/package/jpeg-turbo/jpeg-turbo.mk +++ b/package/jpeg-turbo/jpeg-turbo.mk @@ -13,6 +13,13 @@ JPEG_TURBO_INSTALL_STAGING = YES JPEG_TURBO_PROVIDES = jpeg JPEG_TURBO_DEPENDENCIES = host-pkgconf +JPEG_TURBO_SUPPORTS_IN_SOURCE_BUILD = NO +define JPEG_TURBO_EXTRACT_CMDS + mkdir -p $(@D)/jpeg-turbo-src + gzip -d -c $(JPEG_TURBO_DL_DIR)/$(JPEG_TURBO_SOURCE) | tar --strip-components=1 -C $(@D)/jpeg-turbo-src -xf - +endef +JPEG_TURBO_SUBDIR = jpeg-turbo-src + JPEG_TURBO_CONF_OPTS = -DWITH_JPEG8=ON ifeq ($(BR2_STATIC_LIBS),y) --- a/package/pkg-cmake.mk +++ b/package/pkg-cmake.mk @@ -66,7 +66,7 @@ $(3)_SUPPORTS_IN_SOURCE_BUILD ?= YES ifeq ($$($(3)_SUPPORTS_IN_SOURCE_BUILD),YES) $(2)_BUILDDIR = $$($(2)_SRCDIR) else -$(2)_BUILDDIR = $$($(2)_SRCDIR)/buildroot-build +$(2)_BUILDDIR = $$($(2)_DIR)/buildroot-build endif # Regards, Peter > > Thanks for the suggestion though. > > > > > > Regards, > > Peter > > > > > > > > Thanks, Matt. > > > > > > --- a/package/pkg-cmake.mk > > > +++ b/package/pkg-cmake.mk > > > @@ -66,7 +66,8 @@ $(3)_SUPPORTS_IN_SOURCE_BUILD ?= YES > > > ifeq ($$($(3)_SUPPORTS_IN_SOURCE_BUILD),YES) > > > $(2)_BUILDDIR = $$($(2)_SRCDIR) > > > else > > > -$(2)_BUILDDIR = $$($(2)_SRCDIR)/buildroot-build > > > +$(2)_BUILDDIR = $$($(2)_SRCDIR)/../$(1)_buildroot-build > > > endif > > > _______________________________________________ > > > buildroot mailing list > > > buildroot at busybox.net > > > http://lists.busybox.net/mailman/listinfo/buildroot > > > _______________________________________________ > buildroot mailing list > buildroot at busybox.net > http://lists.busybox.net/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2021-02-18 16:35 UTC | newest] Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2021-02-15 21:28 [Buildroot] CMake package requires out of source build mattwood2000 at gmail.com 2021-02-15 23:07 ` Peter Seiderer 2021-02-17 14:20 ` mattwood2000 at gmail.com 2021-02-17 15:52 ` Alexander Dahl 2021-02-17 16:59 ` mattwood2000 at gmail.com 2021-02-17 18:16 ` Alexander Dahl 2021-02-17 20:58 ` Adam Duskett 2021-02-18 15:23 ` mattwood2000 at gmail.com 2021-02-18 16:35 ` Adam Duskett 2021-02-17 21:17 ` mattwood2000 at gmail.com 2021-02-17 22:51 ` Peter Seiderer
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.