cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
487
Views
5
Helpful
3
Replies

Does YDK have support for C++ 17?

Mike Fisher
Level 1
Level 1

Does YDK have support for C++17 standard?  If so, how do I build the YDK and model bundles using the C++17 standard.  Currently, it looks like the generated cmake files enforce the C++11 standard.

3 Replies 3

ygorelik
Cisco Employee
Cisco Employee

The YDK code is compliant with C++11 standard. It is up to you to try change it to C++17. All you need is in CMakeLists.txt change line:

set_property(TARGET ${CPACK_LIBRARY_NAME} PROPERTY CXX_STANDARD 17)

Hopefully that will not require to change the YDK C++ code. Try it and share the results.

I have an in house Yang Data Model that I generated C++ API code for using the "generate.py --cpp --bundle <path to json file> -is" command.  This generated a CMakeLists.txt file.  I tried updating the CMakeLists.txt file to set the CXX_STANDARD variable, but it gets overwritten every time I re-run the generate.py script.  Is there a way to prevent the generate.py script from overwriting the CMakeLists.txt file or should I not re-run the generate.py script and just manually use the modified CMakeLists.txt file via cmake and make?

I believe you have modified the wrong file. For C++ bundle you should modify sdk/cpp/packages/CMakeLists.txt. Each time you call "generate.py --cpp --bundle" the cmake file is copied from that location to gen-api/cpp/xxx-bundle/.