diff options
| author | Garrett D'Amore <garrett@damore.org> | 2018-05-24 14:59:39 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2018-05-25 08:11:26 -0700 |
| commit | 301de3ac5c7cf8a5eaaf3c58157251db781841d6 (patch) | |
| tree | d0a19062d01de0df130a59613134330809b2a5ae /demo/reqrep | |
| parent | b36dadf267842fb2fad7596f90f8f0cd78ac4af5 (diff) | |
| download | nng-301de3ac5c7cf8a5eaaf3c58157251db781841d6.tar.gz nng-301de3ac5c7cf8a5eaaf3c58157251db781841d6.tar.bz2 nng-301de3ac5c7cf8a5eaaf3c58157251db781841d6.zip | |
fixes #486 Revisit SOVERSION and VERSION
fixes #485 Honor BUILD_SHARED_LIBS
fixes #483 Don't expose private symbols in shared library
fixes #481 Export CMake target
This is a "large" commit involving changes that don't affect the
code directly, but which have an impact on how we package and build
our project.
The most significant of these changes is that we now build only
either a shared or a static library, depending on the setting of
the BUILD_SHARED_LIBS option. We also suppress private symbols
from being exposed when the underlying toolchain lets us do so.
Minor updates to the way we version the ABI are used, and we now
have a nice exported CMake project.
To import this project in another, simply do find_package(nng)
and you can add target_link_libraries(nng::nng) to your targets.
CMake does the rest for you.
Diffstat (limited to 'demo/reqrep')
| -rw-r--r-- | demo/reqrep/CMakeLists.txt | 17 | ||||
| -rw-r--r-- | demo/reqrep/README.adoc | 15 |
2 files changed, 30 insertions, 2 deletions
diff --git a/demo/reqrep/CMakeLists.txt b/demo/reqrep/CMakeLists.txt new file mode 100644 index 00000000..d6982446 --- /dev/null +++ b/demo/reqrep/CMakeLists.txt @@ -0,0 +1,17 @@ +# +# Copyright 2018 Capitar IT Group BV <info@capitar.com> +# Copyright 2018 Staysail Systems, Inc. <info@staysail.tech> +# +# This software is supplied under the terms of the MIT License, a +# copy of which should be located in the distribution where this +# file was obtained (LICENSE.txt). A copy of the license may also be +# found online at https://opensource.org/licenses/MIT. + +cmake_minimum_required (VERSION 2.8.7) + +project(reqrep) + +find_package(nng CONFIG REQUIRED) + +add_executable(reqrep reqrep.c) +target_link_libraries(reqrep nng::nng) diff --git a/demo/reqrep/README.adoc b/demo/reqrep/README.adoc index b66d694c..5bc3d043 100644 --- a/demo/reqrep/README.adoc +++ b/demo/reqrep/README.adoc @@ -19,8 +19,19 @@ compiled on 64-bit systems.) == Compiling -The following is an example typical of UNIX and similar systems like -Linux and macOS: +CMake with ninja-build is simplest: + +[source, bash] +---- +% mkdir build +% cd build +% cmake -G Ninja .. +% ninja +---- + +Or if you prefer a traditional approach, +the following is an example typical of UNIX and similar systems like +Linux and macOS may appeal: [source, bash] ---- |
