Skip to content

Commit b4a110e

Browse files
authored
Merge pull request #269 from Libvisual/fix-msvc-cplusplus
Core (Build): Get MSVC to use correct values for the __cplusplus define.
2 parents ba7da6d + e957a77 commit b4a110e

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)