diff --git a/.travis.yml b/.travis.yml index 8677dd43b..de492c62e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ before_install: - if [ "$TRAVIS_OS_NAME" == "linux" ]; then tar -xzvf cmake-3.2.3-Linux-x86_64.tar.gz; fi - if [ "$TRAVIS_OS_NAME" == "linux" ]; then export PATH=$PWD/cmake-3.2.3-Linux-x86_64/bin:$PATH; fi - sudo apt-get update -qq - - sudo apt-get install -qq -y unixodbc-dev libmysqlclient-dev g++-arm-linux-gnueabi g++-arm-linux-gnueabihf clang-3.5 sloccount cppcheck + - sudo apt-get install -qq -y unixodbc-dev libmysqlclient-dev g++-arm-linux-gnueabi g++-arm-linux-gnueabihf clang-3.5 libc++-dev sloccount cppcheck services: - mongodb diff --git a/CMakeLists.txt b/CMakeLists.txt index 85f44d31e..1a2383d3f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,6 +70,10 @@ else() endif() endif() +if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") +endif() + if(NOT MSVC_IDE) if(NOT CMAKE_BUILD_TYPE) diff --git a/cmake/CXX1x.cmake b/cmake/CXX1x.cmake index 36252f2ba..9d2b59f65 100644 --- a/cmake/CXX1x.cmake +++ b/cmake/CXX1x.cmake @@ -18,7 +18,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -# Determines whether or not the compiler supports C++11 +# Determines whether the compiler supports C++11 macro(check_for_cxx11_compiler _VAR) message(STATUS "Checking for C++11 compiler") set(${_VAR}) @@ -37,9 +37,10 @@ endmacro() macro(enable_cxx11) set (CMAKE_CXX_STANDARD 11) set (CMAKE_CXX_STANDARD_REQUIRED ON) + add_definitions(-DPOCO_ENABLE_CPP11) endmacro() -# Determines whether or not the compiler supports C++11 +# Determines whether the compiler supports C++14 macro(check_for_cxx14_compiler _VAR) message(STATUS "Checking for C++14 compiler") set(${_VAR}) @@ -58,4 +59,5 @@ endmacro() macro(enable_cxx14) set (CMAKE_CXX_STANDARD 14) set (CMAKE_CXX_STANDARD_REQUIRED ON) + add_definitions(-DPOCO_ENABLE_CPP14) endmacro() \ No newline at end of file