This repository has been archived on 2023-10-09. You can view files and clone it, but cannot push or open issues or pull requests.
Files
blender-archive/source/blender/makesdna/intern/SConscript

73 lines
2.3 KiB
Python
Raw Normal View History

#!/usr/bin/python
import sys
import os
def normpath(path):
return os.path.abspath(os.path.normpath(path))
Import ('env')
cflags = ''
defines = []
root_build_dir=normpath(env['BF_BUILDDIR'])
2004-01-04 21:11:59 +00:00
source_files = ['makesdna.c']
header_files = env.Glob('../*.h')
2004-01-04 21:11:59 +00:00
makesdna_tool = env.Clone()
dna = env.Clone()
makesdna_tool.Append(CCFLAGS = '-DBASE_HEADER="\\"source/blender/makesdna/\\"" ')
2004-01-04 21:11:59 +00:00
makesdna_tool.Append (CPPPATH = ['#/intern/guardedalloc',
2011-03-17 23:30:29 +00:00
'../../makesdna', '../../blenloader', '../../bmesh'])
if env['OURPLATFORM'] == 'linuxcross':
USE_WINE = True # when cross compiling on linux 64bit this is useful
else:
USE_WINE = False
if not USE_WINE:
if env['OURPLATFORM'] == 'linuxcross':
makesdna_tool.Replace(CC='gcc')
makesdna_tool.Replace(AR='ar')
makesdna_tool.Replace(LINK='gcc')
if sys.platform != 'cygwin':
makesdna_tool.Append (CCFLAGS = cflags)
makesdna_tool.Append (CPPDEFINES = defines)
2009-09-16 17:43:09 +00:00
makesdna_tool.Append( CFLAGS = env['CFLAGS'])
makesdna_tool.Append( CCFLAGS = env['CCFLAGS'])
makesdna_tool.Append( LINKFLAGS = env['PLATFORM_LINKFLAGS'])
targetdir = normpath(root_build_dir+'/lib')
if not (root_build_dir[0]==os.sep or root_build_dir[1]==':'):
targetdir = '#'+targetdir
makesdna_tool.Append (LIBPATH = targetdir)
if env['BF_PROFILE']:
makesdna_tool.Append (LINKFLAGS = env['BF_PROFILE_LINKFLAGS'])
targetdir = normpath(root_build_dir + '/makesdna')
if not (root_build_dir[0]==os.sep or root_build_dir[1]==':'):
targetdir = '#' + targetdir
2010-09-07 05:47:34 +00:00
makesdna = makesdna_tool.Program (target = targetdir, source = source_files, LIBS=['bf_intern_guardedalloc', 'bf_blenlib'])
2004-01-04 21:11:59 +00:00
dna_dict = dna.Dictionary()
dna.Depends ('dna.c', makesdna)
dna.Depends ('dna.c', header_files)
if env['OURPLATFORM'] != 'linuxcross':
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc', 'win32-mingw'):
dna.Command ('dna.c', '', "\"" + root_build_dir+os.sep+"makesdna\" $TARGET")
else:
dna.Command ('dna.c', '', "\"" + root_build_dir+os.sep+"makesdna\" $TARGET")
else:
if USE_WINE:
dna.Command ('dna.c', '', 'wine ' + root_build_dir+os.sep+"makesdna $TARGET")
else:
dna.Command ('dna.c', '', root_build_dir+os.sep+"makesdna.exe $TARGET")
# TODO, get WITH_DNA_GHASH working, see CMake's 'WITH_DNA_GHASH'
obj = ['intern/dna.c', 'intern/dna_genfile.c']
2004-01-04 21:11:59 +00:00
Return ('obj')