Skip to content

Commit 37319db

Browse files
sanblchjcar87
authored andcommitted
(conan-io#15011) boost: add Boost.URL
boost: bump b2 to 4.9.3 Update recipes/boost/all/test_package/CMakeLists.txt Co-authored-by: Luis Caro Campos <[email protected]> Co-authored-by: Luis Caro Campos <[email protected]>
1 parent fded903 commit 37319db

File tree

7 files changed

+37
-3
lines changed

7 files changed

+37
-3
lines changed

recipes/boost/all/conanfile.py

Lines changed: 6 additions & 2 deletions
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

@@ -271,17 +272,20 @@ def config_options(self):
271272
self.options.without_fiber = True
272273
self.options.without_nowide = True
273274
self.options.without_json = True
275+
self.options.without_url = True
274276
else:
275277
version_cxx11_standard_json = self._min_compiler_version_default_cxx11
276278
if version_cxx11_standard_json:
277279
if Version(self.settings.compiler.version) < version_cxx11_standard_json:
278280
self.options.without_fiber = True
279281
self.options.without_json = True
280282
self.options.without_nowide = True
283+
self.options.without_url = True
281284
else:
282285
self.options.without_fiber = True
283286
self.options.without_json = True
284287
self.options.without_nowide = True
288+
self.options.without_url = True
285289

286290
# iconv is off by default on Windows and Solaris
287291
if self._is_windows_platform or self.settings.os == "SunOS":
@@ -430,7 +434,7 @@ def layout(self):
430434

431435
@property
432436
def _cxx11_boost_libraries(self):
433-
libraries = ["fiber", "json", "nowide"]
437+
libraries = ["fiber", "json", "nowide", "url"]
434438
if Version(self.version) >= "1.76.0":
435439
libraries.append("math")
436440
if Version(self.version) >= "1.79.0":
@@ -557,7 +561,7 @@ def package_id(self):
557561

558562
def build_requirements(self):
559563
if not self.options.header_only:
560-
self.tool_requires("b2/4.9.2")
564+
self.tool_requires("b2/4.9.3")
561565

562566
def source(self):
563567
get(self, **self.conan_data["sources"][self.version],

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: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,15 @@ if(NOT HEADER_ONLY)
134134
add_test(NAME boost_numpy COMMAND numpy_exe)
135135
set_property(TEST boost_numpy PROPERTY ENVIRONMENT "PYTHONPATH=${Python_SITELIB}")
136136
endif()
137+
138+
if(WITH_URL)
139+
find_package(Boost COMPONENTS url REQUIRED)
140+
add_executable(url_exe url.cpp)
141+
target_link_libraries(url_exe PRIVATE Boost::url)
142+
set_property(TARGET url_exe PROPERTY CXX_STANDARD 11)
143+
add_test(NAME boost_url COMMAND url_exe)
144+
endif()
145+
137146
endif()
138147

139148
# Test header-only target

recipes/boost/all/test_package/conanfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ def generate(self):
4545
tc.cache_variables["WITH_STACKTRACE"] = not self.dependencies["boost"].options.without_stacktrace
4646
tc.cache_variables["WITH_STACKTRACE_ADDR2LINE"] = self.dependencies["boost"].conf_info.get("user.boost:stacktrace_addr2line_available")
4747
tc.cache_variables["WITH_STACKTRACE_BACKTRACE"] = self._boost_option("with_stacktrace_backtrace", False)
48+
tc.cache_variables["WITH_URL"] = not self._boost_option("without_url", True)
4849
if self.dependencies["boost"].options.namespace != 'boost' and not self.dependencies["boost"].options.namespace_alias:
4950
tc.cache_variables['BOOST_NAMESPACE'] = self.dependencies["boost"].options.namespace
5051
tc.generate()
@@ -59,4 +60,3 @@ def test(self):
5960
return
6061
with chdir(self, self.folders.build_folder):
6162
self.run(f"ctest --output-on-failure -C {self.settings.build_type}", env="conanrun")
62-
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: 1 addition & 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()

0 commit comments

Comments
 (0)