[vtk-developers] VTK forces -std=c++11 ?

Elvis Stansvik elvis.stansvik at orexplore.com
Fri Jan 11 18:56:58 EST 2019


Den fre 11 jan. 2019 kl 21:14 skrev Sean McBride <sean at rogue-research.com>:
>
> On Fri, 11 Jan 2019 15:04:21 -0500, Brad King said:
>
> >On 1/11/19 2:59 PM, Sean McBride wrote:
> >> In cmake I set CMAKE_CXX_FLAGS to "-std=c++2a" but when I do "make
> >VERBOSE=1"
> >> I see that something is passing -std=c++11:
> >>
> >> Is this a bug?  If not, how do I specify the language variant?
> >
> >It's likely CMake adding it based on Common/Core/CMakeLists.txt:
> >
> >```
> >vtk_module_compile_features(VTK::CommonCore
> >  PUBLIC
> >    cxx_std_11
> >    cxx_nullptr
> >    cxx_override)
> >```
> >
> >There is an open CMake issue about handling future standards:
> >
> >  https://gitlab.kitware.com/cmake/cmake/issues/17146#note_300071
>
> It doesn't seem to matter that I've specified a 'future standard', even if I use -std=c++14 I get:
>
> cd /Users/sean/external/VTK-8bin/Utilities/KWIML/vtkkwiml/test && /Users/sean/llvm/llvm-rel-install/bin/clang++  -DKWIML_LANGUAGE_C -DKWIML_LANGUAGE_CXX -DVTK_IN_VTK -I/Users/sean/external/VTK-8bin/Utilities/KWIML -I/Users/sean/external/VTK/Utilities/KWIML  -std=c++14  -g   -std=c++11 -o CMakeFiles/kwiml_test.dir/test_include_CXX.cxx.o -c /Users/sean/external/VTK/Utilities/KWIML/vtkkwiml/test/test_include_CXX.cx,

Just a wild guess, try -DCMAKE_CXX_STANDARD=14 instead of
-DCMAKE_CXX_FLAGS="-std=c++14"? Maybe CMake will consider
CMAKE_CXX_STANDARD=14 as having the cxx_std_11 compile feature and not
"downgrade" you?

Elvis

>
> Sean
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Search the list archives at: http://markmail.org/search/?q=vtk-developers
>
> Follow this link to subscribe/unsubscribe:
> https://vtk.org/mailman/listinfo/vtk-developers
>


More information about the vtk-developers mailing list