Commit Graph

51 Commits

Author SHA1 Message Date
Jeroen Bakker 65e58fe574 CMake: Fix Compiling Shader Builder on macOS
Due to changes in the build environment shader_builder wasn't able to
compile on macOs. This patch reverts several recent changes to CMake files.

* dbb2844ed9
* 94817f64b9
* 1b6cd937ff

The idea is that in the near future shader_builder will run on the buildbot as
part of any regular build to ensure that changes to the CMake doesn't break
shader_builder and we only detect it after a few days.

Pull Request: https://projects.blender.org/blender/blender/pulls/115929
2023-12-08 15:47:14 +01:00
Campbell Barton 32c5ea6262 Cleanup: format 2023-12-02 14:56:12 +11:00
Harley Acheson 1d7ddcc46e Cleanup: Make format
Formatting changes resulting from Make Format
2023-12-01 10:29:59 -08:00
Bastien Montagne 050d48edfc BLI_fileops: Harmonize 'rename' behaviors accross platforms.
This commit aim at making the behaviors of `BLI_rename` and
`BLI_rename_overwrite` more consistent and coherent across all
supported platforms.

* `BLI_rename` now only succeeds in case the target `to` path does not
  exists (similar to Windows `rename` behavior).
* `BLI_rename_overwrite` allows to replace an existing target `to` file
  or (empty) directory (similar to Unix `rename` behavior).

NOTE: In case the target is open by some process on the system, trying
to overwrite it will still fail on Windows, while it should succeed on
Unix-like systems.

The main change for Windows is the usage of `MoveFileExW`
instead of `_wrename`, which allows for 'native support' of file
overwrite (using the `MOVEFILE_REPLACE_EXISTING` flag). Directories
still need to be explicitly removed though.

The main change for *nix systems is the use of `renamex_np` (OSX) or
`renameat2` (most Linux systems) to allow forbidding renaming to an
already existing target in an 'atomic' way.

NOTE: While this commit aims at avoiding the TOC/TOU problem as
much as possible by using available system's primitives for most
common cases, there are some situations where race conditions
(filesystem changes between checks on FS state, and actual rename
operation) remain possible.

Pull Request: https://projects.blender.org/blender/blender/pulls/115096
2023-11-30 22:35:00 +01:00
Ray molenkamp 94817f64b9 Cleanup: CMake: Modernize bf_intern_utfconv dependencies
- Remove any bf_intern_utfconv paths from INC
- Add a dependency though LIB when missing
- an empty target is created for non windows builds, so we don't have to
if(WIN32) this all over the place

context: https://devtalk.blender.org/t/cmake-cleanup/30260
Pull Request: https://projects.blender.org/blender/blender/pulls/115373
2023-11-28 01:11:15 +01:00
Sergey Sharybin 21c8af467d Cleanup: Convert winfunc and utfconv to C++
Basically, the intern/utfconv directory, as well as users of
these headers.

Pull Request: https://projects.blender.org/blender/blender/pulls/113901
2023-10-20 10:27:31 +02: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
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
Sergey Sharybin a12a8a71bb Remove "All Rights Reserved" from Blender Foundation copyright code
The goal is to solve confusion of the "All rights reserved" for licensing
code under an open-source license.

The phrase "All rights reserved" comes from a historical convention that
required this phrase for the copyright protection to apply. This convention
is no longer relevant.

However, even though the phrase has no meaning in establishing the copyright
it has not lost meaning in terms of licensing.

This change makes it so code under the Blender Foundation copyright does
not use "all rights reserved". This is also how the GPL license itself
states how to apply it to the source code:

    <one line to give the program's name and a brief idea of what it does.>
    Copyright (C) <year>  <name of author>

    This program is free software ...

This change does not change copyright notice in cases when the copyright
is dual (BF and an author), or just an author of the code. It also does
mot change copyright which is inherited from NaN Holding BV as it needs
some further investigation about what is the proper way to handle it.
2023-03-30 10:51:59 +02:00
Campbell Barton 7d3db7a3ae Cleanup: use C++ comments for disabled code
Also ensure space around text in C-comment blocks.
2022-04-13 13:47:04 +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
Brecht Van Lommel 86141a75eb Cleanup: fix typos in source code in intern/
Contributed by luzpaz.

Differential Revision: https://developer.blender.org/D13532
2022-01-05 15:35:30 +01: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 e04631f44a Cleanup: clang-tidy utfconv 2021-09-01 17:13:33 +10:00
Campbell Barton 5b91a52944 Cleanup: spelling 2021-03-12 00:51:29 +11:00
Campbell Barton 69e9e45744 Cleanup: macro hygiene, use parenthesis around operators 2021-02-13 17:40:10 +11:00
Dalai Felinto 2d1cce8331 Cleanup: `make format` after SortedIncludes change 2020-03-19 09:33:58 +01:00
Campbell Barton ace5677ef0 Cleanup: spelling, repeated words 2019-11-25 00:55:11 +11:00
Campbell Barton 6fc6f2504d Cleanup: use backslash for doxygen commands 2019-09-05 12:56:55 +10:00
Campbell Barton 59fb13c2b1 Cleanup: comments (long lines) in utfconv 2019-05-01 20:32:38 +10:00
Campbell Barton 108045faa0 ClangFormat: format '#if 0' code in intern/ 2019-04-17 08:17:13 +02: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 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
Phil Christensen 351c409317 C++ conformance fixes (MSVC /permissive-)
We (the Microsoft C++ team) use the Blender project as part of our "Real world code" tests.
I noticed a place in WIN32 specific code (dvpapi.cpp:85) where a string literal is losing
its const-ness when being passed to BLI_dynlib_open().  This is not permitted when using the
/permissive- conformance compiler switch (see our blog
https://blogs.msdn.microsoft.com/vcblog/2016/11/16/permissive-switch/)

My suggested fix is to add const and propagate it where needed.  Another possible fix would be
to explicitly cast away the const.

Reviewers: mont29, sergey, LazyDodo

Subscribers: Blendify, sergey, mont29, LazyDodo

Tags: #platform:_windows

Differential Revision: https://developer.blender.org/D2495
2017-02-06 10:44:56 +01:00
Sergey Sharybin 5d99cde822 Remove SCons building system
While SCons building system was serving us really good for ages it's no longer
having much attention by the developers and started to become quite a difficult
task to maintain.

What's even worse -- there started to be quite serious divergence between SCons
and CMake which was only accumulating over the releases now. The fact that none
of the active developers are really using SCons and that our main studio is also
using CMake spotting bugs in the SCons builds became quite a difficult task and
we aren't always spotting them in time.

Meanwhile CMake became really mature building system which is available on every
platform we support and arguably it's also easier and more robust to use.

This commit includes:

- Removal of actual SCons building system
- Removal of SCons git submodule
- Removal of documentation which is stored in the sources and covers SCons
- Tweaks to the buildbot master to stop using SCons submodule
  (this change requires deploying to the server)
- Tweaks to the install dependencies script to skip installing or mentioning
  SCons building system
- Tweaks to various helper scripts to avoid mention of SCons folders/files
  as well

Reviewers: mont29, dingto, dfelinto, lukastoenne, lukasstockner97, brecht, Severin, merwin, aligorith, psy-fi, campbellbarton, juicyfruit

Reviewed By: campbellbarton, juicyfruit

Differential Revision: https://developer.blender.org/D1680
2016-01-04 14:20:48 +05:00
Antony Riakiotakis 1206faeb99 Warning cleanup:
* Comparison in utf detection code always failed
* Cast to integer to silence grumpy 64bit gcc
2014-03-22 14:41:38 +02:00
Brecht Van Lommel eaf354e222 Fix related to #36319: restore SDL_VIDEODRIVER=dummy environment variable, it
seems that somehow not having this is causing keyboard events to be caught by
SDL. This was removed because it broke addons that could use SDL, now set the
environment variable only temporary during SDL initialization.

This may have been causing issues with keyboard events getting missed in the
game engine, but I couldn't confirm the issue here.
2013-09-23 14:48:28 +00:00
Campbell Barton 1777a69818 misc minor edits.
- pass string size to BLI_timestr() to avoid possible buffer overrun.
- quiet warning for mingw.
- include guards for windows utf conversion funcs.
- fix for mistage in edge-angle-selection check.
- some style cleanup.
2013-03-29 06:25:22 +00:00
Campbell Barton 10b4a86dbf code cleanup: quiet warnings building with mingw. 2013-03-29 00:50:52 +00:00
Brecht Van Lommel dcbfa25bc8 Fix #34551: blender crash rendering with save buffers.
Problem was the new usage of access() on Windows, this doesn't accept X_OK. Also wrapped _waccess so that UTF-8 paths work.
2013-03-13 19:48:07 +00:00
Campbell Barton c36f20a7d2 style cleanup 2013-03-08 04:00:06 +00:00
Campbell Barton 0528162eb6 patch [#34320] Cross compiling with mingw-w64 on ubuntu
from Martijn Berger (juicyfruit)

applying since this is only corrects header case which is ignored on windows anyway.
2013-02-19 12:05:38 +00:00
Bastien Montagne ab2c273b12 Added GPL header to sconscripts!
Also changed shebang to '#!/usr/bin/env python', this is more portable across unixes...
2012-12-17 08:01:43 +00:00
Campbell Barton 7ef78723b7 code cleanup: doxy comment corrections and correct own typo animation player docs. 2012-11-26 00:59:11 +00:00
Campbell Barton 25591e958d style cleanup: tabs & whitespace 2012-11-03 15:35:03 +00:00
Campbell Barton abce099804 code cleanup: quiet some windows warnings. 2012-09-15 04:57:51 +00:00
Campbell Barton a9f10b6bc2 style cleanup 2012-09-08 06:40:03 +00:00
Campbell Barton 1597ad9377 style cleanup 2012-07-01 09:54:44 +00:00
Campbell Barton 5189356d58 style cleanup 2012-06-04 20:11:09 +00:00
Campbell Barton 857dedbc58 style cleanup 2012-05-27 00:36:50 +00:00
Campbell Barton b340f930ec style cleanup: changes to brace placement / newlines - for/while/if/switch 2012-04-28 06:31:57 +00:00
Antony Riakiotakis 4782522379 Add libMV and Scons support for MinGW-w64, patches by Caleb Joseph with slight modifications.
Thanks!
2012-04-24 12:57:58 +00:00
Campbell Barton 8c70caf966 fix for UV reveal (wasnt selecting all verts because check for unselected vert was incorrect after selecting the first face). 2012-04-13 03:41:07 +00:00
Campbell Barton f8b7cfb6ae code cleanup: quiet some mingw warnings. 2012-04-12 02:50:21 +00:00
Campbell Barton 8fb067af93 code cleanup: avoid confusion with utfconv lib - was configuring this windows only lib on non windows platforms (scons only). 2012-04-12 02:37:28 +00:00
Campbell Barton cc1259178b code cleanup: utfconv library had some quite confusing formatting, also cleared som warnings. 2012-04-12 02:15:33 +00:00
Jason Wilkins dabcdc1532 Warning Fixes - const correctness in unicode encoding, unused variables in blenlib, and some type conversions
This is from a patch that is in the tracker, but it leaves out a fix of BLI_gzopen which needs more work.
2012-04-09 01:16:19 +00:00
Guillermo S. Romero d6fd5266d0 SVN maintenance. 2012-03-24 01:42:08 +00:00