Skip to content

Commit 84fd046

Browse files
committed
boost: add Boost.URL
1 parent 7e07692 commit 84fd046

File tree

7 files changed

+39
-1
lines changed

7 files changed

+39
-1
lines changed

recipes/boost/all/conanfile.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
"thread",
5858
"timer",
5959
"type_erasure",
60+
"url",
6061
"wave",
6162
)
6263

@@ -275,17 +276,20 @@ def config_options(self):
275276
self.options.without_fiber = True
276277
self.options.without_nowide = True
277278
self.options.without_json = True
279+
self.options.without_url = True
278280
else:
279281
version_cxx11_standard_json = self._min_compiler_version_default_cxx11
280282
if version_cxx11_standard_json:
281283
if Version(self.settings.compiler.version) < version_cxx11_standard_json:
282284
self.options.without_fiber = True
283285
self.options.without_json = True
284286
self.options.without_nowide = True
287+
self.options.without_url = True
285288
else:
286289
self.options.without_fiber = True
287290
self.options.without_json = True
288291
self.options.without_nowide = True
292+
self.options.without_url = True
289293

290294
# iconv is off by default on Windows and Solaris
291295
if self._is_windows_platform or self.settings.os == "SunOS":
@@ -434,7 +438,7 @@ def layout(self):
434438

435439
@property
436440
def _cxx11_boost_libraries(self):
437-
libraries = ["fiber", "json", "nowide"]
441+
libraries = ["fiber", "json", "nowide", "url"]
438442
if Version(self.version) >= "1.76.0":
439443
libraries.append("math")
440444
if Version(self.version) >= "1.79.0":

recipes/boost/all/dependencies/dependencies-1.81.0.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ configure_options:
2929
- thread
3030
- timer
3131
- type_erasure
32+
- url
3233
- wave
3334
dependencies:
3435
atomic: []
@@ -149,6 +150,8 @@ dependencies:
149150
- prg_exec_monitor
150151
- test
151152
- test_exec_monitor
153+
url:
154+
- system
152155
wave:
153156
- filesystem
154157
- serialization
@@ -250,6 +253,8 @@ libs:
250253
- boost_type_erasure
251254
unit_test_framework:
252255
- boost_unit_test_framework
256+
url:
257+
- boost_url
253258
wave:
254259
- boost_wave
255260
wserialization:

recipes/boost/all/rebuild-dependencies.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
"thread",
5656
"timer",
5757
"type_erasure",
58+
"url",
5859
"wave",
5960
)
6061

recipes/boost/all/test_package/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,14 @@ if(NOT HEADER_ONLY)
116116
target_include_directories(numpy_exe PRIVATE ${PYTHON_INCLUDE_DIRS})
117117
target_link_libraries(numpy_exe PRIVATE Boost::numpy${PYTHON_COMPONENT_SUFFIX} ${PYTHON_LIBRARIES})
118118
endif()
119+
120+
if(WITH_URL)
121+
find_package(Boost COMPONENTS url REQUIRED)
122+
add_executable(url_exe url.cpp)
123+
target_link_libraries(url_exe PRIVATE Boost::url)
124+
set_property(TARGET url_exe PROPERTY CXX_STANDARD 11)
125+
endif()
126+
119127
endif()
120128

121129
# Test header-only target

recipes/boost/all/test_package/conanfile.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ def generate(self):
4646
tc.variables["WITH_STACKTRACE"] = not self.dependencies["boost"].options.without_stacktrace
4747
tc.variables["WITH_STACKTRACE_ADDR2LINE"] = self.deps_user_info["boost"].stacktrace_addr2line_available
4848
tc.variables["WITH_STACKTRACE_BACKTRACE"] = self._boost_option("with_stacktrace_backtrace", False)
49+
tc.variables["WITH_URL"] = not self._boost_option("without_url", True)
4950
if self.dependencies["boost"].options.namespace != 'boost' and not self.dependencies["boost"].options.namespace_alias:
5051
tc.variables['BOOST_NAMESPACE'] = self.dependencies["boost"].options.namespace
5152
tc.generate()
@@ -99,3 +100,5 @@ def test(self):
99100
self.run(os.path.join(bindir, "stacktrace_basic_exe"), env="conanrun")
100101
if self._boost_option("with_stacktrace_backtrace", False):
101102
self.run(os.path.join(bindir, "stacktrace_backtrace_exe"), env="conanrun")
103+
if not self._boost_option("without_url", True):
104+
self.run(os.path.join(bindir, "url_exe"), env="conanrun")
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//
2+
// Copyright (c) 2022 alandefreitas ([email protected])
3+
//
4+
// Distributed under the Boost Software License, Version 1.0.
5+
// https://www.boost.org/LICENSE_1_0.txt
6+
//
7+
8+
#include <boost/url/url.hpp>
9+
#include <cassert>
10+
11+
int main() {
12+
assert(sizeof(boost::urls::url) > 0);
13+
return 0;
14+
}

recipes/boost/all/test_v1_package/conanfile.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def build(self):
3737
cmake.definitions["WITH_STACKTRACE"] = not self.options["boost"].without_stacktrace
3838
cmake.definitions["WITH_STACKTRACE_ADDR2LINE"] = self.deps_user_info["boost"].stacktrace_addr2line_available
3939
cmake.definitions["WITH_STACKTRACE_BACKTRACE"] = self._boost_option("with_stacktrace_backtrace", False)
40+
cmake.definitions["WITH_URL"] = not self._boost_option("without_url", True)
4041
if self.options["boost"].namespace != 'boost' and not self.options["boost"].namespace_alias:
4142
cmake.definitions['BOOST_NAMESPACE'] = self.options["boost"].namespace
4243
cmake.configure()
@@ -87,3 +88,5 @@ def test(self):
8788
self.run(os.path.join("bin", "stacktrace_basic_exe"), run_environment=True)
8889
if self._boost_option("with_stacktrace_backtrace", False):
8990
self.run(os.path.join("bin", "stacktrace_backtrace_exe"), run_environment=True)
91+
if not self._boost_option("without_url", True):
92+
self.run(os.path.join("bin", "url_exe"), run_environment=True)

0 commit comments

Comments
 (0)