JvanKatwijk / dab-cmdline

DAB decoding library with example of its use
GNU General Public License v2.0
57 stars 29 forks source link

cmake include_directories: /usr/include breaks cross-build #61

Closed borine closed 3 years ago

borine commented 5 years ago

Many thanks for developing and sharing this great software. It works well for me, but there is one irritation with the cmake configuration files that means I always have to patch them before I can build. Is there a specific reason why many of the CMakeLists.txt files in this project explicitly add /usr/include to the "include_directories" ? I ask because this breaks cross-compilation, causing the cross compiler to look in the build system's native /usr/include folder before the desired sysroot /usr/include. I can't imagine there is any sane c++ toolchain that does not automatically search for system header files in /usr/include, so my preferred fix is to just delete that line from all CMakeLists.txt files. If there is some obscure reason why dab-cmdline really does need to explicitly tell the compiler to search /usr/include, then can I ask that the line be edited to "=/usr/include" as that would tell the compiler to use the correct sysroot? I can prepare a pull request with either of the above 2 changes if you are happy to accept either of them.

JvanKatwijk commented 5 years ago

Good question. I suppose that when writing the cmakelists file I added it and since it did not harm, there was never a good reason to remove. Right now I am not at home so I cannot test or change anything. End of the month I ll address to issue

On Wed, Jun 5, 2019, 8:28 PM borine notifications@github.com wrote:

Many thanks for developing and sharing this great software. It works well for me, but there is one irritation with the cmake configuration files that means I always have to patch them before I can build. Is there a specific reason why many of the CMakeLists.txt files in this project explicitly add /usr/include to the "include_directories" ? I ask because this breaks cross-compilation, causing the cross compiler to look in the build system's native /usr/include folder before the desired sysroot /usr/include. I can't imagine there is any sane c++ toolchain that does not automatically search for system header files in /usr/include, so my preferred fix is to just delete that line from all CMakeLists.txt files. If there is some obscure reason why dab-cmdline really does need to explicitly tell the compiler to search /usr/include, then can I ask that the line be edited to "=/usr/include" as that would tell the compiler to use the correct sysroot? I can prepare a pull request with either of the above 2 changes if you are happy to accept either of them.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/JvanKatwijk/dab-cmdline/issues/61?email_source=notifications&email_token=ACCPHQEISENU23E5TB54MGLPZAAVVA5CNFSM4HUC2VTKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GX25LCA, or mute the thread https://github.com/notifications/unsubscribe-auth/ACCPHQDEUVLBRBMCUNJSTMDPZAAVVANCNFSM4HUC2VTA .

andimik commented 3 years ago

@borine

This issue from 2019 is still open. Was there any progress in the meantime?

borine commented 3 years ago

I haven't used this project for a while now, but a quick look at the sources shows that CMakeLists.txt in several directories does still have /usr/include in the include_directories list. So no, there has been no progress. The fix is just to delete that entry from all include_directories lists - but I guess no-one else has reported any problems with this, so perhaps its only my build environment that fails.

JvanKatwijk commented 3 years ago

The README of dab-cmdline clearly states that the examples are just to help potential users of the dab-library or its sources in using it. They are not supported

Op do 20 mei 2021 om 08:33 schreef borine @.***>:

I haven't used this project for a while now, but a quick look at the sources shows that CMakeLists.txt in several directories does still have /usr/include in the include_directories list. So no, there has been no progress. The fix is just to delete that entry from all include_directories lists - but I guess no-one else has reported any problems with this, so perhaps its only my build environment that fails.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/JvanKatwijk/dab-cmdline/issues/61#issuecomment-844749939, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCPHQDLWBTKBUKNHQE22M3TOSUK3ANCNFSM4HUC2VTA .

-- Jan van Katwijk

borine commented 3 years ago

As no-one else has reported any problems with this, and I'm not using DAB at the present time, might as well close this. It is most unusual to tell a compiler where to find its own host system include files though :confused: