File 000-supercollider-sc3-plugins-cmake-force-c++-17.patch of Package supercollider-sc3-plugins
From 23fb31a846bb846b2a849d19a3ecd0d537714708 Mon Sep 17 00:00:00 2001
From: JordanHendersonMusic <j.henderson.music@outloook.com>
Date: Sat, 15 Jun 2024 15:08:08 +0100
Subject: [PATCH] Cmake force c++ 17
Supercollider uses c++17, not 11.
---
CMakeLists.txt | 11 ++++-------
README.md | 2 ++
2 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2a17f512e5..278750ceba 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -69,7 +69,6 @@ option(QUARKS "Install plugins as quarks")
option(OSX_PACKAGE "Package dmg for Apple")
option(IN_PLACE_BUILD "Build and install in cmake build folder" ON)
option(NOVA_SIMD "Build VBAP with nova-simd support." ON)
-option(CPP11 "Build with c++11." ON)
option(NATIVE "Optimize for this specific machine." OFF)
option(SYSTEM_STK "Use STK libraries from system" OFF)
option(HOA_UGENS "Build with HOAUGens (Higher-order Ambisonics)" ON)
@@ -119,12 +118,10 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANG)
add_definitions(-march=native)
endif()
- if(CPP11)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
- if(CMAKE_COMPILER_IS_CLANG)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
- endif()
- endif()
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
+ if(CMAKE_COMPILER_IS_CLANG)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
+ endif()
endif()
if(MINGW)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mstackrealign")
diff --git a/README.md b/README.md
index 0a4da456cc..3e1fe8fa53 100644
--- a/README.md
+++ b/README.md
@@ -50,6 +50,8 @@ git clone --recursive https://github.com/supercollider/sc3-plugins.git
git clone --recursive https://github.com/supercollider/supercollider.git
```
+Note, if you are building for an older version of supercollider you should checkout the sc3-plugins tag which matches the version of supercollider.
+
Be sure to use `--recursive`, or to initialize the submodules after cloning, otherwise you will not have files
that are necessary to build the project.