Skip to content

Commit

Permalink
Build System Changes
Browse files Browse the repository at this point in the history
-=-=-=-=-=-=-=-=-=-=

Build System:
-Big clean up of SCons, changed how builds are done to a much cleaner method (check the Github Wiki for instructions).
-Deactivated BlackBerry10 (sorry), if no mantainer found (or BlackBerry does not send us a Passort ;), platform will be removed as we have no longer devices to test.

Engine:
-Removed deprecated object and scene format (was in there just for compatibility, not in use since a long time).
-Added ability to open scenes even if a node type was removed (will try to guess the closest type).
-Removed deprecated node types.
  • Loading branch information
reduz committed Oct 7, 2014
1 parent a0ae38e commit 0fa94a9
Show file tree
Hide file tree
Showing 72 changed files with 888 additions and 10,490 deletions.
140 changes: 67 additions & 73 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,6 @@ import sys
import methods
import multiprocessing

# Enable aggresive compile mode if building on a multi core box
# only is we have not set the number of jobs already or we do
# not want it
if ARGUMENTS.get('spawn_jobs', 'no') == 'yes' and \
int(GetOption('num_jobs')) <= 1:
NUM_JOBS = multiprocessing.cpu_count()
if NUM_JOBS > 1:
SetOption('num_jobs', NUM_JOBS+1)

methods.update_version()

# scan possible build platforms
Expand Down Expand Up @@ -58,8 +49,7 @@ for x in glob.glob("platform/*"):
module_list=methods.detect_modules()


print "Detected Platforms: "+str(platform_list)
print("Detected Modules: "+str(module_list))
#print "Detected Platforms: "+str(platform_list)

methods.save_active_platforms(active_platforms,active_platform_ids)

Expand Down Expand Up @@ -99,19 +89,15 @@ if profile:
customs.append(profile+".py")

opts=Variables(customs, ARGUMENTS)
opts.Add('target', 'Compile Target (debug/profile/release).', "debug")
opts.Add('platform','Platform: '+str(platform_list)+'(sfml).',"")
opts.Add('python','Build Python Support: (yes/no)','no')
opts.Add('squirrel','Build Squirrel Support: (yes/no)','no')
opts.Add('target', 'Compile Target (debug/release_debug/release).', "debug")
opts.Add('bits', 'Compile Target Bits (default/32/64).', "default")
opts.Add('platform','Platform: '+str(platform_list)+'.',"")
opts.Add('p','Platform (same as platform=).',"")
opts.Add('tools','Build Tools (Including Editor): (yes/no)','yes')
opts.Add('lua','Build Lua Support: (yes/no)','no')
opts.Add('rfd','Remote Filesystem Driver: (yes/no)','no')
opts.Add('gdscript','Build GDSCript support: (yes/no)','yes')
opts.Add('vorbis','Build Ogg Vorbis Support: (yes/no)','yes')
opts.Add('minizip','Build Minizip Archive Support: (yes/no)','yes')
opts.Add('opengl', 'Build OpenGL Support: (yes/no)', 'yes')
opts.Add('game', 'Game (custom) Code Directory', "")
opts.Add('squish','Squish BC Texture Compression (yes/no)','yes')
opts.Add('squish','Squish BC Texture Compression in editor (yes/no)','yes')
opts.Add('theora','Theora Video (yes/no)','yes')
opts.Add('freetype','Freetype support in editor','yes')
opts.Add('speex','Speex Audio (yes/no)','yes')
Expand All @@ -124,15 +110,12 @@ opts.Add('pvr','PVR (PowerVR) Texture loader support (yes/no)','yes')
opts.Add('builtin_zlib','Use built-in zlib (yes/no)','yes')
opts.Add('openssl','Use OpenSSL (yes/no/builtin)','no')
opts.Add('musepack','Musepack Audio (yes/no)','yes')
opts.Add('default_gui_theme','Default GUI theme (yes/no)','yes')
opts.Add("CXX", "Compiler");
opts.Add("nedmalloc", "Add nedmalloc support", 'yes');
opts.Add("CCFLAGS", "Custom flags for the C++ compiler");
opts.Add("CFLAGS", "Custom flags for the C compiler");
opts.Add("LINKFLAGS", "Custom flags for the linker");
opts.Add('disable_3d', 'Disable 3D nodes for smaller executable (yes/no)', "no")
opts.Add('disable_advanced_gui', 'Disable advance 3D gui nodes and behaviors (yes/no)', "no")
opts.Add('old_scenes', 'Compatibility with old-style scenes', "yes")

# add platform specific options

Expand All @@ -152,7 +135,6 @@ Help(opts.GenerateHelpText(env_base)) # generate help
env_base.Append(CPPPATH=['#core','#core/math','#tools','#drivers','#'])

# configure ENV for platform
env_base.detect_python=True
env_base.platform_exporters=platform_exporters

"""
Expand All @@ -170,17 +152,26 @@ if (env_base['target']=='debug'):
env_base.platforms = {}


for p in platform_list:
selected_platform =""

if env_base['platform'] != "" and env_base['platform'] != p:
continue
sys.path.append("./platform/"+p)
if env_base['platform'] != "":
selected_platform=env_base['platform']
elif env_base['p'] != "":
selected_platform=env_base['p']
env_base["platform"]=selected_platform


if selected_platform in platform_list:

sys.path.append("./platform/"+selected_platform)
import detect
if "create" in dir(detect):
env = detect.create(env_base)
else:
env = env_base.Clone()

env.extra_suffix=""

CCFLAGS = env.get('CCFLAGS', '')
env['CCFLAGS'] = ''

Expand All @@ -197,17 +188,49 @@ for p in platform_list:
env.Append(LINKFLAGS=string.split(str(LINKFLAGS)))

detect.configure(env)
env['platform'] = p
if not env.has_key('platform_libsuffix'):
env['platform_libsuffix'] = env['LIBSUFFIX']
sys.path.remove("./platform/"+p)
sys.modules.pop('detect')

flag_list = platform_flags[p]

flag_list = platform_flags[selected_platform]
for f in flag_list:
if not (f[0] in ARGUMENTS): # allow command line to override platform flags
env[f[0]] = f[1]
print(f[0]+":"+f[1])

#env['platform_libsuffix'] = env['LIBSUFFIX']

suffix="."+selected_platform

if (env["target"]=="release"):
if (env["tools"]=="yes"):
print("Tools can only be built with targets 'debug' and 'release_debug'.")
sys.exit(255)
suffix+=".opt"

elif (env["target"]=="release_debug"):
if (env["tools"]=="yes"):
suffix+=".opt.tools"
else:
suffix+=".opt.debug"
else:
if (env["tools"]=="yes"):
suffix+=".tools"
else:
suffix+=".debug"

if (env["bits"]=="32"):
suffix+=".32"
elif (env["bits"]=="64"):
suffix+=".64"

suffix+=env.extra_suffix

env["PROGSUFFIX"]=suffix+env["PROGSUFFIX"]
env["OBJSUFFIX"]=suffix+env["OBJSUFFIX"]
env["LIBSUFFIX"]=suffix+env["LIBSUFFIX"]
env["SHLIBSUFFIX"]=suffix+env["SHLIBSUFFIX"]

sys.path.remove("./platform/"+selected_platform)
sys.modules.pop('detect')


env.module_list=[]

Expand All @@ -218,7 +241,7 @@ for p in platform_list:
sys.path.append(tmppath)
env.current_module=x
import config
if (config.can_build(p)):
if (config.can_build(selected_platform)):
config.configure(env)
env.module_list.append(x)
sys.path.remove(tmppath)
Expand All @@ -232,11 +255,6 @@ for p in platform_list:
if (env['openssl']=="builtin"):
env.Append(CPPPATH=['#drivers/builtin_openssl2'])


if (env["old_scenes"]=='yes'):
env.Append(CPPFLAGS=['-DOLD_SCENE_FORMAT_ENABLED'])
if (env["rfd"]=='yes'):
env.Append(CPPFLAGS=['-DRFD_ENABLED'])
if (env["builtin_zlib"]=='yes'):
env.Append(CPPPATH=['#drivers/builtin_zlib/zlib'])

Expand Down Expand Up @@ -281,34 +299,6 @@ for p in platform_list:
if (env['xml']=='yes'):
env.Append(CPPFLAGS=['-DXML_ENABLED'])

if (env['default_gui_theme']=='no'):
env.Append(CPPFLAGS=['-DDEFAULT_THEME_DISABLED'])

if (env["python"]=='yes'):
detected=False;
if (env.detect_python):
print("Python 3.0 Prefix:");
pycfg_exec="python3-config"
errorval=os.system(pycfg_exec+" --prefix")
prefix=""
if (not errorval):
#gah, why can't it get both at the same time like pkg-config, sdl-config, etc?
env.ParseConfig(pycfg_exec+" --cflags")
env.ParseConfig(pycfg_exec+" --libs")
detected=True

if (detected):
env.Append(CPPFLAGS=['-DPYTHON_ENABLED'])
#remove annoying warnings
if ('-Wstrict-prototypes' in env["CCFLAGS"]):
env["CCFLAGS"].remove('-Wstrict-prototypes');
if ('-fwrapv' in env["CCFLAGS"]):
env["CCFLAGS"].remove('-fwrapv');
else:
print("Python 3.0 not detected ("+pycfg_exec+") support disabled.");

#if env['nedmalloc'] == 'yes':
# env.Append(CPPFLAGS = ['-DNEDMALLOC_ENABLED'])

Export('env')

Expand All @@ -321,11 +311,15 @@ for p in platform_list:
SConscript("drivers/SCsub")
SConscript("bin/SCsub")

if env['game']:
SConscript(env['game']+'/SCsub')

SConscript("modules/SCsub")
SConscript("main/SCsub")

SConscript("platform/"+p+"/SCsub"); # build selected platform
SConscript("platform/"+selected_platform+"/SCsub"); # build selected platform

else:

print("No valid target platform selected.")
print("The following were detected:")
for x in platform_list:
print("\t"+x)
print("\nPlease run scons again with argument: platform=<string>")
2 changes: 1 addition & 1 deletion core/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ SConscript('math/SCsub');
SConscript('io/SCsub');
SConscript('bind/SCsub');

lib = env.Library("core",env.core_sources, LIBSUFFIX=env['platform_libsuffix'])
lib = env.Library("core",env.core_sources)

env.Prepend(LIBS=[lib])

Expand Down
8 changes: 8 additions & 0 deletions core/bind/core_bind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -886,6 +886,12 @@ Dictionary _Geometry::make_atlas(const Vector<Size2>& p_rects) {
};


int _Geometry::get_uv84_normal_bit(const Vector3& p_vector) {

return Geometry::get_uv84_normal_bit(p_vector);
}


void _Geometry::_bind_methods() {


Expand All @@ -900,6 +906,8 @@ void _Geometry::_bind_methods() {

ObjectTypeDB::bind_method(_MD("get_closest_point_to_segment","point","s1","s2"),&_Geometry::get_closest_point_to_segment);

ObjectTypeDB::bind_method(_MD("get_uv84_normal_bit","normal"),&_Geometry::get_uv84_normal_bit);

ObjectTypeDB::bind_method(_MD("ray_intersects_triangle","from","dir","a","b","c"),&_Geometry::ray_intersects_triangle);
ObjectTypeDB::bind_method(_MD("segment_intersects_triangle","from","to","a","b","c"),&_Geometry::segment_intersects_triangle);
ObjectTypeDB::bind_method(_MD("segment_intersects_sphere","from","to","spos","sradius"),&_Geometry::segment_intersects_sphere);
Expand Down
1 change: 1 addition & 0 deletions core/bind/core_bind.h
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ class _Geometry : public Object {
DVector<Vector3> segment_intersects_cylinder( const Vector3& p_from, const Vector3& p_to, float p_height,float p_radius);
DVector<Vector3> segment_intersects_convex(const Vector3& p_from, const Vector3& p_to,const Vector<Plane>& p_planes);
real_t segment_intersects_circle(const Vector2& p_from, const Vector2& p_to, const Vector2& p_circle_pos, real_t p_circle_radius);
int get_uv84_normal_bit(const Vector3& p_vector);

Vector<int> triangulate_polygon(const Vector<Vector2>& p_polygon);

Expand Down
Loading

0 comments on commit 0fa94a9

Please sign in to comment.