<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [CMake][Win] Visual Studio invokes make_settings.pl twice"
   href="https://bugs.webkit.org/show_bug.cgi?id=163774">163774</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[CMake][Win] Visual Studio invokes make_settings.pl twice
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>WebKit Nightly Build
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Tools / Tests
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned&#64;lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>Hironori.Fujii&#64;sony.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>lforschler&#64;apple.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=292322" name="attach_292322" title="screenshot of Visual Studio">attachment 292322</a> <a href="attachment.cgi?id=292322&amp;action=edit" title="screenshot of Visual Studio">[details]</a></span>
screenshot of Visual Studio

WebCoreDerivedSources.vcxproj and WebCoreTestSupport.vcxproj triggers make_settings.pl.
This causes unnecessary recompilation in CMake VisualStudio build.

make_settings.pl generates following files:

- SettingsMacros.h
- InternalSettingsGenerated.h
- InternalSettingsGenerated.cpp
- InternalSettingsGenerated.idl

WebCoreDerivedSources depends on SettingsMacros.h.
WebCoreTestSupport depends on InternalSettingsGenerated.cpp.

This problem is described in CMake document:

<a href="https://cmake.org/cmake/help/v3.0/command/add_custom_command.html">https://cmake.org/cmake/help/v3.0/command/add_custom_command.html</a>

<span class="quote">&gt; Do not list the output in more than one independent target that may
&gt; build in parallel or the two instances of the rule may conflict
&gt; (instead use add_custom_target to drive the command and make the other
&gt; targets depend on that one).</span >

There are some solutions:

1) Split make_settings.pl
   For example, add some command arguments like following:
    'make_settings.pl --macros-header ...' generates SettingsMacros.h.
    'make_settings.pl --internal-idl ...' generates InternalSettingsGenerated.idl.
    'make_settings.pl --internal-source ...' generates InternalSettingsGenerated.cpp and InternalSettingsGenerated.h.
2) Write output files only if changed
   Use WriteFileIfChanged of preprocess-idls.pl
   WriteFileIfChanged has a bad effect (infinite regeneration, see <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED LATER - Fix CodeGenerator.pm to only write files if the generated content has changed"
   href="show_bug.cgi?id=131756">Bug 131756</a>)
3) Use add_custom_target
   But, add_custom_target invokes the command every time, I need to
   implement timestamp check in CMake or Perl
4) Implement timestamp check in make_settings.pl
5) Implement timestamp check in a new script (CMake, Python or Perl)</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>