From ac67f2adb8fd0bd9c500d9cfc345fac29f5dce54 Mon Sep 17 00:00:00 2001 From: Fastigium Date: Fri, 11 Mar 2016 16:32:56 +0100 Subject: [PATCH] Compile several plugins with -std=c++0x to support range-based for loops --- plugins/GigPlayer/CMakeLists.txt | 3 +++ plugins/MidiExport/CMakeLists.txt | 3 +++ plugins/VstEffect/CMakeLists.txt | 4 ++++ plugins/lb302/CMakeLists.txt | 3 +++ plugins/opl2/CMakeLists.txt | 3 +++ plugins/sf2_player/CMakeLists.txt | 3 +++ plugins/vestige/CMakeLists.txt | 3 +++ plugins/zynaddsubfx/CMakeLists.txt | 3 +++ 8 files changed, 25 insertions(+) diff --git a/plugins/GigPlayer/CMakeLists.txt b/plugins/GigPlayer/CMakeLists.txt index 24db813bdee..4e49988eb55 100644 --- a/plugins/GigPlayer/CMakeLists.txt +++ b/plugins/GigPlayer/CMakeLists.txt @@ -12,6 +12,9 @@ if(LMMS_HAVE_GIG) add_definitions(${GCC_GIG_COMPILE_FLAGS}) endif(LMMS_BUILD_WIN32) + # Enable C++11 + ADD_DEFINITIONS(-std=c++0x) + LINK_DIRECTORIES(${GIG_LIBRARY_DIRS} ${SAMPLERATE_LIBRARY_DIRS}) LINK_LIBRARIES(${GIG_LIBRARIES} ${SAMPLERATE_LIBRARIES}) BUILD_PLUGIN(gigplayer GigPlayer.cpp GigPlayer.h PatchesDialog.cpp PatchesDialog.h PatchesDialog.ui MOCFILES GigPlayer.h PatchesDialog.h UICFILES PatchesDialog.ui EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png") diff --git a/plugins/MidiExport/CMakeLists.txt b/plugins/MidiExport/CMakeLists.txt index 1d19f081e6a..d5b08016921 100644 --- a/plugins/MidiExport/CMakeLists.txt +++ b/plugins/MidiExport/CMakeLists.txt @@ -1,4 +1,7 @@ INCLUDE(BuildPlugin) +# Enable C++11 +ADD_DEFINITIONS(-std=c++0x) + BUILD_PLUGIN(midiexport MidiExport.cpp MidiExport.h MidiFile.hpp MOCFILES MidiExport.h) diff --git a/plugins/VstEffect/CMakeLists.txt b/plugins/VstEffect/CMakeLists.txt index 9b262397a5d..b842e194c36 100644 --- a/plugins/VstEffect/CMakeLists.txt +++ b/plugins/VstEffect/CMakeLists.txt @@ -3,6 +3,10 @@ INCLUDE(BuildPlugin) INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/../vst_base") LINK_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/../vst_base") LINK_LIBRARIES(vstbase) + +# Enable C++11 +ADD_DEFINITIONS(-std=c++0x) + BUILD_PLUGIN(vsteffect VstEffect.cpp VstEffectControls.cpp VstEffectControlDialog.cpp VstSubPluginFeatures.cpp VstEffect.h VstEffectControls.h VstEffectControlDialog.h VstSubPluginFeatures.h MOCFILES VstEffectControlDialog.h VstEffectControls.h EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png") SET_TARGET_PROPERTIES(vsteffect PROPERTIES COMPILE_FLAGS "-Wno-attributes") diff --git a/plugins/lb302/CMakeLists.txt b/plugins/lb302/CMakeLists.txt index c9389eb189a..ba2edbd4baa 100644 --- a/plugins/lb302/CMakeLists.txt +++ b/plugins/lb302/CMakeLists.txt @@ -1,3 +1,6 @@ INCLUDE(BuildPlugin) +# Enable C++11 +ADD_DEFINITIONS(-std=c++0x) + BUILD_PLUGIN(lb302 lb302.cpp lb302.h MOCFILES lb302.h EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png") diff --git a/plugins/opl2/CMakeLists.txt b/plugins/opl2/CMakeLists.txt index c12530af8ec..785c3676ed4 100644 --- a/plugins/opl2/CMakeLists.txt +++ b/plugins/opl2/CMakeLists.txt @@ -1,3 +1,6 @@ INCLUDE(BuildPlugin) +# Enable C++11 +SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") + BUILD_PLUGIN(OPL2 opl2instrument.cpp opl2instrument.h opl.h fmopl.c fmopl.h temuopl.cpp temuopl.h MOCFILES opl2instrument.h EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png") diff --git a/plugins/sf2_player/CMakeLists.txt b/plugins/sf2_player/CMakeLists.txt index d087f437d4e..51b8e29ee7f 100644 --- a/plugins/sf2_player/CMakeLists.txt +++ b/plugins/sf2_player/CMakeLists.txt @@ -1,4 +1,7 @@ if(LMMS_HAVE_FLUIDSYNTH) + # Enable C++11 + ADD_DEFINITIONS(-std=c++0x) + INCLUDE(BuildPlugin) INCLUDE_DIRECTORIES(${FLUIDSYNTH_INCLUDE_DIRS} ${SAMPLERATE_INCLUDE_DIRS}) LINK_DIRECTORIES(${FLUIDSYNTH_LIBRARY_DIRS} ${SAMPLERATE_LIBRARY_DIRS}) diff --git a/plugins/vestige/CMakeLists.txt b/plugins/vestige/CMakeLists.txt index 340e5038518..ccc12984d88 100644 --- a/plugins/vestige/CMakeLists.txt +++ b/plugins/vestige/CMakeLists.txt @@ -1,4 +1,7 @@ IF(LMMS_SUPPORT_VST) + # Enable C++11 + ADD_DEFINITIONS(-std=c++0x) + INCLUDE(BuildPlugin) INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/../vst_base") LINK_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/../vst_base") diff --git a/plugins/zynaddsubfx/CMakeLists.txt b/plugins/zynaddsubfx/CMakeLists.txt index 28a2a35d4f2..fa96b9f3240 100644 --- a/plugins/zynaddsubfx/CMakeLists.txt +++ b/plugins/zynaddsubfx/CMakeLists.txt @@ -19,6 +19,9 @@ ENDIF(LMMS_HOST_X86 OR LMMS_HOST_X86_64) # build ZynAddSubFX with full optimizations SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -Wno-write-strings -Wno-deprecated-declarations -fpermissive") +# Enable C++11, but only for ZynAddSubFx.cpp +set_property(SOURCE ZynAddSubFx.cpp APPEND_STRING PROPERTY COMPILE_FLAGS " -std=c++0x ") + # link system-libraries when on win32 IF(LMMS_BUILD_WIN32) ADD_DEFINITIONS(-DPTW32_STATIC_LIB)