`CXX_EXTENSIONS` and `/permissive-`

AFAICT when I’m compiling a C++ target with the property CXX_EXTENSIONS=OFF using MSVC, CMake doesn’t add the /permissive- flag, which as per the docs:

You can use the /permissive- compiler option to specify standards-conforming compiler behavior.

It’s true that it isn’t just one flag, as in the case of ISO vs. GNU language dialect, but two separate flags, one for controlling the language standard and one for controlling the presence of extensions. Is there a conflict between the actual meaning of /permissive- and CXX_EXTENSIONS that precludes from CMake controlling this flag? It seems tedious to hold the hand of CMake and set something manually for which there’s matching CMake and compiler feature.

Not that I disagree with you.

But if something like this were added/changed it would easily break the builds of a lot of projects.

Also why stop at /permissive-? What about /volatile:iso?

I’m sure the answer to your question must have something to do with the fact that up until recently MSVC didn’t care about standards compliance, and the cmake property CXX_EXTENSIONS predates the new compiler options MSVC introduced.

However, I personally agree that CXX_EXTENSIONS OFF should enforce conformant C++ and set /permissive- and /volatile:iso (and possibly more). But something like that would be a big change.

Perhaps a new property is the answer:

set_target_properties(foo PROPERTIES CXX_ISO_COMPLIANT ON)
set_target_properties(bar PROPERTIES C_ISO_COMPLIANT ON)