summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorAnton Yabchinskiy <arn@bestmx.ru>2015-07-29 23:01:36 +0300
committerAnton Yabchinskiy <arn@bestmx.ru>2015-07-29 23:01:36 +0300
commitdc8df8a91a995796f0f330bf6bb6b209f6dfce08 (patch)
tree46cfe09124703b07860754d6b44e0289422e0573 /SConstruct
parent16746f157f83d666079ba3266acec13d35b84c3f (diff)
parent922356b903061cda7591090bf19e8346c3a78cf5 (diff)
Merge branch 'master' of github.com:okamstudio/godot
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct58
1 files changed, 58 insertions, 0 deletions
diff --git a/SConstruct b/SConstruct
index 0bc91fb42c..a0ed2e4828 100644
--- a/SConstruct
+++ b/SConstruct
@@ -111,6 +111,7 @@ opts.Add('jpg','JPG Image loader support (yes/no)','yes')
opts.Add('webp','WEBP Image loader support (yes/no)','yes')
opts.Add('dds','DDS Texture loader support (yes/no)','yes')
opts.Add('pvr','PVR (PowerVR) Texture loader support (yes/no)','yes')
+opts.Add('etc1','etc1 Texture compression 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')
@@ -122,6 +123,8 @@ 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('colored', 'Enable colored output for the compilation (yes/no)', 'no')
+opts.Add('extra_suffix', 'Custom extra suffix added to the base filename of all generated binary files.', '')
+opts.Add('vsproj', 'Generate Visual Studio Project. (yes/no)', 'no')
# add platform specific options
@@ -176,7 +179,29 @@ if selected_platform in platform_list:
else:
env = env_base.Clone()
+ if env['vsproj']=="yes":
+ env.vs_incs = []
+ env.vs_srcs = []
+
+ def AddToVSProject( sources ):
+ for x in sources:
+ if type(x) == type(""):
+ fname = env.File(x).path
+ else:
+ fname = env.File(x)[0].path
+ pieces = fname.split(".")
+ if len(pieces)>0:
+ basename = pieces[0]
+ basename = basename.replace('\\\\','/')
+ env.vs_srcs = env.vs_srcs + [basename + ".cpp"]
+ env.vs_incs = env.vs_incs + [basename + ".h"]
+ #print basename
+ env.AddToVSProject = AddToVSProject
+
env.extra_suffix=""
+
+ if env["extra_suffix"] != '' :
+ env.extra_suffix += '.'+env["extra_suffix"]
CCFLAGS = env.get('CCFLAGS', '')
env['CCFLAGS'] = ''
@@ -308,6 +333,8 @@ if selected_platform in platform_list:
if (env['colored']=='yes'):
methods.colored(sys,env)
+ if (env['etc1']=='yes'):
+ env.Append(CPPFLAGS=['-DETC1_ENABLED'])
Export('env')
@@ -324,6 +351,37 @@ if selected_platform in platform_list:
SConscript("main/SCsub")
SConscript("platform/"+selected_platform+"/SCsub"); # build selected platform
+
+ # Microsoft Visual Studio Project Generation
+ if (env['vsproj'])=="yes":
+
+ AddToVSProject(env.core_sources)
+ AddToVSProject(env.main_sources)
+ AddToVSProject(env.modules_sources)
+ AddToVSProject(env.scene_sources)
+ AddToVSProject(env.servers_sources)
+ AddToVSProject(env.tool_sources)
+
+ #env['MSVS_VERSION']='9.0'
+ env['MSVSBUILDCOM'] = "scons platform=" + selected_platform + " target=" + env["target"] + " bits=" + env["bits"] + " tools=yes"
+ env['MSVSREBUILDCOM'] = "scons platform=" + selected_platform + " target=" + env["target"] + " bits=" + env["bits"] + " tools=yes"
+ env['MSVSCLEANCOM'] = "scons platform=" + selected_platform + " target=" + env["target"] + " bits=" + env["bits"] + " tools=yes"
+
+ debug_variants = ['Debug|Win32']+['Debug|x64']
+ release_variants = ['Release|Win32']+['Release|x64']
+ release_debug_variants = ['Release_Debug|Win32']+['Release_Debug|x64']
+ variants = debug_variants + release_variants + release_debug_variants
+ debug_targets = ['Debug']+['Debug']
+ release_targets = ['Release']+['Release']
+ release_debug_targets = ['ReleaseDebug']+['ReleaseDebug']
+ targets = debug_targets + release_targets + release_debug_targets
+ msvproj = env.MSVSProject(target = ['#godot' + env['MSVSPROJECTSUFFIX'] ],
+ incs = env.vs_incs,
+ srcs = env.vs_srcs,
+ runfile = targets,
+ buildtarget = targets,
+ auto_build_solution=1,
+ variant = variants)
else: