Update build2 project
This commit is contained in:
parent
dc5c11844f
commit
88c36ce773
1
LICENSE_1_0.txt
Symbolic link
1
LICENSE_1_0.txt
Symbolic link
@ -0,0 +1 @@
|
||||
upstream/asio/LICENSE_1_0.txt
|
39
PACKAGE-README.md
Normal file
39
PACKAGE-README.md
Normal file
@ -0,0 +1,39 @@
|
||||
# libasio
|
||||
|
||||
Asio is a cross-platform C++ library for network and low-level I/O programming
|
||||
that provides developers with a consistent asynchronous model using a modern
|
||||
C++ approach.
|
||||
|
||||
Asio provides the basic building blocks for C++ networking, concurrency and
|
||||
other kinds of I/O. Asio is used in all kinds of applications, from phone apps
|
||||
to the world’s fastest share markets.
|
||||
|
||||
For more information see: https://think-async.com/Asio/
|
||||
|
||||
This is a `build2` package for the standalone version of the Asio library.
|
||||
|
||||
# Usage
|
||||
|
||||
This package provides the `lib{asio}` library.
|
||||
|
||||
SSL support is disabled by default. To enable it, add the following to your
|
||||
`manifest`:
|
||||
|
||||
```
|
||||
depends:
|
||||
\
|
||||
libasio ^1.28.0
|
||||
{
|
||||
require
|
||||
{
|
||||
config.libasio.ssl = true
|
||||
}
|
||||
}
|
||||
\
|
||||
```
|
||||
|
||||
Note that on some platforms (such as MinGW) it may be necessary for
|
||||
applications to define `_WIN32_WINNT` to an appropriate value. If it's not
|
||||
defined the library's `config.hpp` header will issue a warning and choose a
|
||||
default (currently `0x0601`, meaning Windows 7 and later; this is also the
|
||||
value that the library is built with).
|
@ -6,10 +6,9 @@ cxx.std = latest
|
||||
|
||||
using cxx
|
||||
|
||||
hxx{*}: extension = hxx
|
||||
ixx{*}: extension = ixx
|
||||
txx{*}: extension = txx
|
||||
cxx{*}: extension = cxx
|
||||
hxx{*}: extension = hpp
|
||||
ixx{*}: extension = ipp
|
||||
cxx{*}: extension = cpp
|
||||
|
||||
# Assume headers are importable unless stated otherwise.
|
||||
#
|
||||
@ -18,3 +17,7 @@ hxx{*}: cxx.importable = true
|
||||
# The test target for cross-testing (running tests under Wine, etc).
|
||||
#
|
||||
test.target = $cxx.target
|
||||
|
||||
# If true, enable SSL support.
|
||||
#
|
||||
config [bool] config.libasio.ssl ?= false
|
||||
|
@ -1,4 +1,5 @@
|
||||
./: {*/ -build/} doc{README.md} manifest
|
||||
./: {*/ -build/ -upstream/} doc{README PACKAGE-README.md} \
|
||||
legal{LICENSE_1_0.txt COPYING} manifest
|
||||
|
||||
# Don't install tests.
|
||||
#
|
||||
|
@ -1,15 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <iosfwd>
|
||||
#include <string>
|
||||
|
||||
#include <asio/export.hxx>
|
||||
|
||||
namespace asio
|
||||
{
|
||||
// Print a greeting for the specified name into the specified
|
||||
// stream. Throw std::invalid_argument if the name is empty.
|
||||
//
|
||||
ASIO_SYMEXPORT void
|
||||
say_hello (std::ostream&, const std::string& name);
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
pub_hdrs = {hxx ixx txx}{**}
|
||||
|
||||
./: $pub_hdrs
|
||||
|
||||
hxx{export}@./: cxx.importable = false
|
||||
|
||||
# Install into the asio/ subdirectory of, say, /usr/include/
|
||||
# recreating subdirectories.
|
||||
#
|
||||
{hxx ixx txx}{*}:
|
||||
{
|
||||
install = include/asio/
|
||||
install.subdirs = true
|
||||
}
|
@ -1,39 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
// Normally we don't export class templates (but do complete specializations),
|
||||
// inline functions, and classes with only inline member functions. Exporting
|
||||
// classes that inherit from non-exported/imported bases (e.g., std::string)
|
||||
// will end up badly. The only known workarounds are to not inherit or to not
|
||||
// export. Also, MinGW GCC doesn't like seeing non-exported functions being
|
||||
// used before their inline definition. The workaround is to reorder code. In
|
||||
// the end it's all trial and error.
|
||||
|
||||
#if defined(ASIO_STATIC) // Using static.
|
||||
# define ASIO_SYMEXPORT
|
||||
#elif defined(ASIO_STATIC_BUILD) // Building static.
|
||||
# define ASIO_SYMEXPORT
|
||||
#elif defined(ASIO_SHARED) // Using shared.
|
||||
# ifdef _WIN32
|
||||
# define ASIO_SYMEXPORT __declspec(dllimport)
|
||||
# else
|
||||
# define ASIO_SYMEXPORT
|
||||
# endif
|
||||
#elif defined(ASIO_SHARED_BUILD) // Building shared.
|
||||
# ifdef _WIN32
|
||||
# define ASIO_SYMEXPORT __declspec(dllexport)
|
||||
# else
|
||||
# define ASIO_SYMEXPORT
|
||||
# endif
|
||||
#else
|
||||
// If none of the above macros are defined, then we assume we are being used
|
||||
// by some third-party build system that cannot/doesn't signal the library
|
||||
// type. Note that this fallback works for both static and shared libraries
|
||||
// provided the library only exports functions (in other words, no global
|
||||
// exported data) and for the shared case the result will be sub-optimal
|
||||
// compared to having dllimport. If, however, your library does export data,
|
||||
// then you will probably want to replace the fallback with the (commented
|
||||
// out) error since it won't work for the shared case.
|
||||
//
|
||||
# define ASIO_SYMEXPORT // Using static or shared.
|
||||
//# error define ASIO_STATIC or ASIO_SHARED preprocessor macro to signal libasio library type being linked
|
||||
#endif
|
11
include/buildfile
Normal file
11
include/buildfile
Normal file
@ -0,0 +1,11 @@
|
||||
pub_hdrs = {hxx ixx}{**}
|
||||
|
||||
./: $pub_hdrs
|
||||
|
||||
# Install into, say, /usr/include/, recreating subdirectories.
|
||||
#
|
||||
{hxx ixx}{*}:
|
||||
{
|
||||
install = include/
|
||||
install.subdirs = true
|
||||
}
|
23
manifest
23
manifest
@ -1,13 +1,20 @@
|
||||
: 1
|
||||
name: libasio
|
||||
version: 0.1.0-a.0.z
|
||||
version: 1.28.0-a.0.z
|
||||
language: c++
|
||||
summary: asio C++ library
|
||||
license: other: proprietary ; Not free/open source.
|
||||
description-file: README.md
|
||||
url: https://example.org/libasio
|
||||
email: francois@codesynthesis.com
|
||||
#build-error-email: francois@codesynthesis.com
|
||||
summary: Cross-platform C++ library for asynchronous network programming
|
||||
license: BSL-1.0 ; Boost Software License 1.0.
|
||||
description-file: README
|
||||
package-description-file: PACKAGE-README.md
|
||||
url: https://think-async.com/Asio/
|
||||
src-url: https://github.com/chriskohlhoff/asio/
|
||||
package-url: https://github.com/build2-packaging/libasio/
|
||||
email: https://sourceforge.net/p/asio/mailman/asio-users/ ; Mailing list.
|
||||
package-email: packaging@build2.org ; Mailing list.
|
||||
build-error-email: builds@build2.org
|
||||
depends: * build2 >= 0.16.0
|
||||
depends: * bpkg >= 0.16.0
|
||||
#depends: libhello ^1.0.0
|
||||
depends: libssl >= 1.1.1 ? ($config.libasio.ssl)
|
||||
depends: libcrypto >= 1.1.1 ? ($config.libasio.ssl)
|
||||
|
||||
ssl-build-config: config.libasio.ssl=true ; Enable SSL support.
|
||||
|
@ -1,11 +1,7 @@
|
||||
: 1
|
||||
summary: libasio project repository
|
||||
|
||||
#:
|
||||
#role: prerequisite
|
||||
#location: https://pkg.cppget.org/1/stable
|
||||
#trust: ...
|
||||
|
||||
#:
|
||||
#role: prerequisite
|
||||
#location: https://git.build2.org/hello/libhello.git
|
||||
:
|
||||
role: prerequisite
|
||||
location: https://pkg.cppget.org/1/stable
|
||||
trust: 70:64:FE:E4:E0:F3:60:F1:B4:51:E1:FA:12:5C:E0:B3:DB:DF:96:33:39:B9:2E:E5:C2:68:63:4C:A6:47:39:43
|
||||
|
17
src/asio.cxx
17
src/asio.cxx
@ -1,17 +0,0 @@
|
||||
#include <asio/asio.hxx>
|
||||
|
||||
#include <ostream>
|
||||
#include <stdexcept>
|
||||
|
||||
using namespace std;
|
||||
|
||||
namespace asio
|
||||
{
|
||||
void say_hello (ostream& o, const string& n)
|
||||
{
|
||||
if (n.empty ())
|
||||
throw invalid_argument ("empty name");
|
||||
|
||||
o << "Hello, " << n << '!' << endl;
|
||||
}
|
||||
}
|
@ -1,3 +1,3 @@
|
||||
import libs = libasio%lib{asio}
|
||||
|
||||
exe{driver}: {hxx ixx txx cxx}{**} $libs testscript{**}
|
||||
exe{driver}: cxx{driver} $libs
|
||||
|
7
tests/basics/driver.cpp
Normal file
7
tests/basics/driver.cpp
Normal file
@ -0,0 +1,7 @@
|
||||
#include <asio.hpp>
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
return 0;
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
|
||||
#include <asio/asio.hxx>
|
||||
|
||||
#undef NDEBUG
|
||||
#include <cassert>
|
||||
|
||||
int main ()
|
||||
{
|
||||
using namespace std;
|
||||
using namespace asio;
|
||||
|
||||
// Basics.
|
||||
//
|
||||
{
|
||||
ostringstream o;
|
||||
say_hello (o, "World");
|
||||
assert (o.str () == "Hello, World!\n");
|
||||
}
|
||||
|
||||
// Empty name.
|
||||
//
|
||||
try
|
||||
{
|
||||
ostringstream o;
|
||||
say_hello (o, "");
|
||||
assert (false);
|
||||
}
|
||||
catch (const invalid_argument& e)
|
||||
{
|
||||
assert (e.what () == string ("empty name"));
|
||||
}
|
||||
}
|
@ -2,10 +2,10 @@ cxx.std = latest
|
||||
|
||||
using cxx
|
||||
|
||||
hxx{*}: extension = hxx
|
||||
ixx{*}: extension = ixx
|
||||
txx{*}: extension = txx
|
||||
cxx{*}: extension = cxx
|
||||
hxx{*}: extension = hpp
|
||||
ixx{*}: extension = ipp
|
||||
txx{*}: extension = tpp
|
||||
cxx{*}: extension = cpp
|
||||
|
||||
# Assume headers are importable unless stated otherwise.
|
||||
#
|
||||
|
Loading…
Reference in New Issue
Block a user