diff --git a/CMakeLists.txt b/CMakeLists.txt index b58b2be86..fbc17dd6e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,7 @@ else() endif() set(Boost_USE_MULTI_THREADED ON) -find_package( Boost 1.45.0 REQUIRED unit_test_framework system regex date_time thread filesystem program_options chrono ) +find_package( Boost 1.54.0 REQUIRED unit_test_framework system regex date_time thread filesystem program_options chrono ) find_package( OpenSSL ) find_package( Threads ) set(CMAKE_VERBOSE_MAKEFILE true) @@ -36,8 +36,18 @@ endif() if (${CMAKE_CXX_COMPILER_ID} MATCHES GNU) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") +elseif (${CMAKE_CXX_COMPILER_ID} MATCHES Clang) + if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + # We want to link in C++11 mode if we're using Clang and on OS X. + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -ftemplate-depth=256 -std=c++11 -stdlib=libc++") + else() + # We just add the -Wall and a high enough template depth + # flag for Clang in other systems. + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -ftemplate-dempth=256") + endif() endif() + if (Boost_FOUND) if (MSVC) add_definitions(-D_SCL_SECURE_NO_WARNINGS) diff --git a/libs/network/test/http/CMakeLists.txt b/libs/network/test/http/CMakeLists.txt index 550288f6e..7a08cefb8 100644 --- a/libs/network/test/http/CMakeLists.txt +++ b/libs/network/test/http/CMakeLists.txt @@ -17,10 +17,6 @@ if (Boost_FOUND) request_linearize_test ) foreach ( test ${TESTS} ) - if (${CMAKE_CXX_COMPILER_ID} MATCHES GNU) - set_source_files_properties(${test}.cpp - PROPERTIES COMPILE_FLAGS "-Wall") - endif() add_executable(cpp-netlib-http-${test} ${test}.cpp) add_dependencies(cpp-netlib-http-${test} cppnetlib-uri) @@ -43,10 +39,6 @@ if (Boost_FOUND) client_get_streaming_test ) foreach ( test ${TESTS} ) - if (${CMAKE_CXX_COMPILER_ID} MATCHES GNU) - set_source_files_properties(${test}.cpp - PROPERTIES COMPILE_FLAGS "-Wall") - endif() add_executable(cpp-netlib-http-${test} ${test}.cpp) add_dependencies(cpp-netlib-http-${test} cppnetlib-uri @@ -72,10 +64,6 @@ if (Boost_FOUND) server_async_run_stop_concurrency ) foreach ( test ${SERVER_API_TESTS} ) - if (${CMAKE_CXX_COMPILER_ID} MATCHES GNU) - set_source_files_properties(${test}.cpp - PROPERTIES COMPILE_FLAGS "-Wall") - endif() add_executable(cpp-netlib-http-${test} ${test}.cpp) add_dependencies(cpp-netlib-http-${test} cppnetlib-server-parsers) target_link_libraries(cpp-netlib-http-${test} ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} cppnetlib-server-parsers)