Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello! I have been testing ublksrv with clang compiler, and lost some time trying to understand how to pass proper flags with autotools. This PR contains small fix for the issue. I have tested changes with g++-10, g++-11, g++-12 and clang++-14 up to clang++-16. Unit tests complete successfully.
I am open to any comments concerning this MR and will fix problems, if any.
clang/clang++ can compile ublksrv sources, but it doesn't support '-fcoroutines' flag, which is mandatory for older versions of g++ to compile sources with c++20 coroutines support.
This commit changes Makefile.am and configure.ac, in such way, one can build ublksrv sources using clang++.
After selecting c++ compiler, configure script will match $CXX with clang++ or g++, flag -fcoroutines will be added to CXXFLAGS only when building with g++. Order of match strings in AS_CASE is important, because
*g++*
string includes*clang++*
, thus we must check with longer string first.