try to fix clang build (use libc++)

This commit is contained in:
Alex Fabijanic
2017-10-24 21:03:08 -05:00
parent 5bb26f8ce5
commit 87ec631b4a
3 changed files with 9 additions and 3 deletions

View File

@@ -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 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 - 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 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: services:
- mongodb - mongodb

View File

@@ -70,6 +70,10 @@ else()
endif() endif()
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 MSVC_IDE)
if(NOT CMAKE_BUILD_TYPE) if(NOT CMAKE_BUILD_TYPE)

View File

@@ -18,7 +18,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE. # THE SOFTWARE.
# Determines whether or not the compiler supports C++11 # Determines whether the compiler supports C++11
macro(check_for_cxx11_compiler _VAR) macro(check_for_cxx11_compiler _VAR)
message(STATUS "Checking for C++11 compiler") message(STATUS "Checking for C++11 compiler")
set(${_VAR}) set(${_VAR})
@@ -37,9 +37,10 @@ endmacro()
macro(enable_cxx11) macro(enable_cxx11)
set (CMAKE_CXX_STANDARD 11) set (CMAKE_CXX_STANDARD 11)
set (CMAKE_CXX_STANDARD_REQUIRED ON) set (CMAKE_CXX_STANDARD_REQUIRED ON)
add_definitions(-DPOCO_ENABLE_CPP11)
endmacro() endmacro()
# Determines whether or not the compiler supports C++11 # Determines whether the compiler supports C++14
macro(check_for_cxx14_compiler _VAR) macro(check_for_cxx14_compiler _VAR)
message(STATUS "Checking for C++14 compiler") message(STATUS "Checking for C++14 compiler")
set(${_VAR}) set(${_VAR})
@@ -58,4 +59,5 @@ endmacro()
macro(enable_cxx14) macro(enable_cxx14)
set (CMAKE_CXX_STANDARD 14) set (CMAKE_CXX_STANDARD 14)
set (CMAKE_CXX_STANDARD_REQUIRED ON) set (CMAKE_CXX_STANDARD_REQUIRED ON)
add_definitions(-DPOCO_ENABLE_CPP14)
endmacro() endmacro()