mesonbuild / meson

The Meson Build System
http://mesonbuild.com
Apache License 2.0
5.47k stars 1.59k forks source link

run_target() dependencies are missing when using vs2017 generator #3333

Open dndanik opened 6 years ago

dndanik commented 6 years ago

When running project created using run_target() from vs2017 solution it skips building targets provided by depends kwarg. Works on windows when using ninja backend.

Example project here.

run_target() generated project file:

<?xml version="1.0" ?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <ItemGroup Label="ProjectConfigurations">
        <ProjectConfiguration Include="debug|x64">
            <Configuration>debug</Configuration>
            <Platform>x64</Platform>
        </ProjectConfiguration>
    </ItemGroup>
    <PropertyGroup Label="Globals">
        <ProjectGuid>{9A0E66F0-00FC-408B-B105-C58265D47616}</ProjectGuid>
        <Keyword>x64Proj</Keyword>
        <Platform>x64</Platform>
        <ProjectName>launch</ProjectName>
        <WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
    </PropertyGroup>
    <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props"/>
    <PropertyGroup Label="Configuration">
        <ConfigurationType/>
        <CharacterSet>MultiByte</CharacterSet>
        <UseOfMfc>false</UseOfMfc>
        <PlatformToolset>v141</PlatformToolset>
    </PropertyGroup>
    <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props"/>
    <PropertyGroup>
        <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
        <OutDir>.\</OutDir>
        <IntDir>launch@run\</IntDir>
        <TargetName>launch</TargetName>
    </PropertyGroup>
    <ItemDefinitionGroup>
        <PostBuildEvent>
            <Command>&quot;c:\users\tester\appdata\local\programs\python\python36-32\python.exe&quot; &quot;c:\users\tester\appdata\local\programs\python\python36-32\lib\site-packages\mesonbuild\scripts\commandrunner.py&quot; &quot;F:\meson_run_target_test\build&quot; &quot;F:\meson_run_target_test&quot; &quot;&quot; &quot;c:\users\tester\appdata\local\programs\python\python36-32\python.exe&quot; &quot;C:\Users\Tester\AppData\Local\Programs\Python\Python36-32\Scripts\meson.py&quot; &quot;C:\Users\Tester\AppData\Local\Programs\Python\Python36-32\python.EXE&quot; &quot;F:\meson_run_target_test\build\launcher.py&quot; </Command>
            <Message>Running custom command.</Message>
        </PostBuildEvent>
    </ItemDefinitionGroup>
    <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets"/>
</Project>
Darkclainer commented 6 years ago

I have addition. Don't know may be it's MVS issue, may be not - even if project dependency correctly setted (by Meson), custom build event not running affter all others depended project have builded.