Commit Graph

51 Commits (a0d66415ef1c5e3f939f973e1f95d2cbc076c8d5)

Author SHA1 Message Date
Matthias Schoepfer d05c507c04 Uses GenerateExportHeaders from cmake to export only symbols needed externally
This should only affect the library part, and to be more specific, the shared
library part. Cmake allows to generate a special header file through
GenerateExportHeader()[1]. This defines - amongst other - a SPDLOG_EXPORT
Symbol, that does the right thing, depending on compiler / OS. On Windows,
default is, if I recall correctly, that all symbols are not exported while
Linux does it the other way around. So this patch sets default to *not* export
symbols except those marked SPDLOG_EXPORT. Behaviour with Windows and Linux
should be the same. Also, I removed SPDLOG_BUILD_SHARED in favour of the
standard BUILD_SHARED_LIBS, which is a global symbol. This *might* give some
issues when used as add_subdirectory(), but I am not sure.
Also I made Threads::Threads private, so a depending cmake package does not
need to have find_package(Threads) on.

Why all that? On x86_64, gcc 8.3.0 .so code size reduction is:
811320 bytes original vs. 532536 now (~65% of the original). And, I *guess*,
this will resolve the issue that it is not possible to use shared libs
with windows. But I cannot test it, I only have Linux.

[1] https://cmake.org/cmake/help/latest/module/GenerateExportHeader.html

Signed-off-by: Matthias Schoepfer <matthias.schoepfer@ithinx.io>
6 years ago
gabime 21f7f78130 Update tests CMakeLists.txt 6 years ago
gabime 10116b7717 Removed SPDLOG_NO_DATETIME option 6 years ago
gabime 18edb8bd63 Added tweakme options to CMakeLists.txt 6 years ago
gabime 2b8afb38b7 Revert pull #1288 6 years ago
David Yip 288ea11534 Use _FILE_OFFSET_BITS=64 when building tests on Linux 32-bit systems
When cross-compiling spdlog from x86-64 to armhf, I ran spdlog-utests
via qemu-arm and noticed that the "daily_logger rotate" test was failing
because count_files always returned zero.

Investigation of count_files revealed that readdir was returning nullptr
immediately and setting errno to 75, i.e. "value too large for defined
data type".  I suspected this had something to do with some 64 vs.
32-bit thing, so I added _FILE_OFFSET_BITS=64 to the build and that
seems to have made readdir happy.

It might be safe to add _FILE_OFFSET_BITS=64 for all Linux builds, but
it only seems to be necessary for the 32-bit case (which is a pretty
small audience these days -- I'm only building for armhf to target a
Raspberry Pi 3 running Raspbian, which runs in 32-bit mode).
6 years ago
gabime 4a620a2c5e Merge branch 'Issue-1248' into v1.x 6 years ago
Andrei-Florin BENCSIK 2cc620ef33 Function instead of macro
Be more consistent with the existing code and with the naming
_function -> function
6 years ago
Andrei-Florin BENCSIK cee705ccd3 Minor cmake code duplication improvement
Create a macro to add tests for both static/header only.

The only differneces between these two are the libraries they link
with and the target names. Created the simple macro:

_spdlog_prepare_test(<target> <spdlog_lib>)

which does the work.

Signed-off-by: Andrei-Florin BENCSIK <andrei.bencsik@gmail.com>
6 years ago
gabime 9b7812a0f2 auto create log dir 6 years ago
gabime 494cc8bace Implemented daily sink rotation #661 6 years ago
gabime 5c1e44a93d Added bactrace tests 6 years ago
gabime 0335e3fcc0 Print error and abort instead of throw if SPDLOG_NO_EXEPTIONS is defined 6 years ago
gabime b3ddef2fc2 Minor cmake fix in for tests 6 years ago
Gabi Melman 7a686d4d21
Update CMakeLists.txt 6 years ago
gabime bb0f3839c1 Updated CMake options and defaults 6 years ago
gabime 9aa6cdc494 Updated systemd sink and tests 6 years ago
Gabi Melman dc054c3f8a
Merge branch 'v1.x' into v1.x 6 years ago
Jorge Bellon-Castro a13981ffe4 Provide source location support for systemd_sink.h 6 years ago
gabime 98e151fda7 Added tests for dup_filter sink 6 years ago
gabime 08de642536 Added stdout tests 6 years ago
gabime cf64f2baca Fixed CMake address sanitizer 6 years ago
gabime 68a0193d95 CMake refactoring to functions 6 years ago
gabime 76fc166e11 CMakeLists.txt minor improvments 6 years ago
gabime fc53e3339f CMakeLists.txt minor improvments 6 years ago
gabime 30bd80bd85 CMake improvements 6 years ago
David Zemon dd2f293f33 Clean up CMake a bit more 6 years ago
David Zemon 6fe899af10 Set Threads::Threads dependency on spdlog libs - don't make user do it 6 years ago
David Zemon 55e7844ca0 Remove the namespaced
Namespaces are good for avoiding collisions, but since the
non-namespaced targets still exist, it does no good to add the
namespaced targets on top.
6 years ago
David Zemon 8dd85285e7 Allow user to choose between static or shared library 6 years ago
gabime 872ea6bf09 Deleted redundant Make files and solutions 6 years ago
gabime 3fa76b2d8f Renamed test filename 7 years ago
gabime 52e2722412 Renamed test filenames 7 years ago
gabime f2f9f324ec Updated default API impl and tests 7 years ago
gabime dace099348 Added fmt_helper tests 7 years ago
Daniel Chabrowski fb37585bc1 Little cmake and tests refactor
Change from spdlog_ex to const spdlog_ex& got rid of the GCC8 warning.
7 years ago
gabime 057bf1b92d Added some mpmc_q tests 7 years ago
Daniel Chabrowski 7e32ccbd8f Modify travis-ci, fix issues
Added:
* Release/Debug job for gcc 7 and clang 3.5
* Debug asan gcc 7 job
* Debug tsan gcc 7 job
* Disabled extensions
* Added a spdlog::spdlog alias for tests

Removed:
* Valgrind workaround, the current version is 3.10.1
* install_libcxx
* Makefiles

Fixed:
* examples build
* multisink build

Workarounds:
* gcc7 with tsan and asan needs gold linker, otherwise build
  fails becase of unrecognized option '--push-state'
7 years ago
gabime b9d7c45e40 Use blocking queue 7 years ago
gabime a8b5bb894e fixed cmake for tests 8 years ago
Gabi Melman 851b49e147
Update CMakeLists.txt 8 years ago
Daniel Chabrowski 646a140ed4 Specify CXX language explicitly in CMake
Marking project as CXX will disable detecting C compiler and other checks.
Removed 'INCLUDES DESTINATION' as it made the include path appear doubled.
8 years ago
yisonPylkita 38ccd51399 Modern CMake in /tests 8 years ago
Alexander Zilberkant 0f25b25b20 add async_logger tests
cover discarded messages use-case
8 years ago
gabime 7885aa478c no streams 9 years ago
gabime 8d1570b84a fixed tests cmake thread flag 9 years ago
gabime 3a44818b2a fixed pr #228 to include pthread and removed header_dependecies test 9 years ago
Kevin M. Godby 24e7b64b89 Added header-dependency tests. 9 years ago
Gabi Melman 6d5bce46f8 Revert "CMake script improvements" 9 years ago
Kevin M. Godby 2907001e22 Fixed Catch tests. 9 years ago