On Wed, 30 Dec 2020 at 09:01, Yuriy Skalko <yuriy.ska...@gmail.com> wrote:

> > Here is a newer version of the patch that does not use _HAS_CXX17, as it
> > should not really be relied upon (
> >
> https://stackoverflow.com/questions/52379233/is-has-cxx17-marco-usable-in-custom-project-headers-to-enable-c17-language
> ).
>
> I think the right way will be using only standard-compliant
> "__cplusplus" in sources and adding the option "/Zc:__cplusplus" for
> MSVC compiler in the build scripts so it handle __cplusplus in
> standard-compliant way:
>
>
> https://docs.microsoft.com/en-us/cpp/build/reference/zc-cplusplus?view=msvc-160
>

It seems that it's not that easy to pass this flag through CMake, and the
devs are not really willing to do something about it:
https://gitlab.kitware.com/cmake/cmake/-/issues/18837

I tried several things to get the flag at the right position through CMake,
but I can't get it to work (using the technique of
https://stackoverflow.com/questions/57102212/cannot-set-cplusplus-to-c17-standard-with-visual-studio-and-cmake
/ https://gitlab.kitware.com/cmake/cmake/-/issues/18837#note_722441 and
https://peter.bloomfield.online/report-__cplusplus-correctly-with-cmake-and-visual-studio/).
I'm attaching three attempts: the CMake variable CMAKE_CXX_FLAGS is
modified but the new flag never appears anywhere.

Attachment: msvc-z.patch
Description: Binary data

Attachment: msvc-z2.patch
Description: Binary data

Attachment: msvc-z3.patch
Description: Binary data

-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel

Reply via email to