Skip to content

Commit e957a77

Browse files
committed
Core (Build): Get MSVC to use correct values for the __cplusplus define.
1 parent ba7da6d commit e957a77

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

libvisual/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ SET(CMAKE_CXX_STANDARD 20)
5151
SET(CMAKE_CXX_STANDARD_REQUIRED on)
5252
SET(CMAKE_CXX_EXTENSIONS off)
5353

54+
# MSVC needs an additional flag to define the right values for __cplusplus.
55+
# CMake couldn't be bothered to do this automatically, so we'll do it ourselves.
56+
IF(MSVC)
57+
ADD_COMPILE_OPTIONS(/Zc:__cplusplus)
58+
ENDIF()
59+
5460
# Check for Unix specific functions
5561
# TODO: Generate error when a required header is missing
5662
CHECK_INCLUDE_FILE(unistd.h HAVE_UNISTD_H)

0 commit comments

Comments
 (0)