Skip to content
  • aroben@apple.com's avatar
    Use paths relative to $WebKitVSPropsRedirectionDir to access shared .vsprops files · 89dd1f30
    aroben@apple.com authored
    Apple's Windows build allows placing header files and import libraries for WebKit's
    dependencies (CoreGraphics, CFNetwork, SQLite, etc.) outside the source tree via the
    $WebKitLibrariesDir environment variable. This is both required for production builds and
    convenient for Apple-internal developer builds. Apple's production builds also require that
    WebKit's shared .vsprops files be accessed relative to $WebKitLibrariesDir. In production
    builds, the files are copied into that directory tree by the
    WebKitLibraries/win/tools/WinTools.make file. In Apple-internal developer builds, the
    copying is done by
    JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make.
    
    This .vsprops copying is problematic in one very important case: when a developer updates
    their source tree and then tries to build. Visual Studio only reads .vsprops files when a
    project is first loaded. So, when Visual Studio is first opened after the .vsprops files are
    updated, it reads in the old files that were already residing in $WebKitLibrariesDir. When a
    build is started, JavaScriptCoreGenerated.make copies the new .vsprops files into
    $WebKitLibrariesDir, but Visual Studio will not pick up the changes.  The rest of the build
    will proceed with out-of-date .vsprops files, which will likely result in a build failure.
    
    To fix this, we now use normal relative paths to access the .vsprops files in the source
    tree rather than in $WebKitLibrariesDir, but prefix those paths with a new environment
    variable, $WebKitVSPropsRedirectionDir. In developer builds, this environment variable is
    unset, so the normal relative paths are used to read the .vsprops files out of the source
    tree directly. In production builds, this environment variable is set to a fake directory
    that will cause the .vsprops files in $WebKitLibrariesDir to be found when the relative path
    is resolved.
    
    For example, JavaScriptCore.vcproj uses this path for FeatureDefines.vsprops:
    
    $(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\FeatureDefines.vsprops
    
    In developer builds, where $WebKitVSPropsRedirectionDir is unset, this will point to the
    files in WebKitLibraries\win\tools\vsprops in the source tree. In production builds,
    JavaScriptCore.make sets $WebKitVSPropsRedirectionDir to
    "$(SRCROOT)\AppleInternal\tools\vsprops\OpenSource\1\2\3\", so the full path for
    FeatureDefines.vsprops becomes:
    
    $(SRCROOT)\AppleInternal\tools\vsprops\OpenSource\1\2\3\..\..\..\WebKitLibraries\win\tools\vsprops\FeatureDefines.vsprops
    
    which resolves to:
    
    $(SRCROOT)\AppleInternal\tools\vsprops\OpenSource\WebKitLibraries\win\tools\vsprops\FeatureDefines.vsprops
    
    (We rely on the fact that Windows doesn't care whether the directories "1", "2", and "3"
    actually exist since they are matched by an equal number of ".." path components.)
    
    Note that Visual Studio still won't pick up changes made to .vsprops files while Visual
    Studio is open, but that problem hasn't seemed to cause developers many headaches so far.
    
    Fixes <http://webkit.org/b/49181> Windows build fails mysteriously when .vsprops files are
    updated
    
    Reviewed by Dave Hyatt.
    
    JavaScriptCore:
    
    * JavaScriptCore.vcproj/JavaScriptCore.make: Set $WebKitVSPropsRedirectionDir so that
    production builds can find the .vsprops files.
    
    * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make: Stopy copying the
    .vsprops files. It isn't needed anymore.
    
    * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
    * JavaScriptCore.vcproj/WTF/WTF.vcproj:
    * JavaScriptCore.vcproj/jsc/jsc.vcproj:
    * JavaScriptCore.vcproj/testapi/testapi.vcproj:
    Changed to use paths relative to $WebKitVSPropsRedirectionDir to access shared .vsprops
    files.
    
    WebCore:
    
    * WebCore.vcproj/WebCore.make: Set $WebKitVSPropsRedirectionDir so that
    production builds can find the .vsprops files.
    
    * WebCore.vcproj/QTMovieWin.vcproj:
    * WebCore.vcproj/WebCore.vcproj:
    Changed to use paths relative to $WebKitVSPropsRedirectionDir to access shared .vsprops
    files.
    
    WebKit/win:
    
    * WebKit.vcproj/WebKit.make: Set $WebKitVSPropsRedirectionDir so that production builds can
    find the .vsprops files.
    
    * WebKit.vcproj/WebKit.vcproj:
    * WebKit.vcproj/Interfaces.vcproj:
    * WebKit.vcproj/WebKitGUID.vcproj:
    Changed to use paths relative to $WebKitVSPropsRedirectionDir to access shared .vsprops
    files.
    
    WebKit2:
    
    * win/WebKit2.make: Set $WebKitVSPropsRedirectionDir so that production builds can
    find the .vsprops files.
    
    * win/WebKit2.vcproj:
    * win/WebKit2WebProcess.vcproj:
    Changed to use paths relative to $WebKitVSPropsRedirectionDir to access shared .vsprops
    files.
    
    WebKitLibraries:
    
    * win/tools/WinTools.make: Copy the shared .vsprops files into a directory tree beneath
    AppleInternal\tools\vsprops that matches the source directory tree. This allows production
    builds to redirect the relative paths used to find the shared .vsprops files into
    AppleInternal by setting $WebKitVSPropsRedirectionDir to the appropriate value.
    
    WebKitTools:
    
    * DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj:
    * DumpRenderTree/win/DumpRenderTree.vcproj:
    * DumpRenderTree/win/ImageDiff.vcproj:
    * FindSafari/FindSafari.vcproj:
    * MiniBrowser/MiniBrowser.vcproj:
    * TestWebKitAPI/win/TestWebKitAPI.vcproj:
    * TestWebKitAPI/win/TestWebKitAPIGenerated.vcproj:
    * WebKitAPITest/WebKitAPITest.vcproj:
    * WebKitLauncherWin/WebKitLauncherWin.vcproj:
    * WebKitTestRunner/win/InjectedBundle.vcproj:
    * WebKitTestRunner/win/WebKitTestRunner.vcproj:
    * WinLauncher/WinLauncher.vcproj:
    * record-memory-win/record-memory-win.vcproj:
    Changed to use paths relative to $WebKitVSPropsRedirectionDir to access shared .vsprops
    files.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72555 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    89dd1f30