mirror of
https://github.com/reactos/reactos.git
synced 2024-12-26 17:14:41 +00:00
[CMAKE] Enable proper definition of __cplusplus macro on MSVC
MSVC defaults to always reporting 199711L to satisfy broken C++ code. You have to add a command line argument to make it work correctly. See https://learn.microsoft.com/en-us/cpp/build/reference/zc-cplusplus?view=msvc-170
This commit is contained in:
parent
5797340164
commit
fd265bd7ac
1 changed files with 3 additions and 0 deletions
|
@ -32,6 +32,9 @@ endif()
|
|||
|
||||
add_definitions(/D__STDC__=1)
|
||||
|
||||
# Enable correct values of __cplusplus macro for newer standards
|
||||
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:/Zc:__cplusplus>)
|
||||
|
||||
# Ignore any "standard" include paths, and do not use any default CRT library.
|
||||
if(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
|
||||
add_compile_options(/X /Zl)
|
||||
|
|
Loading…
Reference in a new issue