summaryrefslogtreecommitdiffstats
path: root/build/SConscript.main
diff options
context:
space:
mode:
authorsgk@google.com <sgk@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-19 08:10:30 +0000
committersgk@google.com <sgk@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-19 08:10:30 +0000
commit9e483ab325445c4070e2ea86e1b57beb652c2590 (patch)
tree0a1bd25386b08e314cd398091cff336f9a6bf7d6 /build/SConscript.main
parentad04a7013db13a4402160e8596ab2f7e4f19fb0d (diff)
downloadchromium_src-9e483ab325445c4070e2ea86e1b57beb652c2590.zip
chromium_src-9e483ab325445c4070e2ea86e1b57beb652c2590.tar.gz
chromium_src-9e483ab325445c4070e2ea86e1b57beb652c2590.tar.bz2
Initial generation of native Visual Studio solution files
(project files still to come). To wit: * Solution file configuration is in *_sln.scons files (base\base_sln.scons, chrome\chrome_sln.scons). * Individual Project file configuration is in the the .scons file for the relevant target (base\base_unittests.scons, third_party\libxml\libxml.scons, etc.)--that is, where their file lists will live. * MSVSProject() calls are currently placeholders that establish the existence of Project Nodes (and Project dependencies) but don't yet have actual Project configuration information (file lists, .vsprops, etc.). * Configuraiton is very manual. In particular, the entries in the .sln file will be written out in exactly the order specified in the configuration(s). The current ordering is taken from our existing .sln files, so we can generate virtually the same configurations on output. * Generated solution files are nearly byte-for-byte identical with our existing .sln files, modulo: * net\dump_cache has a WebsiteProperties sections (making that configurable per project isn't important right now); * sandbox\sandbox.sln was missing a dependency of base.vcproj on on debug_message.vcproj (present in other .sln files) * webkit\webkit.sln was missing dependencies of WebCore.vcproj on libxml_config.vcproj and libxslt_config.vcproj (present in chrome.sln); * add a handful of other miscellaneous missing dependencies on various .vcproj definitions in chrome.sln (present in other .sln files). * remove stats_viewer.csproj from chrome.sln (sorry, mbelshe), which was complicating the solution configuration with unnecessary (for us) "Mixed Platform" types; * All MSVSFolder(), MSVSProject() and MSVSSolution() calls have hard-wired guid= values taken from our existing configuration, so we can: 1) verify generation of working configs; 2) minimize diffs when checking in generated .sln files. We can remove these in the future in favor of extracting them from existing .sln files if we wish. * Add ChromeMSVSFolder(), ChromeMSVSProject() and ChromeMSVSSolution() wrappers to chromium_builders.py, that gate the underlying call to the env.MSVS*() builders based on whether env.Bit('msvs') is set (i.e., we're in --mode=msvs). * Remove platform-specific gating of to-be-ported .scons files that we now need to load on any platform to generate coheren MSVS files. Move the env.Bit('windows') tests for actually building their executables into the individual .scons files. Review URL: http://codereview.chromium.org/14472 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7297 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build/SConscript.main')
-rw-r--r--build/SConscript.main76
1 files changed, 71 insertions, 5 deletions
diff --git a/build/SConscript.main b/build/SConscript.main
index fff2233..07d01ad3 100644
--- a/build/SConscript.main
+++ b/build/SConscript.main
@@ -379,6 +379,35 @@ windows_opt.Tool('target_optimized')
windows_opt.ApplySConscript(['$CHROME_SRC_DIR/build/release.scons'])
# --------------------------------------------------------------------------
+# Platform-independent "msvs" mode for generating Visual Studio
+# project and solution files from any platform.
+
+DeclareBit('msvs', 'Generate Visual Studio files')
+
+msvs_env = windows_env.Clone()
+
+msvs_env.Tool('target_platform_windows')
+msvs_env.Tool('component_targets_msvs') # Per target project support.
+
+del msvs_env['BUILDERS']['MSVSProject']
+del msvs_env['BUILDERS']['MSVSSolution']
+msvs_env.Tool('MSVSNew')
+
+msvs_env.Tool('midl')
+
+environment_list.append(msvs_env)
+msvs_env.Replace(
+ BUILD_TYPE = 'msvs',
+ BUILD_TYPE_DESCRIPTION = 'Generate Visual Studio files',
+ HOST_PLATFORMS = ['*'],
+ ICU_LIBS = [],
+)
+msvs_env.SetBits('windows', 'msvs')
+# TODO(sgk): turn into separate debug + release env adding
+# to a common .sln file
+msvs_env.Tool('target_debug')
+
+# --------------------------------------------------------------------------
# Linux specific
linux_env = root_env.Clone()
@@ -624,6 +653,30 @@ mac_env.Append(
)
+# --------------------------------------------------------------------------
+# Platform-independent "xcode" mode for generating XCode files
+# from any platform.
+
+DeclareBit('xcode', 'Generate XCode files')
+
+# TODO(sgk): remove this after we update Hammer modules.
+DeclareBit('mac', 'Target platform is mac.')
+
+xcode_env = mac_env.Clone()
+# TODO(sgk): uncomment when xcode generation becomes real.
+#environment_list.append(xcode_env)
+xcode_env.Replace(
+ BUILD_TYPE = 'xcode',
+ BUILD_TYPE_DESCRIPTION = 'Generate XCode files',
+ HOST_PLATFORMS = ['*'],
+ ICU_LIBS = [],
+)
+xcode_env.SetBits('mac', 'xcode')
+# TODO(sgk): turn into separate debug + release env adding
+# to a common .sln file
+xcode_env.Tool('target_debug')
+
+
# -------------------------------------------------------------------------
@@ -671,11 +724,6 @@ if GetOption('help'):
Help(help_fmt % (components, all_system_libs))
-
-Import('build_component')
-Default(None) # Reset default target to empty.
-Default(Alias(build_component)) # Set default target based on where built.
-
# -------------------------------------------------------------------------
# Invoke all the SConscripts in each of the environments that make sense on
@@ -684,6 +732,24 @@ BuildComponents(environment_list)
# -------------------------------------------------------------------------
+Default(None) # Reset default target to empty.
+
+modes = GetTargetModes().keys()
+
+if set(modes) - set(['msvs', 'xcode']):
+ # There's at least one mode being built besides the platform-
+ # independent 'msvs' or 'xcode' modes. Build the current
+ # build_component's Alias as default--that is, "base" when we're
+ # in the base/ subdirectory, "chrome" under chrome/, etc.
+ Import('build_component')
+ Default(Alias(build_component)) # Set default target based on where built.
+
+if 'msvs' in modes:
+ # We're in --mode=msvs, so add its Alias(es) to the default targets.
+ Default(Alias('solutions'))
+
+# -------------------------------------------------------------------------
+
# This must occur after BuildComponents so that the dependency graph
# will be populated.
vs_env = windows_env.Clone()