Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add C++11 as build requirement in CMake #48

Merged
merged 4 commits into from
Dec 13, 2023

Conversation

uilianries
Copy link
Contributor

The Kealib uses C++11 for instance:

However, the CMakeLists.txt does not configures, which breaks in older compiler that does not C++11 or higher as defaulted standard version, like GCC 5:

cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE="build/Release/generators/toolchain.cmake" -DCMAKE_INSTALL_PREFIX="package" -DHDF5_USE_STATIC_LIBRARIES="ON" -DHDF5_PREFER_PARALLEL="OFF" -DHDF5_THREADSAFE="OFF" -DLIBKEA_WITH_GDAL="OFF" -DCMAKE_POLICY_DEFAULT_CMP0091="NEW" -DCMAKE_BUILD_TYPE="Release" ${PWD}
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
...
-- Generating done

cmake --build build/Release -- -j12
Scanning dependencies of target kea
[ 14%] Building CXX object src/CMakeFiles/kea.dir/libkea/KEAImageIO.cpp.o
[ 28%] Building CXX object src/CMakeFiles/kea.dir/libkea/KEAAttributeTableInMem.cpp.o
[ 42%] Building CXX object src/CMakeFiles/kea.dir/libkea/KEAAttributeTable.cpp.o
[ 57%] Building CXX object src/CMakeFiles/kea.dir/libkea/KEAAttributeTableFile.cpp.o
In file included from /usr/include/c++/5/cinttypes:35:0,
                 from /home/foobar/kealib/src/libkea/KEAAttributeTable.cpp:31:
/usr/include/c++/5/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
 #error This file requires compiler and library support \
  ^

This PR adds explicit requirement for C++11 in the CMakeLists.txt.

@gillins gillins merged commit 5e362dd into ubarsc:master Dec 13, 2023
2 checks passed
@gillins
Copy link
Member

gillins commented Dec 13, 2023

Thanks @uilianries !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants