Skip to content

aql: Download new TClap by cmake

Tomáš Pecka requested to merge 214-build-fails-on-g-11-because-of-tclap into master

Long story short, tclap<=1.2.4 does not work with g++-11 compiler. We sent a patch into TClap which was merged [1], however, new version was not yet released so the distros have not included the fix in the packaged versions of TClap.

This is becoming kind of a blocker for people who want to compile ALT. I figured out that CMake can download external projects and if you do things magically right [2] you can also convince the external projects to be built before your project so you can depend on them. So, CMake should now download TClap if you configure it to build aql2. As tclap is header-only, compilation of aql2 modules should include the directory where tclap is downloaded (and prefer it to the /usr/include system path). Unfortunately, tclap triggers a lot of warnings for us (hi, -Wsuggest-override and -Werror) that we haven't seen before because system headers do not trigger warnings. Fortunately, CMake can configure includes to be SYSTEM includes (and use -isystem instead -I for g++ builds) which make things working again. However, this is just a really big hack, AFAIK.

(I, personally, still think we should use some new, C++17-ready argument parsing library. There is plenty of them.)

[1] https://sourceforge.net/p/tclap/code/ci/52a118c0edb20f64e8da88dc9d0bfee63f2232ac/

[2] https://crascit.com/2015/07/25/cmake-gtest/

Bug: #214 (closed)

Bug: https://sourceforge.net/p/tclap/bugs/33/

Edited by Tomáš Pecka

Merge request reports