Commit Graph

65 Commits

Author SHA1 Message Date
Ray Molenkamp b683bcc46c Cleanup: CMake: Modernize bf_intern_clog dependencies
Pretty straightforward

- Remove any bf_intern_clog paths from INC
- Add a dependency though LIB when missing

context: https://devtalk.blender.org/t/cmake-cleanup/30260

Pull Request: https://projects.blender.org/blender/blender/pulls/115323
2023-11-24 17:12:24 +01:00
Campbell Barton e955c94ed3 License Headers: Set copyright to "Blender Authors", add AUTHORS
Listing the "Blender Foundation" as copyright holder implied the Blender
Foundation holds copyright to files which may include work from many
developers.

While keeping copyright on headers makes sense for isolated libraries,
Blender's own code may be refactored or moved between files in a way
that makes the per file copyright holders less meaningful.

Copyright references to the "Blender Foundation" have been replaced with
"Blender Authors", with the exception of `./extern/` since these this
contains libraries which are more isolated, any changed to license
headers there can be handled on a case-by-case basis.

Some directories in `./intern/` have also been excluded:

- `./intern/cycles/` it's own `AUTHORS` file is planned.
- `./intern/opensubdiv/`.

An "AUTHORS" file has been added, using the chromium projects authors
file as a template.

Design task: #110784

Ref !110783.
2023-08-16 00:20:26 +10:00
Ray molenkamp 4ea2baf4ae CMake: revert last weeks modernizations
The cleanup of blenkernel last weeks , caused the house of cards to
collapse on  top of bf_gpu's shader_builder, which is off by default
but used on a daily basis by the rendering team.

Given the fixes forward in #110394 ran into a ODR violation in OSL that
was hiding there for years, I don't see another way forward without
impeding the rendering teams productivity for "quite a while" as there
is no guarantee the OSL issue would be the end of it.

the only way forward appears to be back.

this reverts :

19422044ed
a670b53abe
0f541db97c
be516e8c81
3e88a2f44c
4e64b772f5
9547e7a317
07fe6c5a57

The problematic commit was 07fe6c5a57
as blenkernel links most of blender, it's a bit of a link order issue
magnet. Given all these commits stack, it's near impossible to revert
just that one without spending a significant amount of time resolving
merge conflicts. 99% of that work was automated, so easier to just
revert all of them, and re-do the work, than it is to deal with the
merge conflicts.

Pull Request: https://projects.blender.org/blender/blender/pulls/110438
2023-07-25 16:43:21 +02:00
Ray Molenkamp 0f541db97c Cleanup: CMake: Modernize bf_intern_clog dependencies
Pretty straightforward

- Remove any clog paths from INC
- Add a dependency though LIB when missing

context: https://devtalk.blender.org/t/cmake-cleanup/30260

Pull Request: https://projects.blender.org/blender/blender/pulls/110350
2023-07-21 18:37:30 +02:00
Ray Molenkamp 57ad866d81 Cleanup: CMake: Modernize bf_guardedalloc dependencies
Pretty straightforward

- Removes any guardedalloc paths from INC
- Adds a dependency though LIB

Pull Request: https://projects.blender.org/blender/blender/pulls/109925
2023-07-10 18:44:19 +02:00
Campbell Barton 65f99397ec License headers: use SPDX-FileCopyrightText in all sources 2023-06-15 13:35:34 +10:00
Campbell Barton 49594c37ae License headers: use SPDX-FileCopyrightText for CMake files 2023-06-14 23:36:23 +10:00
Campbell Barton 6859bb6e67 Cleanup: format (with BraceWrapping::AfterControlStatement "MultiLine") 2023-05-02 09:37:49 +10:00
Campbell Barton c434782e3a File headers: SPDX License migration
Use a shorter/simpler license convention, stops the header taking so
much space.

Follow the SPDX license specification: https://spdx.org/licenses

- C/C++/objc/objc++
- Python
- Shell Scripts
- CMake, GNUmakefile

While most of the source tree has been included

- `./extern/` was left out.
- `./intern/cycles` & `./intern/atomic` are also excluded because they
  use different header conventions.

doc/license/SPDX-license-identifiers.txt has been added to list SPDX all
used identifiers.

See P2788 for the script that automated these edits.

Reviewed By: brecht, mont29, sergey

Ref D14069
2022-02-11 09:14:36 +11:00
Campbell Barton f6fd3a84c2 Cleanup: reorganize doxygen modules
- Nest compositor pages under the compositor module
- Nest GUI, DNA/RNA & externformats modules under Blender.
- Remove modules from intern which no longer exist.
- Add intern modules (atomic, eigen, glew-mx, libc_compat, locale,
  numaapi, rigidbody, sky, utfconv).
- Use 'intern_' prefix for intern modules since some of the modules
  use generic terms such as locale & atomic.
2021-12-14 20:56:11 +11:00
Campbell Barton 76471dbd5e Cleanup: capitalize NOTE tag 2021-11-30 10:15:17 +11:00
Campbell Barton 4b9ff3cd42 Cleanup: comment blocks, trailing space in comments 2021-06-24 15:59:34 +10:00
Bastien Montagne 8c80267352 CLOG: Fix memleak in own recent improvement to CLOG filter.
Mistake in rBef5782e29744.
2021-05-14 17:50:55 +02:00
Sebastian Parborg aadfa31cf0 Fix "use after free" issue in clog
Keep track of clog_refs so we can null the pointers when calling
CLG_exit. Otherwise we will run into issues where the code will try to
access freed data.
2021-04-30 18:01:47 +02:00
Campbell Barton 865025c343 Cleanup: remove stdio.h header from MEM_guardedalloc.h
This was included for `FILE *` which isn't used in the header.

Ref D10799
2021-03-24 19:34:44 +11:00
Bastien Montagne ef5782e297 CLOG: add support for substring matching.
So that `--log "*undo*"` matches any log identifier containing `undo`.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D10647
2021-03-12 16:01:46 +01:00
Campbell Barton b9833860e5 Cleanup: maintain include order without disabling clang format 2021-03-05 14:08:00 +11:00
Jacob Møller 57812c7e4f Windows/CLog: Support color logging on Win 10
Windows 10 supports V100 on all consoles given
you enable the ENABLE_VIRTUAL_TERMINAL_PROCESSING
flag for the console.

This patch enables color logging only on windows
10 and only if the log is not being redirected
to a file.

Differential Revision: https://developer.blender.org/D10546
2021-03-04 18:20:52 -07:00
Clément Foucault e856443c99 CLOG: Add getter to know if output supports coloring 2020-10-24 14:07:05 -04:00
Campbell Barton a8fd3df905 Cleanup: spelling 2020-09-15 10:23:41 +10:00
Brecht Van Lommel fd5d014b62 Fix build error after clog color printing changes 2020-09-10 19:40:54 +02:00
Ray Molenkamp 9bd10b1c92 CLog: Support colorized logging on windows
When using Windows Terminal the same control codes Linux
uses to colorize the text can be used. WT can be detected
by looking at the WT_SESSION environment variable.

Differential Revision: https://developer.blender.org/D8848

Reviewed by: campbellbarton
2020-09-10 11:31:09 -06:00
Ray Molenkamp 359acad5e4 Cleanup: CLog fix bad use_color default
`use_color` was defaulted to 'on' and only turned off when it was
decided the terminal didn't support this. This was the wrong
way to go about things, since that test only ran for Linux/Mac other
operating systems would get color formatting regardless if they
supported it.

The new default is `off` until the platform specific code inside
`CLG_ctx_output_set` turns it on after running some sanity checks.

This fix was part of the review of D8848 but deserved its on commit

Reviewed By: campbellbarton
2020-09-10 11:27:41 -06:00
Jacques Lucke 8a9912eaf8 Tests: fail automated tests on memory leaks and other internal errors
This adds a new `--debug-exit-on-error` flag. When it is set, Blender
will abort with a non-zero exit code when there are internal errors.
Currently, "internal errors" includes memory leaks detected by
guardedalloc and error/fatal log entries in clog.

The new flag is passed to Blender in various places where automated
tests are run. Furthermore, the `--debug-memory` flag is used in tests,
because that makes the verbose output more useful, when dealing
with memory leaks.

Reviewers: brecht, sergey

Differential Revision: https://developer.blender.org/D8665
2020-08-26 22:02:02 +02:00
Jacques Lucke e414afbaf6 Cleanup: typos 2020-08-26 11:24:10 +02:00
Bastien Montagne 9cac158e96 Fix T78730: CLOG writes/reads outside allocated memory.
Fix several issues in CLOG code:
* In `clg_str_reserve`, allocated memory may be bigger than requested
  one, do not assign the latter back to `cstr->len_alloc`.
* `clg_str_vappendf` was mis-interpreting returned value from
  `vsnprintf`, and completely mixing total allocated memory and extra
  needed amount of memory to allocate...

Simplified code of `clg_str_vappendf` to only have allocating code
handled in one place, makes things easier to follow too.

Think this should also be beckported to 2.83.
2020-07-30 14:26:44 +02:00
Dalai Felinto 2d1cce8331 Cleanup: `make format` after SortedIncludes change 2020-03-19 09:33:58 +01:00
Campbell Barton fae0685113 Cleanup: quiet warnings 2019-10-07 12:22:05 +11:00
Campbell Barton 167f5a61e5 C Logging: add macro to check if logging is enabled 2019-07-10 19:39:53 +10:00
Campbell Barton 177a0ca131 Cleanup: comments (long lines) in various intern/ libs 2019-05-01 21:00:56 +10:00
Campbell Barton e12c08e8d1 ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211.

For details on usage and instructions for migrating branches
without conflicts, see:

https://wiki.blender.org/wiki/Tools/ClangFormat
2019-04-17 06:21:24 +02:00
Campbell Barton 47adab4f99 CMake: prepare for BLENDER_SORTED_LIBS removal
No functional change, this adds LIB definition and args to cmake files.
Without this it's difficult to migrate away from 'BLENDER_SORTED_LIBS'
since there are many platforms/configurations that could break when
changing linking order.

Manually add and enable WITHOUT_SORTED_LIBS to try building
without sorted libs (currently fails since all variables are empty).
This check will eventually be removed.

See T46725.
2019-04-14 15:37:24 +02:00
Campbell Barton 6eb59c5778 Cleanup: GCC redundant declarations
Previous waning suppression was only tested with clang.
2019-02-23 22:18:34 +11:00
Campbell Barton 702a2ba0ef Cleanup: quiet undeclared variable warnings 2019-02-23 19:20:20 +11:00
Campbell Barton b6f8afc13a C logging: make pthread use optional
There is no need for threading for makesrna/makesdna,
disable it to avoid hassles linking build time utilities.
2019-02-22 19:45:22 +11:00
Campbell Barton 94f83a4ebd Fix T61765: thread-unsafe logging used 2019-02-21 11:33:50 +11:00
Campbell Barton de13d0a80c doxygen: add newline after \file
While \file doesn't need an argument, it can't have another doxy
command after it.
2019-02-18 08:22:12 +11:00
Campbell Barton eef4077f18 Cleanup: remove redundant doxygen \file argument
Move \ingroup onto same line to be more compact and
make it clear the file is in the group.
2019-02-06 15:45:22 +11:00
Campbell Barton 65ec7ec524 Cleanup: remove redundant, invalid info from headers
BF-admins agree to remove header information that isn't useful,
to reduce noise.

- BEGIN/END license blocks

  Developers should add non license comments as separate comment blocks.
  No need for separator text.

- Contributors

  This is often invalid, outdated or misleading
  especially when splitting files.

  It's more useful to git-blame to find out who has developed the code.

See P901 for script to perform these edits.
2019-02-02 01:36:28 +11:00
Campbell Barton 68ae1f4958 Fix CLOG_STR_AT_SEVERITY macro
Part of D4277 by @sobakasu
2019-01-29 17:28:44 +11:00
Campbell Barton c383d74228 Logging: add '--log-show-timestamp' option.
Part of D4214 by @sobakasu w/ edits.
2019-01-16 16:33:05 +11:00
Campbell Barton 302970b7a5 MSVC: remove compiler __func__ define
No longer needed and exposes a bug in clang-format see: D4185
2019-01-11 09:22:21 +11:00
Campbell Barton 5681631109 Cleanup: ensure header guards come first
Causes clang-format not to detect header guards,
indenting all preprocessor lines in the header.
2019-01-10 08:46:38 +11:00
Campbell Barton f489db1c6b Haiku: build fix
D4130 by @miqlas
2019-01-04 17:04:07 +11:00
Campbell Barton 6fbd210b91 Merge branch 'master' into blender2.8 2018-08-08 11:05:08 +10:00
Campbell Barton 931a279f44 Cleanup: use static variables 2018-08-08 11:00:57 +10:00
Campbell Barton c7e1d067a5 Merge branch 'master' into blender2.8 2018-07-31 21:27:51 +10:00
Campbell Barton a3085190f8 Fix building w/ FreeBSD
fileno could be a macro which can't take a void pointer.
2018-07-31 20:52:36 +10:00
Campbell Barton 2451a1951e Merge branch 'master' into blender2.8 2018-05-18 11:02:39 +02:00
Campbell Barton 278e3f7d5f Logging: add --show-log-backtrace
Useful in debug builds to see a functions callers.
2018-05-18 11:00:47 +02:00