libuv has two files which are only used on unix systems which share a
duplicate basename: unix/core.c and unix/linux/core.c
Obviously we won't be compiling these files under MSVC08 so it would be
nice to only warn about Duplicate basenames and raise an error if we are
using the affected versions of MSVS.
Tested this change with MSVS 2010 on Windows against luvit.
---
Also attached the patch to this issue:
http://code.google.com/p/gyp/issues/detail?id=264
Thanks,
Brandon
http://ifup.org
---
pylib/gyp/generator/msvs.py | 6 ++++++
pylib/gyp/input.py | 3 ++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/pylib/gyp/generator/msvs.py b/pylib/gyp/generator/msvs.py
index c01e955..27adf5b 100644
--- a/pylib/gyp/generator/msvs.py
+++ b/pylib/gyp/generator/msvs.py
@@ -1776,6 +1776,12 @@ def GenerateOutput(target_list, target_dicts, data, params):
# GeneratorCalculatedVariables.
msvs_version = params['msvs_version']
+ for val in target_dicts.itervalues():
+ if val.get('duplicate_basename', False):
+ if msvs_version.short_name == "2008":
+ raise KeyError, 'Duplicate basenames not supported under VS 2008'
+
+
generator_flags = params.get('generator_flags', {})
# Optionally shard targets marked with 'msvs_shard': SHARD_COUNT.
diff --git a/pylib/gyp/input.py b/pylib/gyp/input.py
index 2678bab..90ef32c 100644
--- a/pylib/gyp/input.py
+++ b/pylib/gyp/input.py
@@ -2165,7 +2165,8 @@ def ValidateSourcesInTarget(target, target_dict, build_file):
print ('static library %s has several files with the same basename:\n' %
target + error + 'Some build systems, e.g. MSVC08, '
'cannot handle that.')
- raise KeyError, 'Duplicate basenames in sources section, see list above'
+ print ('Duplicate basenames in sources section, see list above')
+ target_dict['duplicate_basename'] = True
def ValidateRulesInTarget(target, target_dict, extra_sources_for_rules):
--
1.7.10