-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(#25388) boost v1.86.0: add process library
* Build boost::process::v2 lib for v1.86.0 See changelog: https://www.boost.org/users/history/version_1_86_0.html * Add test for boost::process * Whoops * Debugging * Correctly populate system_libs when without_process=False See boostorg/process@8b3e902#diff-1e7de1ae2d059d21e1dd75d5812d5a34b0222cef273b7c3a2af62eb747f9d20aR60 * Remove assertion in test code * Add defines for boost process * Debugging * Add patch for boost 1.86.0 - fix process dll import Signed-off-by: Uilian Ries <uilianries@gmail.com> * Use BOOST_PROCESS_DYN_LINK instead of private BOOST_PROCESS_SOURCE Signed-off-by: Uilian Ries <uilianries@gmail.com> * Revert "Add patch for boost 1.86.0 - fix process dll import" This reverts commit dc05670. * Disable process on Windows only for 1.86.0 Signed-off-by: Uilian Ries <uilianries@gmail.com> --------- Signed-off-by: Uilian Ries <uilianries@gmail.com> Co-authored-by: Uilian Ries <uilianries@gmail.com>
- Loading branch information
1 parent
6b0eb2c
commit 9ad1e51
Showing
6 changed files
with
85 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,6 +45,7 @@ | |
"math", | ||
"mpi", | ||
"nowide", | ||
"process", | ||
"program_options", | ||
"python", | ||
"random", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// Copyright (c) 2022 Klemens Morgenstern | ||
// | ||
// Distributed under the Boost Software License, Version 1.0. (See accompanying | ||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | ||
|
||
// This comes from the following Boost example: | ||
// https://github.com/boostorg/process/blob/boost-1.86.0/example/v2/intro.cpp | ||
|
||
// clang-format: off | ||
#include <boost/asio/read.hpp> | ||
#include <boost/asio/readable_pipe.hpp> | ||
// clang-format: on | ||
|
||
#include <boost/process/v2.hpp> | ||
#include <boost/system/error_code.hpp> | ||
|
||
#include <string> | ||
#include <iostream> | ||
|
||
#if defined(BOOST_NAMESPACE) | ||
namespace boost = BOOST_NAMESPACE; | ||
#endif | ||
|
||
namespace proc = boost::process::v2; | ||
namespace asio = boost::asio; | ||
|
||
int main() | ||
{ | ||
asio::io_context ctx; | ||
asio::readable_pipe p{ctx}; | ||
|
||
const auto exe = proc::environment::find_executable("cmake"); | ||
|
||
proc::process c{ctx, exe, {"--version"}, proc::process_stdio{nullptr, p}}; | ||
|
||
std::string line; | ||
boost::system::error_code ec; | ||
|
||
auto sz = asio::read(p, asio::dynamic_buffer(line), ec); | ||
|
||
std::cout << "CMake version: '" << line << "'" << std::endl; | ||
|
||
c.wait(); | ||
} |