Commit Graph

65 Commits

Author SHA1 Message Date
Campbell Barton
49594c37ae License headers: use SPDX-FileCopyrightText for CMake files 2023-06-14 23:36:23 +10:00
Campbell Barton
42a6c226d0 CMake: fix AUDASPACE disabling WITH_PYTHON for Blender
When AUDASPACE couldn't find NUMPY, it would disable WITH_PYTHON for
the rest of Blender. Now setting the value globally is only done for
standalone AUDASPACE builds. Now it's possible to build Blender with
AUDASPACE & PYTHON but without NUMPY.

While this isn't an especially important configuration to support,
having Python mysteriously disabled is a hassle to troubleshoot.

NOTE: extern/audaspace/CMakeLists.txt has become out sync with the
original [0], it seems this is being maintained in our repository.

[0]: https://github.com/neXyon/audaspace/blob/master/CMakeLists.txt
2022-05-20 11:18:49 +10:00
Campbell Barton
1df8a5f8fb File headers: use SPDX license for CMake files 2022-02-11 14:23:56 +11:00
Sergey Sharybin
517870a4a1 CMake: Refactor external dependencies handling
This is a more correct fix to the issue Brecht was fixing in D6600.

While the fix in that patch worked fine for linking it broke ASAN
runtime under some circumstances.
For example, `make full debug developer` would compile, but trying
to start blender will cause assert failure in ASAN (related on check
that ASAN is not running already).

Top-level idea: leave it to CMake to keep track of dependency graph.

The root of the issue comes to the fact that target like "blender" is
configured to use a lot of static libraries coming from Blender sources
and to use external static libraries. There is nothing which ensures
order between blender's and external libraries. Only order of blender
libraries is guaranteed.

It was possible that due to a cycle or other circumstances some of
blender libraries would have been passed to linker after libraries
it uses, causing linker errors.

For example, this order will likely fail:

  libbf_blenfont.a libfreetype6.a libbf_blenfont.a

This change makes it so blender libraries are explicitly provided
their dependencies to an external libraries, which allows CMake to
ensure they are always linked against them.

General rule here: if bf_foo depends on an external library it is
to be provided to LIBS for bf_foo.
For example, if bf_blenkernel depends on opensubdiv then LIBS in
blenkernel's CMakeLists.txt is to include OPENSUBDIB_LIBRARIES.

The change is made based on searching for used include folders
such as OPENSUBDIV_INCLUDE_DIRS and adding corresponding libraries
to LIBS ion that CMakeLists.txt. Transitive dependencies are not
simplified by this approach, but I am not aware of any downside of
this: CMake should be smart enough to simplify them on its side.
And even if not, this shouldn't affect linking time.

Benefit of not relying on transitive dependencies is that build
system is more robust towards future changes. For example, if
bf_intern_opensubiv is no longer depends on OPENSUBDIV_LIBRARIES
and all such code is moved to bf_blenkernel this will not break
linking.

The not-so-trivial part is change to blender_add_lib (and its
version in Cycles). The complexity is caused by libraries being
provided as a single list argument which doesn't allow to use
different release and debug libraries on Windows. The idea is:

- Have every library prefixed as "optimized" or "debug" if
  separation is needed (non-prefixed libraries will be considered
  "generic").

- Loop through libraries passed to function and do simple parsing
  which will look for "optimized" and "debug" words and specify
  following library to corresponding category.

This isn't something particularly great. Alternative would be to
use target_link_libraries() directly, which sounds like more code
but which is more explicit and allows to have more flexibility
and control comparing to wrapper approach.

Tested the following configurations on Linux, macOS and Windows:

- make full debug developer
- make full release developer
- make lite debug developer
- make lite release developer

NOTE: Linux libraries needs to be compiled with D6641 applied,
otherwise, depending on configuration, it's possible to run into
duplicated zlib symbols error.

Differential Revision: https://developer.blender.org/D6642
2020-01-23 16:59:18 +01:00
Sergey Sharybin
b92d777d16 Fix compilation error when using SDL dynamic loading 2019-04-18 12:10:08 +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
5498e7f193 CMake: add library deps to CMakeLists.txt
Tested to work on Linux and macOS.

This will be enabled once all platforms are verified.

See D4684
2019-04-16 06:20:52 +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
Jörg Müller
986267300b Audaspace: Moving audaspace 1.3 into extern.
Deleting the old internal audaspace.

Major changes from there are:
- The whole library was refactored to use C++11.
- Many stability and performance improvements.
- Major Python API refactor:
 - Most requested: Play self generated sounds using numpy arrays.
 - For games: Sound list, random sounds and dynamic music.
 - Writing sounds to files.
 - Sequencing API.
 - Opening sound devices, eg. Jack.
- Ability to choose different OpenAL devices in the user settings.
2017-08-18 08:24:12 +02:00
Sergey Sharybin
2c515df83d Audaspace: Don't use strict flags 2017-05-30 10:58:12 +02:00
Campbell Barton
d04ad07f98 Quiet audaspace unused macro warnings 2015-10-23 18:40:42 +11:00
Jörg Müller
6a80c2c48b Audaspace: fix for building with scons.
Removed duplicated code.
CMake so far built only the now removed version and scons tried to build both.
2015-08-29 22:42:20 +02:00
Jörg Müller
a0cbebf404 Audaspace: fixing problems for the merge to master suggested by Campbell and Sergey.
- rename WITH_EXTERNAL_AUDASPACE to WITH_SYSTEM_AUDASPACE.
- rename C/PYAUDASPACE to AUDASPACE_C/PY
- simplifying cmake defines and includes.
- fixing include paths and enabling WITH_SYSTEM_AUDASPACE for windows.
- fixing scons building.
- other minor build system fixes.
2015-07-28 14:01:53 +02:00
Jörg Müller
733073550f Audaspace: use standalone library.
- Added the cmake configuration option WITH_EXTERNAL_AUDASPACE.
- Fixes to build without standalone library as well.
2015-07-28 14:01:52 +02:00
Sergey Sharybin
6cd82dbf57 CMake: Enable strict flags for C++ 2015-03-27 18:23:31 +05:00
Sergey Sharybin
31eee77a45 Fix #33518: Jack sync doesn't work in 2.64, 2.64 or 2.65 stable versions
Added new build option WITH_JACK_DYNLOAD for CMake and
WITH_BF_JACK_DYNLOAD for SCons, which means there'll be
no build-time linking against libjack and getting symbols
from libjack will happen runtime using dlopen and dlsym
tricks.

Alternative would be to use weak linking, but it'll require
having wrapper for preloading libjack.

This new options are disabled by default and they only
intended to be used on linux. Other platforms shall not
be using this and there shall be no functional changes
on non-linux platforms at all.
2013-03-27 07:19:54 +00:00
Campbell Barton
08f39daf4e cmake wouldn't build since it was missing files added in r52858. 2012-12-11 05:57:42 +00:00
Joerg Mueller
245345fba5 Audaspace:
Implemented forgotten Calculator classes from boost migration.
2012-12-10 16:58:47 +00:00
Sergey Sharybin
a1b954d608 Update CMake rules for audaspace 2012-11-05 14:47:28 +00:00
Joerg Mueller
5a8d5f77af Audaspace:
Replacing AUD_Reference with boost::shared_ptr.
2012-11-05 14:24:35 +00:00
Joerg Mueller
e66ee1ca9f Audaspace:
RAII locking implementation. This should fix bug [#32096] Background music stops when playing 3D sounds.
2012-10-24 21:33:44 +00:00
Sergey Sharybin
a7a79322bf Make blender compilable by gcc-4.7 and strict compilation flags:
- Remove strict flags from files, which are using FFmpeg stuff
  We're still using some symbols which are marked as deprecated.
  Ideally, we shall switch to new API, but it's a bit larger challenge
  because we don't want to break compatibility withotu actual need.
- Replace MAKE_ID with BT_MAKE_ID in bullet library.
  This is needed to prevent re-definition of MAKE_ID in bullet library.
  Seems it's only used to read blender files, so should be quite safe
  change.
2012-05-14 13:31:38 +00:00
Sergey Sharybin
f26d7010ef Don't compile AUD_JOSResampleReaderCoeff.cpp twice (it's included in AUD_JOSResampleReader.cpp)
Patch from nico_ga, thanks!
2011-11-08 16:24:31 +00:00
Campbell Barton
4a04f72069 remove $Id: tags after discussion on the mailign list: http://markmail.org/message/fp7ozcywxum3ar7n 2011-10-23 17:52:20 +00:00
Joerg Mueller
4bafd13eaf Missed some stoff when removing libsamplerate. 2011-10-02 18:08:16 +00:00
Joerg Mueller
07ad83a439 * Removing libsamplerate from build systems
* Enabling OpenAL for scons win64-vc in default config; Nathan or Sergey: please update the build bot to build with OpenAL!
2011-10-02 17:09:39 +00:00
Campbell Barton
8f5112f191 pep8 update & some minor cmake edits. 2011-09-20 18:29:19 +00:00
Joerg Mueller
947d4a654b Fix for [#25062] Sound Actuator - Positional Audio.
Now all sounds that are not mono but have 3D checked automatically get reduced to mono during BGE conversion time.
Also removed the now unneeded function sound_get_channels and added a missing header file to audaspace's CMakeLists.txt.
2011-08-30 10:09:10 +00:00
Joerg Mueller
c334bf69a7 3D Audio GSoC:
Mixdown functionality.

* Mixdown possible via libsndfile and ffmpeg!
* Fixed some ffmpeg deprecation warnings
* Mixdown UI only shows working Container, Codec and Format combinations!
* Minor bugs and warnings fixed
2011-08-06 17:57:20 +00:00
Joerg Mueller
bc1650a226 3D Audio GSoC:
Implementation of Julius O. Smith's resampling algorithm for high quality audio resampling.

The filter currently is a sinc filter with a 0.9 cutt-off and windowed by a kaiser window (beta = 10).
Also includes minor changes in the linear resampler.
2011-08-04 13:47:15 +00:00
Joerg Mueller
9077b8bffc 3D Audio GSoC:
Main: Complete rewrite of the sequencer related audio code to support 3D Audio objects later and especially adressing the animation system problems (see mailing list if interested).
Note: Animation is not working yet, so with this commit volume animation doesn't work anymore, that's the next step.

Minor things:
* Changed AUD_Reference behaviour a little to be more usage safe.
* Fixed bug in AUD_I3DHandle: Missing virtual destructor
* Fixed enmus in AUD_Space.h
* Fixed a warning in rna_scene.c
* Removed an unneeded call in rna_sound.c
2011-07-26 13:56:31 +00:00
Joerg Mueller
4532bd731d Merge with trunk up to r38584. 2011-07-21 21:11:58 +00:00
Campbell Barton
5792bd7cc7 cmake: cleanup include paths, some duplicates and going up some unneeded dirs. 2011-07-17 09:11:13 +00:00
Campbell Barton
410c5e3cd2 cmake source definitions:
remove missing includes and use more strict formatting.
2011-07-16 23:01:14 +00:00
Joerg Mueller
8e6b5598e0 3D Audio GSoC:
Adapting all readers to maximally support dynamic resampling/rechanneling, introducing a DynamicIIRFilter for example.
2011-06-21 20:35:09 +00:00
Joerg Mueller
6d5b224184 3D Audio GSoC:
Removing unneeded AUD_ResampleFactory.
2011-06-21 20:32:25 +00:00
Joerg Mueller
fba07308bf 3D Audio GSoC:
- Converting AUD_SampleRate to a double
- Removing AUD_DefaultMixer
- Introducing AUD_ResampleReader as base class for all resampling readers.
2011-06-21 20:29:02 +00:00
Joerg Mueller
044887b5a4 3D Audio GSoC:
- Created Handle classes
- Changed Reference counting completely
- Fixing some streaming bugs
- Completely disabled OpenAL Buffered Factories (they were unused anyway)
2011-06-21 20:21:43 +00:00
Campbell Barton
968b2a8afb rename cmake include/libraries to conform with suggested cmake names 2011-06-18 14:12:54 +00:00
Campbell Barton
549c2c58a1 added FindSndFile cmake module to replace inline checks. 2011-06-18 12:12:19 +00:00
Campbell Barton
b434550edc fix for recent cmake changes 2011-05-31 09:27:33 +00:00
Campbell Barton
09da9d4393 cmake maintenance
blender_add_lib now takes a separate include argument to suppress warnings in system includes (mostly ffmpeg & python).
also only build wm_apple.c on apple+carbon configuration.
2011-05-31 01:15:44 +00:00
Peter Schlaile
42121590f4 == FFMPEG ==
Added central compatibility header file, which enables blender to compile
against very old ffmpeg versions as well as very new versions using the
*NEW* API. (Old API functions are simulated using macros and inline functions)

Added a whole lot of additional checks, tested against 6 different versions
down the timeline, hopefully, now finally all is well.
2011-05-27 23:33:40 +00:00
Campbell Barton
1bd0db59f4 use cmake defined names for jpeg, png, zlib and python libs, building on *nix with non-standard libjpeg/png/zlib locations was broken.
in the case of python this makes it easier to move to find_package(PythonLibs) when 3.x is supported.
2011-01-25 14:43:13 +00:00
Campbell Barton
5e382eb8e5 rename blenderlib to blender_add_lib 2010-12-22 23:09:30 +00:00
Campbell Barton
afacd18498 use lowercase for cmake builtin names and macros, remove contents in else() and endif() which is no longer needed. 2010-12-08 08:43:06 +00:00
Campbell Barton
42d6603cae Add option for CMake to build libredcode, also use CODEC prefix for ffmpeg, quicktime & sndfile options. 2010-11-30 18:52:39 +00:00
Campbell Barton
e8397e6193 include headers in cmake source, added a script to check for consistency, reporting missing headers & C files.
this is important so IDE's using CMake integration always get blender headers. - QtCreator & MSVC for eg, probably others too.
2010-11-29 04:35:56 +00:00
Campbell Barton
c85c2746df WITH_SAMPLERATE option for cmake, without this playback wont behave right so this is mainly intended for developers who build without audio enabled. 2010-11-21 14:32:55 +00:00
Campbell Barton
0876fce009 rename and negate DISABLE_PYTHON --> WITH_PYTHON 2010-10-31 04:11:39 +00:00