Use CMAKE_CXX_STANDARD as a portable way of setting C++11

Fixes MSVC warnings "unknown option -std=c++11"
This commit is contained in:
Lukas W
2017-10-16 15:01:13 +02:00
parent d32b373d78
commit 8ed6295a7d
10 changed files with 11 additions and 20 deletions

View File

@@ -2,7 +2,7 @@ SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
# Enable C++11
ADD_DEFINITIONS(-std=c++0x)
SET(CMAKE_CXX_STANDARD 11)
IF(LMMS_BUILD_APPLE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")

View File

@@ -4,7 +4,7 @@ if(LMMS_HAVE_GIG)
# Disable C++11 on Clang until gig.h is patched
IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
REMOVE_DEFINITIONS(-std=c++0x)
SET(CMAKE_CXX_STANDARD 98)
ENDIF()
# Required for not crashing loading files with libgig

View File

@@ -1,7 +1,7 @@
INCLUDE(BuildPlugin)
# Disable C++11
REMOVE_DEFINITIONS(-std=c++0x)
SET(CMAKE_CXX_STANDARD 98)
BUILD_PLUGIN(ladspaeffect LadspaEffect.cpp LadspaControls.cpp LadspaControlDialog.cpp LadspaSubPluginFeatures.cpp LadspaEffect.h LadspaControls.h LadspaControlDialog.h LadspaSubPluginFeatures.h MOCFILES LadspaEffect.h LadspaControls.h LadspaControlDialog.h EMBEDDED_RESOURCES logo.png)

View File

@@ -1,10 +1,5 @@
INCLUDE(BuildPlugin)
# Enable C++11 for CXXFLAGS only
# This is needed since this plugin uses C. Otherwise Travis fails
REMOVE_DEFINITIONS(-std=c++0x)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
BUILD_PLUGIN(
reverbsc
ReverbSC.cpp

View File

@@ -1,7 +1,3 @@
INCLUDE(BuildPlugin)
# Enable C++11 for CXXFLAGS only
REMOVE_DEFINITIONS(-std=c++0x)
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")

View File

@@ -1,6 +1,6 @@
INCLUDE(BuildPlugin)
# Disable C++11
REMOVE_DEFINITIONS(-std=c++0x)
SET(CMAKE_CXX_STANDARD 98)
BUILD_PLUGIN(papu papu_instrument.cpp papu_instrument.h Basic_Gb_Apu.cpp Basic_Gb_Apu.h gb_apu/Gb_Oscs.cpp gb_apu/Gb_Apu.h gb_apu/Blip_Buffer.cpp gb_apu/Gb_Apu.cpp gb_apu/Gb_Oscs.h gb_apu/blargg_common.h gb_apu/Blip_Buffer.h gb_apu/Multi_Buffer.cpp gb_apu/blargg_source.h gb_apu/Multi_Buffer.h MOCFILES papu_instrument.h EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png")

View File

@@ -24,9 +24,8 @@ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -Wno-write-strings -Wno-deprecated-d
IF(LMMS_BUILD_WIN32)
# link system-libraries
ADD_DEFINITIONS(-DPTW32_STATIC_LIB)
# fix X11 headers errors caused by bug with mingw + c++11
REMOVE_DEFINITIONS(-std=c++0x)
ADD_DEFINITIONS(-std=gnu++0x)
# fix X11 headers errors caused by bug with mingw + c++11 (enable -std=gnu++0x)
SET(CMAKE_CXX_EXTENSIONS ON)
ENDIF(LMMS_BUILD_WIN32)
SET(FLTK_SKIP_OPENGL TRUE)