mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-09 15:47:38 +02:00
Check for std::(tr1::)function support
This commit is contained in:
@@ -221,6 +221,16 @@ if( BUILD_GUI AND UNIX AND NOT APPLE )
|
|||||||
find_package( X11 )
|
find_package( X11 )
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Check if we can use <functional> or need <tr1/functional>
|
||||||
|
include( CheckStdFunctional )
|
||||||
|
check_std_functional( CXX_STD_FUNCTIONAL )
|
||||||
|
include( CheckStdTr1Functional )
|
||||||
|
check_std_tr1_functional( CXX_STD_TR1_FUNCTIONAL )
|
||||||
|
if ( NOT CXX_STD_FUNCTIONAL AND NOT CXX_STD_TR1_FUNCTIONAL )
|
||||||
|
message( FATAL_ERROR
|
||||||
|
"Used compiler neither provides std::function nor std::tr1::function")
|
||||||
|
endif()
|
||||||
|
|
||||||
macro_optional_find_package(Echonest 2.2.0)
|
macro_optional_find_package(Echonest 2.2.0)
|
||||||
macro_log_feature(ECHONEST_FOUND "Echonest" "Qt library for communicating with The Echo Nest" "http://projects.kde.org/libechonest" TRUE "" "libechonest 2.2.0 is needed for dynamic playlists and the infosystem")
|
macro_log_feature(ECHONEST_FOUND "Echonest" "Qt library for communicating with The Echo Nest" "http://projects.kde.org/libechonest" TRUE "" "libechonest 2.2.0 is needed for dynamic playlists and the infosystem")
|
||||||
|
|
||||||
|
13
CMakeModules/CheckStdFunctional.cmake
Normal file
13
CMakeModules/CheckStdFunctional.cmake
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
# taglib changed filenames to be a char/wchar struct on some platforms, need to check for it
|
||||||
|
macro (CHECK_STD_FUNCTIONAL CXX_STD_FUNCTIONAL)
|
||||||
|
include (CheckCXXSourceCompiles)
|
||||||
|
check_cxx_source_compiles(
|
||||||
|
"
|
||||||
|
#include <functional>
|
||||||
|
using std::function;
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}" ${CXX_STD_FUNCTIONAL})
|
||||||
|
endmacro()
|
||||||
|
|
13
CMakeModules/CheckStdTr1Functional.cmake
Normal file
13
CMakeModules/CheckStdTr1Functional.cmake
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
# taglib changed filenames to be a char/wchar struct on some platforms, need to check for it
|
||||||
|
macro (CHECK_STD_TR1_FUNCTIONAL CXX_STD_TR1_FUNCTIONAL)
|
||||||
|
include (CheckCXXSourceCompiles)
|
||||||
|
check_cxx_source_compiles(
|
||||||
|
"
|
||||||
|
#include <tr1/functional>
|
||||||
|
using std::tr1::function;
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}" ${CXX_STD_TR1_FUNCTIONAL})
|
||||||
|
endmacro()
|
||||||
|
|
@@ -21,9 +21,10 @@
|
|||||||
#ifndef CLOSURE_H
|
#ifndef CLOSURE_H
|
||||||
#define CLOSURE_H
|
#define CLOSURE_H
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
#include "DllMacro.h"
|
#include "DllMacro.h"
|
||||||
|
|
||||||
#ifdef _WEBSOCKETPP_CPP11_STL_
|
#if defined(_WEBSOCKETPP_CPP11_STL_) || defined(CXX_STD_FUNCTIONAL)
|
||||||
#include <functional>
|
#include <functional>
|
||||||
using std::function;
|
using std::function;
|
||||||
#else
|
#else
|
||||||
|
@@ -11,6 +11,7 @@
|
|||||||
#cmakedefine SNOW_LEOPARD
|
#cmakedefine SNOW_LEOPARD
|
||||||
#cmakedefine LEOPARD
|
#cmakedefine LEOPARD
|
||||||
#cmakedefine HAVE_SPARKLE
|
#cmakedefine HAVE_SPARKLE
|
||||||
|
#cmakedefine CXX_STD_FUNCTIONAL
|
||||||
|
|
||||||
#cmakedefine WITH_CRASHREPORTER
|
#cmakedefine WITH_CRASHREPORTER
|
||||||
#cmakedefine WITH_BINARY_ATTICA
|
#cmakedefine WITH_BINARY_ATTICA
|
||||||
|
Reference in New Issue
Block a user