Commit Graph

151 Commits

Author SHA1 Message Date
Sergiu Deitsch
4a55b11580 ci: added linux github workflow 2021-10-11 15:54:42 +02:00
huangqinjin
3965584721
support stack unwind on Android 2021-10-08 22:14:20 +02:00
Sergiu Deitsch
8474b7854b added gmock support 2021-10-07 19:53:08 +02:00
Sergiu Deitsch
f7407d4d27 export OS_* defines (fixes #715) 2021-10-01 11:26:07 +02:00
Sergiu Deitsch
f8c8e99fdf
Merge pull request #688 from google/eliminate-warnings
eliminate warnings
2021-07-24 00:38:08 +02:00
Sergiu Deitsch
98e0e8c65d cmake: bump .so version
Account for ABI incompatibility.
2021-07-23 14:39:25 +02:00
Sergiu Deitsch
0b83bb203d eliminate warnings 2021-07-22 22:52:22 +02:00
Sergiu Deitsch
dfe573088c bump version 2021-07-14 20:02:37 +02:00
z-aki
4a4331f2f2 Fix syscall deprecation warning on macOS >= 10.12
Fix #185
2021-07-14 19:51:19 +05:30
Sergiu Deitsch
a01d739ea3
Merge pull request #684 from sergiud/cmake-namespaced-gflags
cmake: prefer linking against gflags::gflags (fixes #683)
2021-07-14 10:39:54 +02:00
Sergiu Deitsch
c39fcf6e8a ci: added more targets 2021-07-14 02:21:58 +02:00
Sergiu Deitsch
5bf7fdea16 cmake: prefer linking against gflags::gflags (fixes #683) 2021-07-13 13:24:27 +02:00
Dmitriy A
a1374c4200 Implement LOG_EVERY_T.
Use <chrono> and <atomic> for C++11 or greater.
For non-Windows pre-C++11 systems, use <time.h> and built-in atomic operations.
For Windows pre-C++11, use the Windows implementations for time and atomic operations.
2021-07-05 07:25:12 -07:00
Sergiu Deitsch
a4a725d547
Merge pull request #671 from sergiud/cmake-define-have-cxx11-atomic
cmake: export `<atomic>` availability (fixes #667)
2021-06-16 09:46:58 +02:00
Sergiu Deitsch
f0bac8852a cmake: allow to override -fPIC 2021-06-15 23:56:49 +02:00
Sergiu Deitsch
d25a1b7bc0 cmake: export <atomic> availability (fixes #667) 2021-06-15 18:36:24 +02:00
Sergiu Deitsch
9c1a25b931 cmake: fixed msvc snprintf detection (fixes #668) 2021-06-15 18:26:10 +02:00
Roman Gershman
d2fed749a5 Fix cmake configuration for cygwin environment
1. Use CYGWIN variable to test for WIN32 because WIN32 var has been deprecated in later versions of cmake.
2. Translate TEST_SRC_DIR to windows paths because posix open calls can not handle unix-like paths in cygwin environment.
2021-05-23 14:07:16 +03:00
Sergiu Deitsch
0efaa59a75
Merge pull request #641 from sergiud/nullptr
CHECK support for nullptr (fixes #341)
2021-04-12 10:08:28 +02:00
Sergiu Deitsch
762a2a7ee1 eliminated gflags related linker warnings (#569) 2021-04-11 14:24:41 +02:00
Santiago Gil
0cbc235297 Add support for setting a custom prefix format 2021-04-09 20:11:44 +02:00
Bret McKee
c7656c3ec1 CHECK support for nullptr (fixes #341)
This allows CHECK_NE(foo, nullptr) to compile and produces "nullptr" for the
string representation of nullptr.
2021-04-09 20:10:08 +02:00
Sergiu Deitsch
663bb26960
Merge pull request #620 from sergiud/cmake-allow-to-disable-symbolize
cmake: allow to disable symbolize
2021-04-09 15:06:36 +02:00
Sergiu Deitsch
efc341d768 fixed windows builds 2021-04-08 18:16:42 +02:00
Sergiu Deitsch
39e83581de cmake: allow to disable symbolize 2021-04-07 22:59:46 +02:00
Sergiu Deitsch
9ee010d853 cmake: build shared libs by default 2021-04-02 01:23:43 +02:00
Sergiu Deitsch
d66e593188
Merge pull request #618 from sergiud/ac_cv___attribute___printf_4_5
build: set ac_cv___attribute___printf_4_5
2021-03-31 10:32:49 +02:00
Sergiu Deitsch
01f3e543e3 use C++ headers 2021-03-31 02:24:22 +02:00
Sergiu Deitsch
3f4df6aee9 cmake: do not require a C compiler 2021-03-31 01:44:15 +02:00
Sergiu Deitsch
be25d94c21 cmake: optionally use gtest 2021-03-30 22:41:15 +02:00
Sergiu Deitsch
c30896d3d5 cmake: export symbols selectively 2021-03-30 21:41:52 +02:00
Sergiu Deitsch
b442ef8070 build: set ac_cv___attribute___printf_4_5 2021-03-30 21:12:09 +02:00
Marco
9881ea5969
Fix race conditions in LOG_EVERY_N (#492)
* Use CMakeLists.txt to check the availability of std::atomic<>
* Declare the static integer counters as std::atomic<int> instead of int if C++11's atomic is available
* implement fallback mechanism for pre C++11 compilers
* src/glog/logging.h.in: fix wrong atomic increment
* src/glog/logging.h.in: make modulo operations atomic
2021-02-22 22:17:25 +01:00
Sergiu Deitsch
e370cd5166 bump version 2021-02-13 12:23:32 +01:00
Sergiu Deitsch
8ee2bb5b31
Merge pull request #553 from huangqinjin/android
Output to logcat on Android
2020-09-29 22:11:54 +02:00
Yicong Huang
c652590d84
Update CMakeLists.txt
wrap the path with double quotation so that it can build on path with spaces.
2020-09-15 22:22:13 -07:00
huangqinjin
0a12a96cee Output to logcat on Android 2020-05-11 23:59:00 +08:00
Ed Baunton
eb13e4f67c Allow CMake user to disable Symbolize functionality
Currently the user has to rely on the HAVE_SYMBOLIZE detection inside
CMakeLists.txt without having any control over whether it should be used.

Add support for disabling HAVE_SYMBOLIZE at configure time so user can specify
`cmake -DHAVE_SYMBOLIZE=0`.

Signed-off-by: Ed Baunton <ebaunton1@bloomberg.net>
2020-02-15 17:16:14 -05:00
Michael Spang
130a3e10de Use file offsets in traces if object has no symbols (#513)
Fallback to using file offsets if no symbol is found, like we do if the
object could not be opened.

This makes backtraces usable even if objects in the trace are stripped,
since the trace can be symbolized by post-processing it with a tool like
asan_symbolize.py.

Note that this is not currently compatible with SymbolizeCallback as
this overwrites the filename in the buffer. The behavior is unchanged
in that case.

Closes: #514
2020-01-08 15:34:39 +09:00
Sergiu Deitsch
1863b4228c
Merge pull request #368 from UVV-gh/cmake-sdk-fix
Use libunwind as an imported target
2019-11-10 17:02:31 +01:00
Sergiu Deitsch
c0463b17b6 added cmake package config unit test 2019-11-10 15:46:47 +01:00
Sergiu Deitsch
9a43cfb8d2 install unwind find module alongside glog 2019-11-10 11:09:18 +01:00
Sergiu Deitsch
19570c69c9 renamed and cleaned up the unwind find module 2019-11-10 11:09:14 +01:00
Ezequiel Lara Gomez
58d7f873dc Added fixed log name support, take 2 (#489)
* Added fixed log name support, take 2

See https://code.google.com/p/google-glog/issues/detail?id=209 and former https://github.com/google/glog/pull/19 - this is an updated version of that patch.

It adds a flag that allows to switch behavior from base_filename + filename_extension + time_pid_string to base_filename + filename_extension, while still defaulting to the current behavior to avoid breakage in existing code. This change would allow easier log rotation schemes and better control on what's written on disk.

* Ifdef away fcntl on mingw

* Use the defined HAVE_FCNTL instead

* ifdef away tests as well

add have_sys_wait for wait() on mingw.

* OS_WINDOWS bug in fseeking to the end, only triggered here
2019-11-06 12:49:01 +01:00
Vyacheslav Yurkov
742fe94f22 Use libunwind as an imported target
When UNWIND_LIBRARY is used directly as a public dependency then
absolute path is stored in cmake config file. This is an issue when
glog is used as part of an SDK, which was built somewhere else. When
SDK is installed on developer's machine, cmake config contains a full
path to non-existent location. The solution is to find libunwind
during configure stage and store target name as a dependency, not a full path.
Cmake module looks for libunwind and libunwind-PLAT, where PLAT is one of
supported platforms.

Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com>
2019-11-02 02:42:25 +01:00
loop0day
82d0860b76 Support pkg-config 2019-11-01 22:28:58 +08:00
durswd
a8fad525e5 Changed the order of conditions 2019-09-02 13:28:18 +09:00
durswd
00cb9f4e6f I supported clang-cl with BUILD_SHARED_LIBS 2019-09-02 12:32:29 +09:00
Shinichiro Hamaji
406b0e702f glog: release 0.4.0 2019-01-22 21:00:50 +09:00
Roman Gershman
6adf6d7ae5 fix debug build using gcc -fsanitize=undefined (#374) 2018-12-12 10:16:49 +01:00
Sergiu Deitsch
125d6b3df4
Merge pull request #330 from NeroBurner/ci_travis_appveyor_master
ci: add appveyor and travis config
2018-12-12 09:00:35 +01:00
Taiju Tsuiki
781096619d Upstream Chromium local changes to symbolize.cc (#391)
* Upstream Chromium local changes to symbolize.cc

Chromium has its own fork of symbolize.cc and symbolize.h, and it has
several not-yet-upstreamed changes, that are not specific to Chromium.

This patch upstreams such a changes.

  Fixed google::FindSymbol reading past end of a section
  3dae0a2d7d

  Fix -INT_MIN integer overflow in itoa_r().
  ac4d28e9cb

  Add print_unsymbolized_stack_traces gn arg.
  6a2726776f

  Switch to standard integer types in base/.
  9b6f42934e

* Add a build option to print unsymbolized traces

This PRINT_UNSYMBOLIZED_STACK_TRACES option to cmake, and
--enable-unsymbolized-traces option to autoconf.
2018-11-21 11:14:38 +09:00
NeroBurner
a29380601b set timeout for stacktrace unittest
The stacktrace unittest hangs when compiled with MSVC. The default
timeout is 1500 seconds. Change it to 30 seconds
2018-10-15 13:34:52 +02:00
NeroBurner
7450a8b345 mingw-w64: check if localtime_r exists
- check in cmake if localtime_r exists
- if localtime_r is missing (MSVC, mingw-w64 on linux) redefine it using
  localtime_s
2018-06-01 14:50:11 +02:00
NeroBurner
d354e2e8f9 mingw-w64: fix dbghelp on case sensitive systems
- fix dbhelp.h include
- fix dbghelp check and link
2018-06-01 14:50:07 +02:00
Daiki Maekawa
2faa186e62 cmake: added BUILD_SHARED_LIBS option (#313) 2018-04-26 08:46:24 +02:00
Sergiu Deitsch
43dafc5bf2 cmake: fixed gcc warning 2018-03-19 00:21:33 +01:00
Sergiu Deitsch
a97d6b0e1c
Symbolizer support for mingw and cygwin (#208)
* added dbghelp symbolizer support for mingw and cygwin
* fixed compiler errors in case <stdint.h> is not available
* cmake: check whether SymFromAddr actually works
2018-02-27 21:03:20 +01:00
Sergiu Deitsch
1aec14edf4 cmake: do not introduce a policy stack in the package config 2018-02-23 10:16:24 +01:00
Corentin Le Molgat
6b6e38a7d5 Rework CMake glog VERSION management.
- Use of Project version properties instead of custom variables
- fix missmatch between VERSION (build version) and SOVERSION (API version)
src: https://cmake.org/cmake/help/latest/prop_tgt/VERSION.html#prop_tgt:VERSION
2018-02-06 10:37:26 +01:00
Corentin Le Molgat
4ef88d510e remove uneeded enable_testing()
CTest module already provides it
2018-02-06 10:37:26 +01:00
Corentin Le Molgat
cbfd86a1d8 Provide glog::glog ALIAs
Useful when using glog as subproject.
Add an explanation at top like in gflags.git CMakeLists.txt
2018-02-06 10:37:26 +01:00
Sergiu Deitsch
028d37889a cmake: remove config.h from public headers (closes #238) 2018-01-04 15:20:26 +01:00
Sergiu Deitsch
a92e1d95c5 cmake: use gflags package config instead of a find module
This allows to avoid conflicts between third party gflags find modules floating
around. If a package provide a local version of gflags find module, clients
which locate glog will incorrectly use it. Another problem is a CMake error message
"cmake_policy PUSH without matching POP" in nested find_package calls. In summary,
we need to ensure to use the original gflags package config.
2018-01-04 02:38:42 +01:00
Sergiu Deitsch
185ba48937 cmake: added a postfix for debug builds (closes #237)
This allows to deploy debug and release builds concurrently.
2018-01-02 14:38:37 +01:00
Shinichiro Hamaji
ebf81ac476 Merge pull request #245 from DariuszOstolski/issue211
Fix username lookup in case of missing USER environment variable
2017-10-20 16:09:28 +09:00
Sergiu Deitsch
2fe6508e53 fixed gcc logging failure 2017-10-11 00:45:08 +02:00
Dariusz Ostolski
9d28cac469 Added HAVE_PWD_H to cmake build 2017-09-20 18:41:07 +02:00
Shinichiro Hamaji
40fc21467a Merge pull request #153 from sergiud/cmake-gnu-install-dirs
cmake: do not hardcode relative install directories
2017-07-06 15:01:10 +09:00
Shinichiro Hamaji
a9b9ee8e8c Merge pull request #152 from sergiud/cmake-project-name
cmake: changed project name from google-glog to glog
2017-07-06 15:00:37 +09:00
Shinichiro Hamaji
a835da8e08 Merge pull request #158 from sergiud/zero-allocation
[RFC] reduce heap memory allocations to zero
2017-07-06 14:58:37 +09:00
Hans-Andreas Engel
2df0ca34aa reduce memory allocations to zero 2017-07-06 00:02:38 +02:00
Shinichiro Hamaji
80bec2ba45 Merge pull request #199 from v1bri/brian-fix-gflags-link
Use gflags ALIAS instead of ${gflags_XXX} vars
2017-06-29 12:36:25 +09:00
Andrew Schwartzmeyer
d1f49ba5aa Support signal handler on Windows 2017-06-27 10:50:20 -07:00
Andrew Schwartzmeyer
7f95ecfdc7 Link to DbgHelp using pre-processor directive
This method ensure that all users of glog get automatically linked to
the DbgHelp library without needing to set compiler flags.
2017-06-27 10:50:20 -07:00
Andrew Schwartzmeyer
f1d64f7deb Support symbolizer and demangler on Windows 2017-06-27 10:50:20 -07:00
Andrew Schwartzmeyer
e5d36443c6 Support stacktrace on Windows 2017-06-26 18:47:34 -07:00
Brian Orr
baf6c8b2c5 Specify gflags version in CMakeLists.txt 2017-06-22 11:24:58 -07:00
Brian Orr
e1cae334a1 Use gflags ALIAS instead of ${gflags_XXX} vars
The gflags project updated their CMake config last year with a
`gflags` ALIAS target. This can be used instead of the legacy
`${gflags_LIBRARIES}` and `${gflags_INCLUDE_DIRS}` variables. It also
looks cleaner.

Fixes #198
2017-06-22 00:25:13 -07:00
Shinichiro Hamaji
d166ae3881 Update the version in CMakeLists.txt to 0.3.5 2017-05-10 20:44:01 +09:00
Sergiu Deitsch
b3dea50f33 cmake: do not hardcode relative install directories 2017-01-10 11:34:42 +01:00
Sergiu Deitsch
f2157a387b cmake: changed project name from google-glog to glog
This fixes the default install location on Windows. Specifically,
find_package works now out-of-the box with the default
CMAKE_INSTALL_PREFIX.
2017-01-10 11:15:18 +01:00
Sergiu Deitsch
60375e0bd4 cmake: allow to disable building unit tests
This commit introduces a CMake `BUILD_TESTING` boolean option that
allows to disable unit tests. This is especially useful in superbuilds
where typically only the main library is built. By default, this option
is enabled.
2016-10-19 09:32:21 +02:00
Fumitoshi Ukai
f5cc8631a4 Merge pull request #98 from willyd/relocatable
Added $<BUILD_INTERFACE> to gflags include directory
2016-10-19 16:02:49 +09:00
Fumitoshi Ukai
dee7c8c36e Merge pull request #129 from sergiud/cmake-PIC
cmake: enable position independent code (PIC)
2016-10-19 15:52:32 +09:00
Fumitoshi Ukai
fc61880361 Merge pull request #130 from sergiud/cmake-warning-fix
cmake: fixed clang warning propagation to gcc
2016-10-19 15:51:45 +09:00
Sergiu Deitsch
e6c26b2b94 cmake: fixed clang warning propagation to gcc 2016-10-07 11:03:19 +02:00
Sergiu Deitsch
e05f325668 cmake: enable position independent code (PIC) 2016-10-07 10:54:14 +02:00
Guillaume Dumont
45901a359f Added $<BUILD_INTERFACE> to gflags include to avoid including the gflags include dir in the glog-targets.cmake 2016-04-05 14:02:42 -04:00
Sergiu Dotenco
780efcc857 cmake: allow to refer to imported glog target as glog::glog 2016-01-08 14:55:58 +01:00
Fumitoshi Ukai
f46e0745a8 Merge pull request #58 from ruslo/fix.include
Fix missing public include directory
2015-11-10 17:11:29 +09:00
Ruslan Baratov
ccacef4362 Fix missing public include directory
Path "<prefix>/include" will not be added to the headers search of dependent
targets without specifying INSTALL_INTERFACE, i.e. compilation
will fail with error:

  "fatal error: 'glog/logging.h' file not found".
2015-09-09 00:33:31 +03:00
Nate Rosenblum
bdb6c3219a Add pthread library to linker list when needed 2015-09-06 08:09:36 -07:00
Fumitoshi Ukai
a66751870f Merge pull request #49 from sergiud/cmake-visibility
Fixed warning caused by policy CMP0063 introduced in CMake 3.3
2015-08-12 16:10:40 +09:00
Sergiu Dotenco
ed6dba0bd8 cmake: fixed warning caused by policy CMP0063 2015-08-11 19:00:14 +02:00
Sergiu Dotenco
cb5487d901 cmake: allow to disable multithreading support
This commit additionally enables threading for win32 by default.
2015-08-08 21:26:17 +02:00
Sergiu Dotenco
8453b0856b cmake: link to libunwind 2015-07-15 22:35:01 +02:00
Sergiu Dotenco
05746ed702 cmake: support gflags in static builds 2015-07-15 22:35:01 +02:00
Sergiu Dotenco
95cde7af2f cmake: disabled 'template argument uses unnamed type' warning 2015-07-15 22:35:00 +02:00
Sergiu Dotenco
b561c94b19 determine gflags namespace automatically 2015-07-15 22:34:59 +02:00