Does YDK have support for C++ 17?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2023 01:47 PM
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.
- Labels:
-
YANG Development Kit (YDK)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2023 05:07 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2023 06:48 AM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2023 09:48 AM
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/.
