Skip to content

Commit 4d424b8

Browse files
committed
Updated build scripts for the restructured uri so that it compiles on Linux/GCC 4.7
1 parent e7bfb97 commit 4d424b8

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

uri/src/CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,18 @@
33
# (See accompanying file LICENSE_1_0.txt or copy at
44
# http://www.boost.org/LICENSE_1_0.txt)
55

6+
if (${CMAKE_CXX_COMPILER_ID} MATCHES GNU)
7+
if (HAVE_STD11)
8+
set(CPP-NETLIB_CXXFLAGS "-Wall -std=c++11")
9+
elseif (HAVE_STD0X)
10+
set(CPP-NETLIB_CXXFLAGS "-Wall -std=c++0x")
11+
endif()
12+
elseif (${CMAKE_CXX_COMPILER_ID} MATCHES Clang)
13+
CHECK_CXX_COMPILER_FLAG(-std=c++11 HAVE_STD11)
14+
set(CPP-NETLIB_CXXFLAGS "-Wall -std=c++11 -stdlib=libc++")
15+
set(CPP-NETLIB_CXXFLAGS "-Wall -std=c++11 -stdlib=libc++")
16+
endif()
17+
618
include_directories(${CPP-NETLIB_SOURCE_DIR}/uri/src)
719
set(CPP-NETLIB_URI_SRCS uri.cpp schemes.cpp normalize.cpp)
820
add_library(cppnetlib-uri ${CPP-NETLIB_URI_SRCS})

uri/test/CMakeLists.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66

77
#include_directories(${GTEST_INCLUDE_DIRS})
8+
include_directories(${CPP-NETLIB_SOURCE_DIR}/uri/src)
89

910
if (Boost_FOUND)
1011
set(
@@ -20,10 +21,8 @@ if (Boost_FOUND)
2021
endif()
2122
add_executable(cpp-netlib-${test} ${test}.cpp)
2223
add_dependencies(cpp-netlib-${test} cppnetlib-uri)
23-
message(STATUS ${Boost_FOUND})
24-
message(STATUS ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
2524
target_link_libraries(cpp-netlib-${test}
26-
${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} cppnetlib-uri)
25+
${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} cppnetlib-uri)
2726
if (OPENSSL_FOUND)
2827
target_link_libraries(cpp-netlib-${test} ${OPENSSL_LIBRARIES})
2928
endif()

0 commit comments

Comments
 (0)