libnghttp2.so was missing -fvisibility=hidden. libnghttp2_asio.so on the
other hand had hidden visibility which resulted in no exported symbols
and a broken asio client examples.
Just build a static nghttp2 library to solve this issue.
Some detected libraries were not reported when a feature is disabled.
This change removes unnecessary second find_package calls and sets
HAVE_xxx immediately based on xxx_FOUND.
mruby is always invoked now (mirrors the autotools behavior). It could
be optimized though to only trigger the mruby build when the static
library is missing.
Also fix typo in NGHTTP2_TESTS_DIR macro definition (detected when
invoking the Ninja generator).
Since v0.6.2-7-g1d138ac ("Unify DATA and other frames in
nghttp2_outbound_item and save malloc()"), the macros are unused and the
builds fails on -Werror=unused-macros.
Split the nghttp2 library into objects and a shared library from those
objects. This is needed because of symbol visibility. An advantage over
the autotools build is that there are no worries about static versus
static library builds.
Test:
cmake $srcdir
make nghttpx-unittest main failmalloc
make test
Add auto-detection to the most important features (app, hpack, etc.).
Move options to a separate file for easier search.
Add cmake-based Libevent, jansson and CUnit search. Move pkg-config
handling for Libev and jemalloc to their cmake files.
Note: duplicates find_package before including CMakeOptions.txt and when
checking for features. Maybe that can be cleaned up later...
Remove build/host/target by a single target system name (CMake is
different for cross-compiling, you are suggested to set
CMAKE_TOOLCHAIN_FILE).
Fix various library variables, remove CFLAGS (INCLUDE_DIRS could be used
instead though, but I consider that minor information that could be
added later if wanted).
Fix various variable names (prefix, boost, etc.).