Added C++11 support for GCC to the build system.

This commit is contained in:
Nathan Osman 2013-06-29 12:39:34 -07:00
parent 12272de5d7
commit def99b199b
2 changed files with 12 additions and 4 deletions

View File

@ -9,12 +9,20 @@ set(QREDIS_MINOR 1)
set(QREDIS_PATCH 0)
set(QREDIS_VERSION "${QREDIS_MAJOR}.${QREDIS_MINOR}.${QREDIS_PATCH}")
# C++11 support must be enabled in GCC.
if(CMAKE_COMPILER_IS_GNUCXX)
# Ensure that we are using at least GCC 4.6+.
if(${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 4.6)
message(FATAL_ERROR "GCC 4.6+ is required (" ${CMAKE_CXX_COMPILER_VERSION} " detected).")
endif()
# Enable C++11 features.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
endif()
# The QtCore and QtNetwork libraries are both required.
find_package(Qt5Core REQUIRED)
find_package(Qt5Network REQUIRED)
# TODO: enable C++11 compiler support
# Specify where QRedis includes are located.
include_directories(include)

View File

@ -6,8 +6,8 @@ using namespace QRedis;
Client::Client()
: d(new ClientPrivate)
{
connect(d->socket, &QTcpSocket::connected, this, &Client::connected);
connect(d->socket, &QTcpSocket::disconnected, this, &Client::disconnected);
connect(&d->socket, &QTcpSocket::connected, this, &Client::connected);
connect(&d->socket, &QTcpSocket::disconnected, this, &Client::disconnected);
}
Client::~Client()