Skip to content

Commit 47f2d23

Browse files
author
Nathan Ho
committed
remove CPP11 option in CMakeLists.txt and add some comments
1 parent caa1eaa commit 47f2d23

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

01a-BoringMixer/CMakeLists.txt

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,13 @@ if(APPLE OR WIN32)
1212
set(CMAKE_SHARED_MODULE_SUFFIX ".scx")
1313
endif()
1414

15-
option(CPP11 "Build with c++11." ON)
15+
# The below monstrosity sets compiler flags for SSE (Streaming SIMD Extensions). Among many other things, SSE protects
16+
# against denormal numbers, which are known to cause glitchy audio in some cases.
17+
18+
# Some processors do not support SSE and will produce errors if you try to add SSE flags, so we also have to introduce
19+
# conditional logic to guard against those errors.
20+
21+
# It's a real mess, and generally there's no need to touch it :)
1622

1723
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANG)
1824
add_definitions(-fvisibility=hidden)
@@ -54,11 +60,10 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANG)
5460
add_definitions(-march=native)
5561
endif()
5662

57-
if(CPP11)
58-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
59-
if(CMAKE_COMPILER_IS_CLANG)
60-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
61-
endif()
63+
# Plugin headers require C++11, which must be explicitly enabled for gcc and clang.
64+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
65+
if(CMAKE_COMPILER_IS_CLANG)
66+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
6267
endif()
6368
endif()
6469
if(MINGW)

0 commit comments

Comments
 (0)