@@ -18,6 +18,10 @@ if (${CMAKE_CXX_COMPILER_ID} MATCHES GNU)
18
18
elseif (HAVE_STD0X )
19
19
set (CPP-NETLIB_CXXFLAGS "-Wall -std=c++0x" )
20
20
endif ()
21
+ elseif (${CMAKE_CXX_COMPILER_ID} MATCHES Clang )
22
+ CHECK_CXX_COMPILER_FLAG (-std=c++11 HAVE_STD11 )
23
+ set (CPP-NETLIB_CXXFLAGS "-Wall -std=c++11 -stdlib=libc++" )
24
+ set (CPP-NETLIB_CXXFLAGS "-Wall -std=c++11 -stdlib=libc++" )
21
25
endif ()
22
26
23
27
set (CPP-NETLIB_URI_SRCS uri/uri.cpp uri/schemes.cpp uri/normalize.cpp )
@@ -26,6 +30,9 @@ foreach (src_file ${CPP-NETLIB_URI_SRCS})
26
30
if (${CMAKE_CXX_COMPILER_ID} MATCHES GNU )
27
31
set_source_files_properties (${src_file}
28
32
PROPERTIES COMPILE_FLAGS ${CPP-NETLIB_CXXFLAGS} )
33
+ elseif (${CMAKE_CXX_COMPILER_ID} MATCHES Clang )
34
+ set_source_files_properties (${src_file}
35
+ PROPERTIES COMPILE_FLAGS ${CPP-NETLIB_CXXFLAGS} )
29
36
endif ()
30
37
endforeach (src_file )
31
38
@@ -37,6 +44,9 @@ foreach (src_file ${CPP-NETLIB_MESSAGE_SRCS})
37
44
if (${CMAKE_CXX_COMPILER_ID} MATCHES GNU )
38
45
set_source_files_properties (${src_file}
39
46
PROPERTIES COMPILE_FLAGS ${CPP-NETLIB_CXXFLAGS} )
47
+ elseif (${CMAKE_CXX_COMPILER_ID} MATCHES Clang )
48
+ set_source_files_properties (${src_file}
49
+ PROPERTIES COMPILE_FLAGS ${CPP-NETLIB_CXXFLAGS} )
40
50
endif ()
41
51
endforeach (src_file )
42
52
@@ -46,6 +56,9 @@ foreach (src_file ${CPP-NETLIB_MESSAGE_DIRECTIVES_SRCS})
46
56
if (${CMAKE_CXX_COMPILER_ID} MATCHES GNU )
47
57
set_source_files_properties (${src_file}
48
58
PROPERTIES COMPILE_FLAGS ${CPP-NETLIB_CXXFLAGS} )
59
+ elseif (${CMAKE_CXX_COMPILER_ID} MATCHES Clang )
60
+ set_source_files_properties (${src_file}
61
+ PROPERTIES COMPILE_FLAGS ${CPP-NETLIB_CXXFLAGS} )
49
62
endif ()
50
63
endforeach (src_file )
51
64
@@ -55,6 +68,9 @@ foreach (src_file ${CPP-NETLIB_MESSAGE_WRAPPERS_SRCS})
55
68
if (${CMAKE_CXX_COMPILER_ID} MATCHES GNU )
56
69
set_source_files_properties (${src_file}
57
70
PROPERTIES COMPILE_FLAGS ${CPP-NETLIB_CXXFLAGS} )
71
+ elseif (${CMAKE_CXX_COMPILER_ID} MATCHES Clang )
72
+ set_source_files_properties (${src_file}
73
+ PROPERTIES COMPILE_FLAGS ${CPP-NETLIB_CXXFLAGS} )
58
74
endif ()
59
75
endforeach (src_file )
60
76
@@ -70,6 +86,9 @@ foreach (src_file ${CPP-NETLIB_HTTP_MESSAGE_SRCS})
70
86
if (${CMAKE_CXX_COMPILER_ID} MATCHES GNU )
71
87
set_source_files_properties (${src_file}
72
88
PROPERTIES COMPILE_FLAGS ${CPP-NETLIB_CXXFLAGS} )
89
+ elseif (${CMAKE_CXX_COMPILER_ID} MATCHES Clang )
90
+ set_source_files_properties (${src_file}
91
+ PROPERTIES COMPILE_FLAGS ${CPP-NETLIB_CXXFLAGS} )
73
92
endif ()
74
93
endforeach (src_file )
75
94
@@ -79,6 +98,9 @@ foreach (src_file ${CPP-NETLIB_HTTP_MESSAGE_WRAPPERS_SRCS})
79
98
if (${CMAKE_CXX_COMPILER_ID} MATCHES GNU )
80
99
set_source_files_properties (${src_file}
81
100
PROPERTIES COMPILE_FLAGS ${CPP-NETLIB_CXXFLAGS} )
101
+ elseif (${CMAKE_CXX_COMPILER_ID} MATCHES Clang )
102
+ set_source_files_properties (${src_file}
103
+ PROPERTIES COMPILE_FLAGS ${CPP-NETLIB_CXXFLAGS} )
82
104
endif ()
83
105
endforeach (src_file )
84
106
@@ -88,6 +110,9 @@ foreach (src_file ${CPP-NETLIB_HTTP_SERVER_PARSERS_SRCS})
88
110
if (${CMAKE_CXX_COMPILER_ID} MATCHES GNU )
89
111
set_source_files_properties (${src_file}
90
112
PROPERTIES COMPILE_FLAGS ${CPP-NETLIB_CXXFLAGS} )
113
+ elseif (${CMAKE_CXX_COMPILER_ID} MATCHES Clang )
114
+ set_source_files_properties (${src_file}
115
+ PROPERTIES COMPILE_FLAGS ${CPP-NETLIB_CXXFLAGS} )
91
116
endif ()
92
117
endforeach (src_file )
93
118
@@ -124,6 +149,9 @@ foreach (src_file ${CPP-NETLIB_HTTP_SERVER_SRCS})
124
149
if (${CMAKE_CXX_COMPILER_ID} MATCHES GNU )
125
150
set_source_files_properties (${src_file}
126
151
PROPERTIES COMPILE_FLAGS ${CPP-NETLIB_CXXFLAGS} )
152
+ elseif (${CMAKE_CXX_COMPILER_ID} MATCHES Clang )
153
+ set_source_files_properties (${src_file}
154
+ PROPERTIES COMPILE_FLAGS ${CPP-NETLIB_CXXFLAGS} )
127
155
endif ()
128
156
endforeach (src_file )
129
157
@@ -143,6 +171,9 @@ foreach (src_file ${CPP-NETLIB_HTTP_CLIENT_CONNECTIONS_SRCS})
143
171
if (${CMAKE_CXX_COMPILER_ID} MATCHES GNU )
144
172
set_source_files_properties (${src_file}
145
173
PROPERTIES COMPILE_FLAGS ${CPP-NETLIB_CXXFLAGS} )
174
+ elseif (${CMAKE_CXX_COMPILER_ID} MATCHES Clang )
175
+ set_source_files_properties (${src_file}
176
+ PROPERTIES COMPILE_FLAGS ${CPP-NETLIB_CXXFLAGS} )
146
177
endif ()
147
178
endforeach (src_file )
148
179
@@ -175,6 +206,9 @@ foreach (src_file ${CPP-NETLIB_HTTP_CLIENT_SRCS})
175
206
if (${CMAKE_CXX_COMPILER_ID} MATCHES GNU )
176
207
set_source_files_properties (${src_file}
177
208
PROPERTIES COMPILE_FLAGS ${CPP-NETLIB_CXXFLAGS} )
209
+ elseif (${CMAKE_CXX_COMPILER_ID} MATCHES Clang )
210
+ set_source_files_properties (${src_file}
211
+ PROPERTIES COMPILE_FLAGS ${CPP-NETLIB_CXXFLAGS} )
178
212
endif ()
179
213
endforeach (src_file )
180
214
@@ -184,6 +218,9 @@ foreach (src_file ${CPP-NETLIB_UTILS_THREAD_POOL_SRCS})
184
218
if (${CMAKE_CXX_COMPILER_ID} MATCHES GNU )
185
219
set_source_files_properties (${src_file}
186
220
PROPERTIES COMPILE_FLAGS ${CPP-NETLIB_CXXFLAGS} )
221
+ elseif (${CMAKE_CXX_COMPILER_ID} MATCHES Clang )
222
+ set_source_files_properties (${src_file}
223
+ PROPERTIES COMPILE_FLAGS ${CPP-NETLIB_CXXFLAGS} )
187
224
endif ()
188
225
endforeach (src_file )
189
226
@@ -193,5 +230,8 @@ foreach (src_file ${CPP-NETLIB_CONSTANTS_SRCS})
193
230
if (${CMAKE_CXX_COMPILER_ID} MATCHES GNU )
194
231
set_source_files_properties (${src_file}
195
232
PROPERTIES COMPILE_FLAGS ${CPP-NETLIB_CXXFLAGS} )
233
+ elseif (${CMAKE_CXX_COMPILER_ID} MATCHES Clang )
234
+ set_source_files_properties (${src_file}
235
+ PROPERTIES COMPILE_FLAGS ${CPP-NETLIB_CXXFLAGS} )
196
236
endif ()
197
237
endforeach (src_file )
0 commit comments