Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2016-01-04 12:20:48 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2016-01-04 12:20:48 +0300
commit5d99cde8229a481363f1439ea4a4c2af851b1cb1 (patch)
tree76ebd7548ddb8eee0c7039e7f154ac982b57e80f /doc/build_systems/scons-dev.txt
parent1eb5e0b6608b2c2bbc9813d9155ea379a5bc8ef4 (diff)
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
Diffstat (limited to 'doc/build_systems/scons-dev.txt')
-rw-r--r--doc/build_systems/scons-dev.txt193
1 files changed, 0 insertions, 193 deletions
diff --git a/doc/build_systems/scons-dev.txt b/doc/build_systems/scons-dev.txt
deleted file mode 100644
index 9ca072c38c5..00000000000
--- a/doc/build_systems/scons-dev.txt
+++ /dev/null
@@ -1,193 +0,0 @@
-
- Internals of Blenders SCons scripts
- ===================================
-
- Scope
- ------
- This document describes the architecture of the SCons scripts for
- Blender. An overview of available functionality and how to modify,
- extend and maintain the system.
-
- Audience
- --------
- This document is for developers who need to modify the system,
- ie. add or remove new libraries, add new arguments for SCons, etc.
-
- Files and their meaning
- -----------------------
-
- The main entry point for the build system is the SConstruct-file in
- $BLENDERHOME. This file creates the first BlenderEnvironment to work
- with, reads in options, and sets up some directory structures. Further
- it defines some targets.
-
- Platform-specific configurations are in $BLENDERHOME/config. The
- filenames have the form (platform)-config.py, where platform one of:
-
- * darwin
- * linux
- * win32-mingw
- * win32-vc
-
- The user can override options by creating a file
- $BLENDERHOME/user-config.py. It can have any option from
- (platform)-config.py. Options in this file will override the platform
- defaults.
-
- Much of the actual functionality can be found in the python scripts
- in the directory $BLENDERHOME/build_files/scons/tools, with
- Blender.py defining the bulk of the functionality. btools.py has some
- helper functions, and bcolors.py is for the terminal
- colors. mstoolkit.py and crossmingw.py are modules which set up SCons
- for the MS VC++ 2003 toolkit and the cross-compile toolset for
- compiling Windows binaries on Linux respectively. Note: the
- cross-compile doesn't work yet for Blender, but is added in
- preparation for having it work in the distant future.
-
- BlenderEnvironment
- ------------------
-
- The module Blender.py implements a BlenderEnvironment class, derived
- from the SConsEnvironment of SCons. This is done to wrap some often
- used functionality. The BlenderEnvironment offers two important
- wrappers: BlenderProg() and BlenderLib(). The first one is used to
- specify a binary to be built, the second one is used to specify what
- static library is built from given sources.
-
- Build a static library called "somelib". The system handles library
- pre- and suffixes automatically, you don't need to bother yourself
- with these details:
-
- env = BlenderEnvironment(ENV = os.environ) # create an environment
- env.BlenderLib(libname="somelib", sources=['list.c','with.c','sources.c'],
- includes=['/list/with/include/paths', '.', '..'],
- defines=['LIST_WITH', 'CPP_DEFINES', 'TO_USE'],
- libtype=['blender', 'common'] # this is a list with libtypes. Normally you don't
- # need to specify this, but if you encounter linking
- # problems you may need this
- priority=[10, 20] # Priorities, list as long as libtype, priority per type
- compileflags=['/O2'] # List of compile flags needed for this particular library.
- # used only in rare cases, like SOLID, qhull and Bullet
- )
-
- There should be no need to ever add an extra BlenderProg to the
- existing ones in SConstruct, see that file for its use, and Blender.py
- for its implementation.
-
- The new system works so that using these wrappers, has all libraries
- (and programs) register with a central repository. This means that
- adding a new library is as easy as just creating the new SConscript
- and making sure that it gets called properly. Linking and such will
- then be handled automatically.
-
- If you want that adding new source files for a certain library
- is handled automatically, you can use the Glob() function from
- the BlenderEnvironment to create lists of needed files. See
- $BLENDERHOME/source/blender/src/SConscript for an example. Keep in
- mind that this will add any new file that complies to the rule given
- to the Glob() function. There are a few (external) libraries with
- which this can't be used, because it'd take files that shouldn't be
- compiled, and create subsequentially problems during the linking stage
- (like SOLID, qhull, Bullet).
-
- Linking order and priorities
- ----------------------------
-
- As shown above, you can give a library a priority in a certain
- group. If you need to make sure that a Blender library is linked
- before or after another one, you can give it a priority. To debug
- the priorities us BF_PRIORITYLIST=1 on the command-line while running
- a build.
-
- % scons BF_PRIORITYLIST=1
-
- This will give a list with values suggested by the system. Make
- changes to all SConscripts in question to reflect or change the
- values given by this command. ALWAYS check this after adding a new
- internal, external library or core library, and make sure there are
- sane values. You can use large and negative numbers to test with,
- but after you've got a working linking order, do change the system
- to reflect BF_PRIORITYLIST values.
-
- Also, if you find that a library needs to be given multiple times to
- the linker, you can do that by giving a python list with the names
- of the available library types. They are currently:
-
- B.possible_types = ['core', 'common', 'blender', 'intern',
- 'international', 'game', 'game2',
- 'player', 'player2', 'system']
-
- More groups can be added, but that should be carefully considered,
- as it may lead to large-scale changes. The current amount of libraries
- should suffice.
-
- The central repository is utilised in the SConstruct in two
- ways. Firstly, it is used to determine the order of all static
- libraries to link into the main Blender executable. Secondly, it
- is used to keep track of all built binaries and their location,
- so that they can be properly copied to BF_INSTALLDIR.
-
- The libraries can be fetched in their priority order with
- create_blender_liblist from Blender.py, see the SConstruct on how
- it is used.
-
- The program repository is the global list program_list from
- Blender.py. See SConstruct for its usage.
-
-
- Adding a new option and libraries
- ---------------------------------
-
- Lets say we want to add WITH_BF_NEWLIB, which will
- enable or disable a new feature library with sources in
- $BLENDERHOME/source/blender/newlib. This 'newlib' needs external
- headers from a 3rd party library '3rdparty'. For this we want to
- add a set of options BF_3RDPARTY, BF_3RDPARTY_INC, BF_3RDPARTY_LIB,
- BF_3RDPARTY_LIBPATH:
-
- 1) Add all mentiond options to all (platform)-config.py
- files. WITH_BF_NEWLIB is a boolean option ('true', 'false'),
- the rest are strings with paths and library names. See the
- OpenEXR options for example.
-
- 2) Add all options to the argument checking function
- validate_arguments() in btools.py. See again OpenEXR options
- for example.
-
- 3) Add all options to the option reading function read_opts()
- in btools.py. See again OpenEXR options for example. All default
- values can be empty, as the actual default values are in the
- (platform)-config.py files.
-
- 4) Add BF_3RDPARTY_LIB to the function setup_syslibs()
- and BF_3RDPARTY_LIBPATH to the function setup_staticlibs()
- in Blender.py
-
- At this stage we have prepared all option setting and linking needs,
- but we still need to add in the compiling of the 'newlib'.
-
- 5) Create a SConscript in $BLENDERHOME/source/blender/newlib. Look
- at ie. $BLENDERHOME/source/blender/src/SConscript for
- template. The new SConscript will register the new library
- like so:
-
- env.BlenderLib(libname='newlib', sources=sourcefiles, includes=incs) # the rest of the arguments get defaults = empty lists and values
-
- 6) Edit $BLENDERHOME/source/blender/SConscript with the following
- addition:
-
- if env['WITH_BF_NEWLIB'] == 1:
- SConscript(['newlib/SConscript'])
-
- After this you can see if this works by trying to build:
-
- % scons WITH_BF_NEWLIB=1 # build with newlib
- % scons WITH_BF_NEWLIB=0 # disable newlib
-
- This is all what should be needed. Changing the library name doesn't
- need changes elsewhere in the system, as it is handled automatically
- with the central library repository.
-
- Enjoy the new system!!
-
- /Nathan Letwory (jesterKing)