Commit Graph

56 Commits

Author SHA1 Message Date
Sergiu Deitsch
e3f5398aa1
rework public header structure (#1012)
Promote generated headers to regular headers. This enables direct
editing of corresponding files and running automatic source code
formatting and static analysis tools, such as clang-format and
clang-tidy on the whole project which previously was not
straightforward.
2023-12-30 19:05:26 +01:00
Sergiu Deitsch
43792b8a13 rework (lib)unwind integration
Allow to switch between the two backends.
2023-12-30 00:50:52 +01:00
Sergiu Deitsch
3fcf77a691
fix: drop custom (v)snprintf definition (#992)
The functions are available since C++11.
2023-12-20 20:49:08 +01:00
Huy Q. Bui
4dbc26af72
feat: support log file truncation on windows (#960) 2023-10-08 14:03:10 +02:00
Rodrigo Queiro
3a0d4d22c5
Warn about dragons in the Bazel include path (#927)
https://github.com/google/glog/issues/837 has caused a couple of
disappointments for PR authors, so I'm hoping this comment can save them
some time, or even help them towards finding a complete solution for the
problem.
2023-06-05 11:08:12 +02:00
Mai Hussien
888f93947b Move commandlineflags.h to shared_headers 2023-05-15 16:31:45 +02:00
Mai Hussien
4ffdf0dc78 Move shared headers to a private filegroup 2023-05-15 16:31:45 +02:00
Mai Hussien
7a62819e43 Fix targets for layering_check 2023-05-15 16:31:45 +02:00
Sergiu Deitsch
6742834201
move to C++14 (#902) 2023-02-28 12:26:49 +01:00
Peng Xiao
35f4efbb0a bazel: Add HAVE_EXECINFO_H copts to fix empty stack trace 2023-02-28 12:10:03 +01:00
Sergiu Deitsch
1b59cb0905
drop custom prefix option (#898) 2023-02-24 20:40:09 +01:00
Rodrigo Queiro
9ad08ac6cc Remove symbolize Bazel test
It is broken on Windows CI (#859) in a way that I don't understand.
2022-09-15 16:42:46 +02:00
Marek Cirkos
bfee415a1d
bazel: fix broken stacktrace (#851)
Since #846, `HAVE_UNWIND_H`  is not really in use. Instead we should use `HAVE__UNWIND_BACKTRACE` and `HAVE__UNWIND_GETIP` (added in #846). To prevent that from happening again, also added Bazel tests that confirm stacktrace are still working.
2022-08-16 18:48:59 +02:00
Sergiu Deitsch
a34226ca94
support ndk r25 (#844) 2022-08-01 10:46:35 +02:00
Yun Peng
79d692c645 Strip only the first leading @
This change is needed for glog to work with future version of Bazel when
canonical label literals is used in Bzlmod.

Context: https://docs.google.com/document/d/1N81qfCa8oskCk5LqTW-LNthy6EBrDot7bdUsjz6JFC4/edit#heading=h.5mcn15i0e1ch
2022-06-15 18:05:23 +02:00
Rodrigo Queiro
5addeedc0a Fix "'GLOG_EXPORT' macro redefined" on clang-cl
The previous approach used
--incompatible_enable_cc_toolchain_resolution, which is recommended by
the docs, but a Bazel developer told me it's obsolete. The new, old
approach is simpler and should stop the warning from being user-visible.
2022-03-08 13:39:50 +01:00
Sergiu Deitsch
9f0b7d3bfe renamed GOOGLE_GLOG_DLL_DECL to GLOG_EXPORT
Use a consistent naming and avoid platform specific terms. Also remove
copy and paste code.
2022-02-14 10:32:44 +01:00
Sergiu Deitsch
4ffa98388f ensure _Unwind_Backtrace to actually be available 2021-12-21 11:38:12 +01:00
Sergiu Deitsch
dfb9ffc324 provide backward compatible send overload 2021-12-15 11:14:23 +01:00
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
Artur
c34dbe9873 Fix syscall warning in Bazel Build
This commit resolves [#717](https://github.com/google/glog/issues/717) issue.
2021-10-07 19:43:48 +02:00
Sergiu Deitsch
f7407d4d27 export OS_* defines (fixes #715) 2021-10-01 11:26:07 +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
luliyucoordinate
6e46c125e3 bazel: add GLOG_CUSTOM_PREFIX_SUPPORT 2021-07-01 08:04:18 +02:00
Sergiu Deitsch
d25a1b7bc0 cmake: export <atomic> availability (fixes #667) 2021-06-15 18:36:24 +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
efc341d768 fixed windows builds 2021-04-08 18:16:42 +02:00
Rodrigo Queiro
1041a221b8 Use generated config.h for Windows.
This unblocks a simplification of the Windows CMake build.
2021-04-06 14:02:21 +02:00
Rodrigo Queiro
30bb9086d2 bazel: use expand_template instead of genrules
This lets us drop the dependency on the preprocessed headers in
src/windows/glog/.

For some reason, this lets Bazel realize we've failed to declare a
dependency on dirent.h, so I added that too.
2021-03-31 16:08:50 +02:00
Sergiu Deitsch
b442ef8070 build: set ac_cv___attribute___printf_4_5 2021-03-30 21:12:09 +02:00
Rodrigo Queiro
d4e8ebab7e Add layering_check to Bazel CI.
This will avoid regressions on #596.
2021-03-02 10:32:06 +01:00
Rodrigo Queiro
0863ad797c bazel: declare headers in top-level rule
Fixes #596.
2021-03-02 10:32:06 +01:00
Rodrigo Queiro
ce50c57b9e Rename BUILD to BUILD.bazel.
This avoids conflicts with build/ on case-insensitive filesystems.

Fixes #606.
2021-03-01 13:23:27 +01:00
Liang Zou
6d14ac3efe Fix the symlink creation bug if using bazel 2021-02-20 17:34:31 +01:00
Phillipp Schoppmann
0a2e5931bd
Fix build for Emscripten (#546)
Add back config_setting for WASM (no HAVE_SYSCALL_H)

Since there is no config_setting for Linux
(https://github.com/bazelbuild/bazel/issues/11107), Linux needs to be
the default case.
2020-05-13 09:36:55 +09:00
Doug Rabson
3ba8976592 fix bazel build for freebsd 2020-03-25 10:17:39 +01:00
Rodrigo Queiro
1b7d541431 Add note about namespace on Win32. 2019-11-27 18:24:27 +01:00
Rodrigo Queiro
95a3655796 Remove unnecessary defines
The only macro referenced by the public headers is GOOGLE_GLOG_DLL_DECL.
This means fewer defines are propagated to rules that depend on glog.
2019-11-27 18:24:27 +01:00
Rodrigo Queiro
c0d2ceade6 Avoid leaking config.h
This uses strip_include_prefix to avoid leaking private headers
(config.h, port.h). This needs a workaround to prevent a "missing
dependency declarations" error.
2019-11-27 18:24:27 +01:00
Luc Bertrand
20919b325e add windows support for bazel bazed build 2019-11-20 14:21:54 +01:00
Luc Bertrand
7f732529da apply buildifier on glog.bzl 2019-11-20 14:21:54 +01:00
Shuhei Takahashi
6ca3d3cf58 Fix stacktrace on bazel build. (#347)
We need at least following defs to be set to print stacktrace in
failure signal handler.

- HAVE_UNWIND_H: on Linux and macOS. unwind.h is usually present
  by default on those OSes.
- HAVE_DLADDR: on macOS.

Windows is not cared because glog can not be built with bazel
on Windows today.
2019-04-12 10:09:41 +09:00
Prem Nair
e0f7bfc6ca Add kwargs to glog_library 2018-12-31 14:20:45 +00:00
Prem Nair
0bc2d94cd1 Fix bazel build with gflags
The code references `@ac_cv_have_libgflags@` but not `@ac_cv_have_libgflags_h@`. This corrects that.

`int(with_gflags)` incorporates the possibility of `True/False`: https://github.com/bazelbuild/bazel/issues/4792
2018-12-31 14:20:45 +00:00
levosos
367518f650 copts are passed correctly when building w/o gflags
resolves #338
2018-07-09 11:14:33 +02:00
Akiyoshi Ochiai
dd2b93d761 Fix __attribute__((noreturn)) mismatch warning in Bazel build 2018-04-18 10:15:54 +02:00
Rodrigo Queiro
55cc27b6ec Bazel: make example more portable 2018-02-01 14:13:46 +01:00
Rodrigo Queiro
bc9a491033 Allow using glog/stl_logging.h with Bazel
Fixes #289.
2018-02-01 14:13:46 +01:00