Changeset 120361 in webkit


Ignore:
Timestamp:
Jun 14, 2012 2:15:52 PM (12 years ago)
Author:
mjs@apple.com
Message:

The whole world rebuilds when you touch any IDL file
https://bugs.webkit.org/show_bug.cgi?id=89125

Reviewed by Sam Weinig.

No new tests; this only changes the build system and its dependencies.

  • bindings/scripts/preprocess-idls.pl: Optionally generate the

dependencies for supplemental IDLs in Makefile format.

  • DerivedSources.make: Use the new feature of preprocess-idls.pl to generate

the correct IDL dependencies created by Supplemental, then include it. This way,
we avoid the situation where every bindings file implicitly depends on every single
IDL file in the project.

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r120360 r120361  
     12012-06-14  Maciej Stachowiak  <mjs@apple.com>
     2
     3        The whole world rebuilds when you touch any IDL file
     4        https://bugs.webkit.org/show_bug.cgi?id=89125
     5
     6        Reviewed by Sam Weinig.
     7
     8        No new tests; this only changes the build system and its dependencies.
     9
     10        * bindings/scripts/preprocess-idls.pl: Optionally generate the
     11        dependencies for supplemental IDLs in Makefile format.
     12        * DerivedSources.make: Use the new feature of preprocess-idls.pl to generate
     13        the correct IDL dependencies created by Supplemental, then include it. This way,
     14        we avoid the situation where every bindings file implicitly depends on every single
     15        IDL file in the project.
     16
    1172012-06-14  Ian Vollick  <vollick@chromium.org>
    218
  • trunk/Source/WebCore/DerivedSources.make

    r119954 r120361  
    616616
    617617all : \
     618    $(SUPPLEMENTAL_DEPENDENCY_FILE) \
    618619    $(JS_DOM_HEADERS) \
    619620    $(WEB_DOM_HEADERS) \
     
    950951JS_BINDINGS_SCRIPTS = $(GENERATE_SCRIPTS) bindings/scripts/CodeGeneratorJS.pm
    951952
    952 SUPPLEMENTAL_DEPENDENCY_FILE = ./supplemental_dependency.tmp
     953SUPPLEMENTAL_DEPENDENCY_FILE = ./SupplementalDependencies.txt
     954SUPPLEMENTAL_MAKEFILE_DEPS = ./SupplementalDependencies.dep
    953955IDL_FILES_TMP = ./idl_files.tmp
    954956ADDITIONAL_IDLS = $(WebCore)/inspector/JavaScriptCallFrame.idl
     
    960962space +=
    961963
    962 $(SUPPLEMENTAL_DEPENDENCY_FILE) : $(PREPROCESS_IDLS_SCRIPTS) $(BINDING_IDLS) $(ADDITIONAL_IDLS) $(IDL_ATTRIBUTES_FILE)
     964$(SUPPLEMENTAL_MAKEFILE_DEPS) : $(PREPROCESS_IDLS_SCRIPTS) $(BINDING_IDLS) $(ADDITIONAL_IDLS) $(IDL_ATTRIBUTES_FILE)
    963965        printf "$(subst $(space),,$(patsubst %,%\n,$(BINDING_IDLS) $(ADDITIONAL_IDLS)))" > $(IDL_FILES_TMP)
    964         $(call preprocess_idls_script, $(PREPROCESS_IDLS_SCRIPTS)) --defines "$(FEATURE_DEFINES) $(ADDITIONAL_IDL_DEFINES) LANGUAGE_JAVASCRIPT" --idlFilesList $(IDL_FILES_TMP) --supplementalDependencyFile $@ --idlAttributesFile $(IDL_ATTRIBUTES_FILE)
     966        $(call preprocess_idls_script, $(PREPROCESS_IDLS_SCRIPTS)) --defines "$(FEATURE_DEFINES) $(ADDITIONAL_IDL_DEFINES) LANGUAGE_JAVASCRIPT" --idlFilesList $(IDL_FILES_TMP) --supplementalDependencyFile $(SUPPLEMENTAL_DEPENDENCY_FILE) --supplementalMakefileDeps $@ --idlAttributesFile $(IDL_ATTRIBUTES_FILE)
    965967        rm -f $(IDL_FILES_TMP)
    966968
    967 JS%.h : %.idl $(JS_BINDINGS_SCRIPTS) $(SUPPLEMENTAL_DEPENDENCY_FILE)
     969JS%.h : %.idl $(JS_BINDINGS_SCRIPTS)
    968970        $(call generator_script, $(JS_BINDINGS_SCRIPTS)) $(IDL_COMMON_ARGS) --defines "$(FEATURE_DEFINES) $(ADDITIONAL_IDL_DEFINES) LANGUAGE_JAVASCRIPT" --generator JS --supplementalDependencyFile $(SUPPLEMENTAL_DEPENDENCY_FILE) $<
    969971
     972include $(SUPPLEMENTAL_MAKEFILE_DEPS)
    970973
    971974# Inspector interfaces generator
     
    9981001CPP_BINDINGS_SCRIPTS = $(GENERATE_SCRIPTS) bindings/scripts/CodeGeneratorCPP.pm
    9991002
    1000 WebDOM%.h : %.idl $(CPP_BINDINGS_SCRIPTS) $(SUPPLEMENTAL_DEPENDENCY_FILE)
     1003WebDOM%.h : %.idl $(CPP_BINDINGS_SCRIPTS)
    10011004        $(call generator_script, $(CPP_BINDINGS_SCRIPTS)) $(IDL_COMMON_ARGS) --defines "$(FEATURE_DEFINES) $(ADDITIONAL_IDL_DEFINES) LANGUAGE_CPP" --generator CPP --supplementalDependencyFile $(SUPPLEMENTAL_DEPENDENCY_FILE) $<
    10021005endif # BUILDING_WX
     
    10411044
    10421045DOM_BINDINGS_SCRIPTS = $(GENERATE_BINDING_SCRIPTS) bindings/scripts/CodeGeneratorObjC.pm
    1043 DOM%.h : %.idl $(DOM_BINDINGS_SCRIPTS) $(SUPPLEMENTAL_DEPENDENCY_FILE) bindings/objc/PublicDOMInterfaces.h
     1046DOM%.h : %.idl $(DOM_BINDINGS_SCRIPTS) bindings/objc/PublicDOMInterfaces.h
    10441047        $(call generator_script, $(DOM_BINDINGS_SCRIPTS)) $(IDL_COMMON_ARGS) --defines "$(FEATURE_DEFINES) $(ADDITIONAL_IDL_DEFINES) LANGUAGE_OBJECTIVE_C" --generator ObjC --supplementalDependencyFile $(SUPPLEMENTAL_DEPENDENCY_FILE) $<
    10451048
  • trunk/Source/WebCore/bindings/scripts/preprocess-idls.pl

    r109036 r120361  
    3333my $idlAttributesFile;
    3434my $supplementalDependencyFile;
     35my $supplementalMakefileDeps;
    3536
    3637GetOptions('defines=s' => \$defines,
     
    3940           'idlFilesList=s' => \$idlFilesList,
    4041           'idlAttributesFile=s' => \$idlAttributesFile,
    41            'supplementalDependencyFile=s' => \$supplementalDependencyFile);
     42           'supplementalDependencyFile=s' => \$supplementalDependencyFile,
     43           'supplementalMakefileDeps=s' => \$supplementalMakefileDeps);
    4244
    4345die('Must specify #define macros using --defines.') unless defined($defines);
     
    5759my %documents;
    5860my %interfaceNameToIdlFile;
     61my %idlFileToInterfaceName;
    5962foreach my $idlFile (@idlFiles) {
    6063    my $fullPath = Cwd::realpath($idlFile);
    6164    my $parser = IDLParser->new(!$verbose);
    6265    $documents{$fullPath} = $parser->Parse($idlFile, $defines, $preprocessor);
    63     $interfaceNameToIdlFile{fileparse(basename($idlFile), ".idl")} = $fullPath;
     66    my $interfaceName = fileparse(basename($idlFile), ".idl");
     67    $interfaceNameToIdlFile{$interfaceName} = $fullPath;
     68    $idlFileToInterfaceName{$fullPath} = $interfaceName;
    6469}
    6570
     
    97102# Document.idl is supplemented by S.idl, and Event.idl is supplemented by no IDLs.
    98103# The IDL that supplements another IDL (e.g. P.idl) never appears in the dependency file.
     104
    99105open FH, "> $supplementalDependencyFile" or die "Cannot open $supplementalDependencyFile\n";
     106
    100107foreach my $idlFile (sort keys %supplementals) {
    101108    print FH $idlFile, " @{$supplementals{$idlFile}}\n";
    102109}
    103110close FH;
     111
     112
     113if ($supplementalMakefileDeps) {
     114    open MAKE_FH, "> $supplementalMakefileDeps" or die "Cannot open $supplementalMakefileDeps\n";
     115    my @all_dependencies = [];
     116    foreach my $idlFile (sort keys %supplementals) {
     117        my $basename = $idlFileToInterfaceName{$idlFile};
     118
     119        my @dependencies = map { basename($_) } @{$supplementals{$idlFile}};
     120
     121        print MAKE_FH "JS${basename}.h: @{dependencies}\n";
     122        print MAKE_FH "DOM${basename}.h: @{dependencies}\n";
     123        print MAKE_FH "WebDOM${basename}.h: @{dependencies}\n";
     124        foreach my $dependency (@dependencies) {
     125            print MAKE_FH "${dependency}:\n";
     126        }
     127    }
     128
     129    close MAKE_FH;
     130}
     131
    104132
    105133sub loadIDLAttributes
Note: See TracChangeset for help on using the changeset viewer.