ggerganov / imtui

ImTui: Immediate Mode Text-based User Interface C++ Library
https://imtui.ggerganov.com
MIT License
3.04k stars 127 forks source link

Unnecesarily restrict C++ standard on CMake #29

Closed JoseTomasTocino closed 3 years ago

JoseTomasTocino commented 3 years ago

The CMakeLists file sets C++17 as the necessary C++ standard to compile imtui (https://github.com/ggerganov/imtui/blob/418552cbd35a2b468bcac5026903a0b7d3997815/CMakeLists.txt#L85) but the project compiles and runs correctly on C++11 (tested with gcc 4.8.5 on rhel7).

Is there a real need for that?

ggerganov commented 3 years ago

C++17 is used just by the hnterm example.

I just pushed a fix to remove the general C++17 requirement from the main CMakeLists file

JoseTomasTocino commented 3 years ago

That was quick! Thanks a lot.

davidchisnall commented 2 years ago

FYI: The recommended way of setting the C++ standard is per target, with something like:

target_compile_features(imtui PRIVATE cxx_std_11)

This avoids propagating the setting into anything else. If the headers require this standard version then you can change PRIVATE to INTERFACE and anything importing the target will pick it up as a requirement.