Commit Graph

10 Commits

Author SHA1 Message Date
Peter Wu bd253e1bdd cmake: fix Windows build with CUnit
failmalloc and main tests succesfully pass the test now.
2016-03-17 23:32:07 +01:00
Peter Wu d10f149161 cmake: fix Windows support
Fix Windows build by defining `ssize_t` when missing and adjusting the
install commands.

Add support for ENABLE_WERROR=1 while at it.

Tested with MSVC 2013 on Windows 7 x64.
2016-03-16 17:33:20 +01:00
Peter Wu 2ddb83206b cmake: sync with v1.8.0-63-g37b09f6
Adds missing source files and configure.ac changes since
v1.7.0-93-g093eb51.
2016-03-14 17:20:37 +01:00
Peter Wu 7f8110601e cmake: fix compatibility with cmake before 3.3
The COMPILE_LANGUAGE generator expression is only supported since CMake
3.3. Moreover, it does not work with all generators (works with Makefile
and Ninja, but not with Visual Studio).

target_compile_options would only work if a target does not mix C and
C++ sources, since the flags are intended to be set for a specific
language, use set_source_files_properties instead. This approach is also
less repetitive.

Drop the idea of using lists and COMPILE_OPTIONS,
set_source_files_properties only understands COMPILE_FLAGS (a single
string, not a list).
2016-03-13 12:30:41 +01:00
Peter Wu 77e8190b6c cmake: fix symbol visibility issues
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.
2016-02-16 16:04:01 +01:00
Peter Wu 0afc21c9d8 cmake: fix compilation in lib
Need to add -fPIC to objects that will be put in a shared library.
2016-02-15 10:49:55 +01:00
Peter Wu 8c46d9181f cmake: process tests directory
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
2016-02-15 01:57:13 +01:00
Peter Wu ccd2d34160 cmake: Install headers 2016-02-13 20:13:42 +01:00
Peter Wu ea6eed10c7 cmake: fix version in soname 2016-02-13 20:13:42 +01:00
Peter Wu 5b21c39bb2 cmake: add lib, add versioning info, install lib
Also remove some headers which were not checked anyway and add macros to
cmakeconfig.h.in (based on the headers list in the CMakeLists.txt file).
2016-02-13 20:13:42 +01:00