aboutsummaryrefslogtreecommitdiff
path: root/vs2010backend.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2015-11-04 22:24:23 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2015-11-04 22:24:23 +0200
commita516f45917c8ab4ce43bcf02efa8b91b8a0aa6bc (patch)
tree70ac80385cfe23eba9c4318425c20b42e3526433 /vs2010backend.py
parent5be7c011bf1a30ac336a4eda006ab0a101fd3543 (diff)
downloadmeson-a516f45917c8ab4ce43bcf02efa8b91b8a0aa6bc.zip
meson-a516f45917c8ab4ce43bcf02efa8b91b8a0aa6bc.tar.gz
meson-a516f45917c8ab4ce43bcf02efa8b91b8a0aa6bc.tar.bz2
Regeneration works now but only when doing a rebuild operation.
Diffstat (limited to 'vs2010backend.py')
-rw-r--r--vs2010backend.py20
1 files changed, 16 insertions, 4 deletions
diff --git a/vs2010backend.py b/vs2010backend.py
index 25eeb35..3d0a045 100644
--- a/vs2010backend.py
+++ b/vs2010backend.py
@@ -79,6 +79,10 @@ class Vs2010Backend(backends.Backend):
self.gen_regenproj('REGEN', os.path.join(self.environment.get_build_dir(), 'REGEN.vcxproj'))
self.generate_solution(sln_filename, projlist)
self.generate_regen_info(sln_filename)
+ open(os.path.join(self.environment.get_scratch_dir(), 'regen.stamp'), 'wb')
+ rulefile = os.path.join(self.environment.get_scratch_dir(), 'regen.rule')
+ if not os.path.exists(rulefile):
+ open(rulefile, 'w').write("# For some reason this needs to be here.")
def generate_regen_info(self, sln_filename):
deps = self.get_regen_filelist()
@@ -378,7 +382,7 @@ class Vs2010Backend(backends.Backend):
pname.text = project_name
ET.SubElement(root, 'Import', Project='$(VCTargetsPath)\Microsoft.Cpp.Default.props')
type_config = ET.SubElement(root, 'PropertyGroup', Label='Configuration')
- ET.SubElement(type_config, 'ConfigurationType')
+ ET.SubElement(type_config, 'ConfigurationType').text = "Utility"
ET.SubElement(type_config, 'CharacterSet').text = 'MultiByte'
ET.SubElement(type_config, 'UseOfMfc').text = 'false'
ET.SubElement(root, 'Import', Project='$(VCTargetsPath)\Microsoft.Cpp.props')
@@ -400,8 +404,6 @@ class Vs2010Backend(backends.Backend):
ET.SubElement(midl, 'TypeLibraryName').text = '%(Filename).tlb'
ET.SubElement(midl, 'InterfaceIdentifierFilename').text = '%(Filename)_i.c'
ET.SubElement(midl, 'ProxyFileName').text = '%(Filename)_p.c'
- postbuild = ET.SubElement(action, 'PostBuildEvent')
- ET.SubElement(postbuild, 'Message')
script_root = self.environment.get_script_dir()
regen_script = os.path.join(script_root, 'regen_checker.py')
private_dir = self.environment.get_scratch_dir()
@@ -414,8 +416,18 @@ endlocal & call :cmErrorLevel %%errorlevel%% & goto :cmDone
exit /b %%1
:cmDone
if %%errorlevel%% neq 0 goto :VCEnd'''
- ET.SubElement(postbuild, 'Command').text = cmd_templ % (sys.executable, regen_script, private_dir)
+ igroup = ET.SubElement(root, 'ItemGroup')
+ custombuild = ET.SubElement(igroup, 'CustomBuild', Include='meson-private/regen.rule')
+ message = ET.SubElement(custombuild, 'Message')
+ message.text = 'Checking whether solution needs to be regenerated.'
+ ET.SubElement(custombuild, 'Command').text = cmd_templ % \
+ (sys.executable, regen_script, private_dir)
+ ET.SubElement(custombuild, 'Outputs').text = os.path.join(self.environment.get_scratch_dir(), 'regen.stamp')
+ deps = self.get_regen_filelist()
+ depstr = ';'.join([os.path.join(self.environment.get_source_dir(), d) for d in deps])
+ ET.SubElement(custombuild, 'AdditionalInputs').text = depstr
ET.SubElement(root, 'Import', Project='$(VCTargetsPath)\Microsoft.Cpp.targets')
+ ET.SubElement(root, 'ImportGroup', Label='ExtensionTargets')
tree = ET.ElementTree(root)
tree.write(ofname, encoding='utf-8', xml_declaration=True)