Commit Graph

45 Commits

Author SHA1 Message Date
Sean -Kjell- Hedström
63f3272703
clarify c++ version support (#502) 2023-11-12 14:42:52 -07:00
Kjell Hedström : Engineering Leadership
95291b5190
fix version (#404) 2021-04-08 21:44:33 -06:00
Shachar Shemesh
c769b76715
Make SONAME less volatile (#402) 2021-04-08 21:29:40 -06:00
Alvin
c0ae589024
Alvin/minor fixes and improvements (#389)
* Fix typos
* Fix build for MinGW
- MinGW g++ doesn't recoganize `-rdynamic`
2020-11-17 20:40:26 -07:00
Kjell Hedström : Available for new Engineering Leadership and Engineering Opportunities
69a0be4c9c
play/tryout: It is confusing to name the target g3logger. KISS --> g3log (#372)
* It is confusing to name the target g3logger. KISS --> g3log. This MIGHT break installations for some but it's a needed correction. 

* Updated version number to 2.1.x
2020-07-08 22:42:55 -06:00
Murat Kilivan
68f3b174d9
Use CMake to download GoogleTest as part of build (#355)
Having GoogleTest source in the project means we are likely using a stale version of test. This change is to use CMake to download GoogleTest as part of the build's configuration step.
2020-06-03 15:37:46 -06:00
myd7349
376c417ad1 Improve CMake module file (#312)
* Improve CMake module file
* Fix packaging on Win32
* appveyor: Test install and package target
* Travis-CI: Test install and package target
* Update documentation for working with CMake
* Simplify g3loggerConfig.cmake
* Add Doc Prerequisites section
2019-05-13 22:42:15 -06:00
Benjamin Beichler
e8a07f25b5 Fix several CMake Issues (#294)
* Restructure Build.cmake to use "modern" Cmake

Since it is deprecated to modify the global compiler flags and similar options, the Build.cmake is converted to use only per target operations.

Additionally, the checks for backtrace and Pthread lib is converted to use the in cmake included functions. Also the check for the cxa_demangle function should be more robust now.

* fixed option for performance test

* use CMAKE_CURRENT_SOURCE_DIR in git cmd-lines to get current version, for better integration as cmake subdirectory

* bump required cmake version to 3.2 and use target_compile_feature to fix OSX compiler recognition and c++14 compiler flags
2019-02-18 12:43:04 -07:00
Aleksey Dobrunov
502bf318a4 add option G3_SHARED_RUNTIME (#292) 2019-01-15 12:25:51 -07:00
Kjell Hedström
de870694d5
Revert "add /MT for MSVC static lib (#278)" (#279)
This reverts commit ab76fc32c0.
2018-07-15 14:01:56 -06:00
AlexP11223
ab76fc32c0 add /MT for MSVC static lib (#278) 2018-07-14 08:59:36 -06:00
Max Savenkov
5ffb360e2f export generated defines directory so that the library can be used via add_subdirectory from another CMake-based project (#268) 2018-06-12 14:59:15 -06:00
Петр Шургалин
a2ed65600b CMake: fix CMake version check on windows (#240)
CMake was telling that my version 3.10.1 is lesser thar 3.4
2017-12-20 10:32:36 -07:00
Andreas Schönle
82df2168aa CMake messages changed to message( STATUS "..." ) (#190) 2017-05-17 14:31:19 -06:00
Andreas Schönle
ac37076327 Cross-compiling: Version readout fixed (#189)
* Cross-comoiling: Version readout fixed
Test.cmake: Path handling consistent

* ".x" syntax in variable checking removed

* Use G3LOG_DEBUG also in linux-specific code

* Fixed error when linux and shared library is on

* Fixed linux/windows shared lib handling: FATAL_ERROR for wrong cmake
version and no message in linux
2017-05-17 14:24:11 -06:00
Andreas Schönle
123977f106 unit tests running with windows shared dll (#178)
* unit tests running with windows shared dll

* CMake automatically uses DLL runtime - remove cmake entries modifying
compiler flags

* missing DBUG vs DEBUG issue in Linux

* generated header added

* correction in CMake: Set HEADER_FILES correctly

* added static library option

* switched to powershell and included WORKING_DIRECTORY

* powershell use in windows and WORKING_DIRECTORY instead of cd

* Fixed appveyor.yml to use Release configuration and run unit tests

* trying to make appveyor work again ...

* make sure ERRORLEVEL is 0 when unit tests run successfully

* Still trying to fix appveyor ...

* Defaulting to shared library in linux, too

* Removed runtime loading test when g3log is not a shared library in linux

* Run unit tests verbosly using ctest.exe

* Disabled AggressiveThreadCallsDuringShutdown test

* Revert "Run unit tests verbosly using ctest.exe" (accidental commit)

This reverts commit b30513450d.

* re-committing valid parts of reverted commit

* DBUG vs DEBUG fix moved to generated_definitions.hpp

* cleanup shared/static option

* clarify cmake build types regardless of type

* Added compile test for DEBUG and DBUG

* put back formatting

* Removed commented out /MD switches for MSVC
2017-05-09 10:26:48 -06:00
Kjell Hedström
eba984171a Correcting define checks (#164)
* IF (NOT DEFINED  does NOT work on some CMake versions. This is a work-around

* removed log output
2017-04-01 10:39:34 -06:00
Kjell Hedström
33ed100f91 Colorer build and loglevel improvements (#161)
* static build with MS libs; remove vc11 support from cmake
* support AMD processor on winXp
* mingw build
* support older versions
* removed cmake warnings

* fix cmake >= 3.1 warnings (CMP0054)
* add target_include_directories - in projects that depend on g3log, do not need to specify include_directories
* Improved CPackage installation
* cleanup of build and test scripts
* c++14 gives for cleaner syntax
* build cleanup libg3logger.so will be a link to the actual libg3logger.so.<major><minor><build>. Only shared libraries from now on



* disableAll for log levels
* new setLogLevel impl
* cleaned up levels, now it should be easy for the user to understand how to add custom levels
2017-03-30 22:52:09 -06:00
Aleksey Dobrunov
a48a4860fd fix mingw build (#152) 2017-02-19 10:50:58 -07:00
baic
411b8e249c force /utf-8 for MSVC compiler 2017-02-13 16:25:30 +08:00
Kjell Hedström
6cdefee897 Inherit C++ flags from build environment
As suggested in : http://stackoverflow.com/questions/36765217/how-to-create-cmake-recipes-in-yocto
2016-12-14 21:36:52 -07:00
Kjell Hedström
86473c60e0 Gimesketvirtadien's time requested changes (#104)
* Added "removeSink" method and related functionality to LogWorker API

* Added a new API for plugging in custom Timestamp generator.

* Revert "Added "removeSink" method and related functionality to LogWorker API"

This reverts commit c9cee5d9a0.

* Dropping shared_ptr<Timestamp> in log messages and using regular vars

* Moving to standard timespec struct from custom Timestamp

* Wiring timespec timestamps with formating routine

* Falling back to clock_gettime

* Reverting g3 API changes

* Optimizing format string generation

* Removed _microseconds from LogMessage

* Implemented sec fractional format key

* Optimization of format string generation

* Adjusting comments

* Refining localtime_formatted by introducing two helper functions

* refactored and simplified code

* fixed up some commented away unit tests

* refactoring message specifics tests to it's own test

* Use gcc 4.9

* C++14 for Linux

* Update .travis.yml

* Update buildAndRunTests.sh

* lower case in `-std=c++14`

* -lrt flag for gcc

* Added support for high precision clock on Linux/gcc (already there now for OSX). Windows is still missing

* intermediate comments

* Clarified for some code readers the mysterious use of assert in an expression that is always true

* refactored + renamed functions and constants. Added unit test for retrieving fractional type

* committing changes previously fixed - finished unit testing for g3::internal::time::GetFractional(..)

* added unit test for fractional to string

* added missing unit tests for localtime_formatted

* fixed? nano / microsec functionality to timer

* test
2016-08-11 00:27:52 -06:00
Nitaym
56b3f20517 Fixed a bug causing cross-compilers to fail (#101)
(The edited line eliminated the original CXXFLAGS variable, removing the sysroots parameter, which is needed for cross compiling)
2016-06-22 14:29:45 -04:00
Kjell Hedström
db23383aea Merge pull request #83 from KjellKod/duedal-install-target
Duedal install target
2016-03-06 23:04:00 -07:00
Sean Radigan
a65b99087b Fixed build options to allow compilation on linux using clang 2016-02-02 16:30:44 -05:00
Hans Duedal
1847312bac Enable an install target
Should work fine on Unix systems, and support install prefixes.
Installs both a static and a shared library to the same location, so we
get an .a and a .so/.dylib file, which can be linked to in the ordinary
way, ie. `-lg3logger`.
2016-01-24 13:27:52 +01:00
cstamatopoulos
d125990007 #13 generate import lib in msvc using cmake >= 3.4 2015-11-26 19:13:45 -05:00
Robert Ayrapetyan
8f109ec131 Update Build.cmake (support for FreeBSD 10+)
Proposed fix for building on FreeBSD 10+ systems:
- c++abi and rt libs are not required
- pthread flag and execinfo lib is required
2015-09-20 19:23:38 -07:00
Aleksey Dobrunov
0a04ae2bf6 change defaut value and option logic 2015-09-06 23:00:24 +05:00
Aleksey Dobrunov
d04b386fb4 add option ADD_BUILD_SHARED 2015-09-06 16:22:04 +05:00
Kjell Hedstrom
5eb9ab11c8 merge issues 2015-09-01 00:02:36 -06:00
Kjell Hedstrom
a8d89b67c8 Merge branch 'clang-improved-crash-handling' of https://github.com/KjellKod/g3log into clang-improved-crash-handling
Conflicts:
	Build.cmake
	example/main_fatal_choice.cpp
2015-08-31 23:07:25 -06:00
Jiri Hoogland
73751d2e85 - remove unused "-pthread" flags for clang compilation
- set target_property for rpath handling on OSX
2015-08-28 15:39:06 -04:00
Kjell Hedstrom
671fd01aa1 This is made to NOT compile ... lines that don't compile are sections I need to check out
exhausted stack. kill vs exit.  using libunwind or backtrace but with symoblizer should be tested
and blogged about(?)
2015-08-27 08:02:18 -06:00
Alexandre Petitjean
a529895444 Update Build.cmake 2015-07-22 16:01:47 +02:00
Alexandre Petitjean
6ff84e092b Fix path removal for windows 2015-07-21 12:21:31 +02:00
Kjell Hedstrom
7c7012325d Easier to install. continues
1) Breaking change:  g3 namespace replaces g2
2) g2log.hpp remains in src/g2log.hpp... but now all it does is to include the g3log.hpp, etc
3) ALL HEADER FILES ARE IN src/g3log/  while all .cpp and .ipp files are in /src  (exception for g2log.hpp)
   This should make it EASIER for clients to copy/install the header files to the new location.  It greatly simplifies
   rpm and cpackage installationsw
2015-07-19 23:10:56 -06:00
Kjell Hedstrom
6750efe8fe g2log.hpp is kept as a helper include. It will pull in the most frequent include files
All other are under g3log. Example: #include <g3log/time.hpp> #include <g3log/g3log.hpp> etc
This makes sure that the package manager (to be  used soon) does NOT clutter any /usr/local/include space
instead all the includes will be in /usr/local/include/g3log (or similar)
2015-07-16 01:55:23 -06:00
Kjell Hedstrom
78103cb415 Auto generate macro defintions in a file. This way you don't have to re-state them in your library
if no options are given a blank file will be generated
2015-07-13 07:49:44 -06:00
David Gayerie
4c45244391 fixing cross compilation on Linux for MINGW gcc 4.8.2 2015-03-29 14:29:07 +02:00
Kjell Hedstrom
81885e4456 Enabled vectored exception crash handling, it can also be turned off easily with a define
cmake -DENABLE_VECTORED_EXCEPTIONHANDLING=OFF
2015-02-16 01:37:55 -07:00
KjellKod
938fc55971 What a mess to merge from Github/KjellKod/g3log to BitBucket/KjellKod/g3log 2015-02-02 00:31:43 -07:00
kjellkod@kjellkod-Asus.hsd1.co.comcast.net.
c23a8e2419 Remove warning in Windows by using vsnprintf_s 2014-12-11 00:10:47 -07:00
KjellKod
0e37df7162 cleanup. Use G3Log instead of G2Log for binaries and configuration files 2014-10-03 01:53:21 -06:00
KjellKod
87a095e384 Renamed directories for a cleaner project structure
--HG--
rename : g2log/Build.cmake => Build.cmake
rename : g2log/CMakeLists.txt => CMakeLists.txt
rename : g2log/CPackLists.txt => CPackLists.txt
rename : g2log/Dynamic.cmake => Dynamic.cmake
rename : g2log/example/Example.cmake => example/Example.cmake
rename : g2log/example/main_contract.cpp => example/main_contract.cpp
rename : g2log/example/main_sigsegv.cpp => example/main_sigsegv.cpp
rename : g2log/src/active.hpp => src/active.hpp
rename : g2log/src/crashhandler.hpp => src/crashhandler.hpp
rename : g2log/src/crashhandler_unix.cpp => src/crashhandler_unix.cpp
rename : g2log/src/crashhandler_win.cpp => src/crashhandler_win.cpp
rename : g2log/src/g2filesink.cpp => src/g2filesink.cpp
rename : g2log/src/g2filesink.hpp => src/g2filesink.hpp
rename : g2log/src/g2filesinkhelper.ipp => src/g2filesinkhelper.ipp
rename : g2log/src/g2future.hpp => src/g2future.hpp
rename : g2log/src/g2log.cpp => src/g2log.cpp
rename : g2log/src/g2log.hpp => src/g2log.hpp
rename : g2log/src/g2loglevels.cpp => src/g2loglevels.cpp
rename : g2log/src/g2loglevels.hpp => src/g2loglevels.hpp
rename : g2log/src/g2logmessage.cpp => src/g2logmessage.cpp
rename : g2log/src/g2logmessage.hpp => src/g2logmessage.hpp
rename : g2log/src/g2logmessagecapture.cpp => src/g2logmessagecapture.cpp
rename : g2log/src/g2logmessagecapture.hpp => src/g2logmessagecapture.hpp
rename : g2log/src/g2logworker.cpp => src/g2logworker.cpp
rename : g2log/src/g2logworker.hpp => src/g2logworker.hpp
rename : g2log/src/g2moveoncopy.hpp => src/g2moveoncopy.hpp
rename : g2log/src/g2sink.hpp => src/g2sink.hpp
rename : g2log/src/g2sinkhandle.hpp => src/g2sinkhandle.hpp
rename : g2log/src/g2sinkwrapper.hpp => src/g2sinkwrapper.hpp
rename : g2log/src/g2time.cpp => src/g2time.cpp
rename : g2log/src/g2time.hpp => src/g2time.hpp
rename : g2log/src/shared_queue.hpp => src/shared_queue.hpp
rename : g2log/src/std2_make_unique.hpp => src/std2_make_unique.hpp
rename : g2log/src/stlpatch_future.hpp => src/stlpatch_future.hpp
rename : g2log/test_performance/Performance.cmake => test_performance/Performance.cmake
rename : g2log/test_performance/main_threaded_mean.cpp => test_performance/main_threaded_mean.cpp
rename : g2log/test_performance/main_threaded_worst.cpp => test_performance/main_threaded_worst.cpp
rename : g2log/test_performance/performance.h => test_performance/performance.h
rename : g2log/test_unit/Test.cmake => test_unit/Test.cmake
rename : g2log/test_unit/test_concept_sink.cpp => test_unit/test_concept_sink.cpp
rename : g2log/test_unit/test_configuration.cpp => test_unit/test_configuration.cpp
rename : g2log/test_unit/test_filechange.cpp => test_unit/test_filechange.cpp
rename : g2log/test_unit/test_io.cpp => test_unit/test_io.cpp
rename : g2log/test_unit/test_linux_dynamic_loaded_sharedlib.cpp => test_unit/test_linux_dynamic_loaded_sharedlib.cpp
rename : g2log/test_unit/test_sink.cpp => test_unit/test_sink.cpp
rename : g2log/test_unit/tester_sharedlib.cpp => test_unit/tester_sharedlib.cpp
rename : g2log/test_unit/tester_sharedlib.h => test_unit/tester_sharedlib.h
rename : g2log/test_unit/testing_helpers.cpp => test_unit/testing_helpers.cpp
rename : g2log/test_unit/testing_helpers.h => test_unit/testing_helpers.h
2014-10-03 01:20:33 -06:00