/ Check-in [de784399]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Tooling support for including the debug build in the VSIX package.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: de784399ed1f0e27fc875e32719643d19819c8fb
User & Date: mistachkin 2012-10-12 18:06:07
Context
2012-10-13
09:31
Allow the showdb tool to be compiled with MSVC. check-in: dce391fc user: mistachkin tags: trunk
2012-10-12
18:06
Tooling support for including the debug build in the VSIX package. check-in: de784399 user: mistachkin tags: trunk
2012-10-10
13:59
Fix duplicate test name in whereD.test. check-in: 1182b54a user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Show Whitespace Changes Patch

Changes to Makefile.msc.

     5      5   # The toplevel directory of the source tree.  This is the directory
     6      6   # that contains this "Makefile.msc".
     7      7   #
     8      8   TOP = .
     9      9   
    10     10   # Set this non-0 to create and use the SQLite amalgamation file.
    11     11   #
           12  +!IFNDEF USE_AMALGAMATION
    12     13   USE_AMALGAMATION = 1
           14  +!ENDIF
    13     15   
    14     16   # Set this non-0 to use the International Components for Unicode (ICU).
    15     17   #
           18  +!IFNDEF USE_ICU
    16     19   USE_ICU = 0
           20  +!ENDIF
    17     21   
    18     22   # Set this non-0 to dynamically link to the MSVC runtime library.
    19     23   #
           24  +!IFNDEF USE_CRT_DLL
    20     25   USE_CRT_DLL = 0
           26  +!ENDIF
    21     27   
    22     28   # Set this non-0 to attempt setting the native compiler automatically
    23     29   # for cross-compiling the command line tools needed during the compilation
    24     30   # process.
    25     31   #
           32  +!IFNDEF XCOMPILE
    26     33   XCOMPILE = 0
           34  +!ENDIF
    27     35   
    28     36   # Set this non-0 to use the native libraries paths for cross-compiling
    29     37   # the command line tools needed during the compilation process.
    30     38   #
           39  +!IFNDEF USE_NATIVE_LIBPATHS
    31     40   USE_NATIVE_LIBPATHS = 0
           41  +!ENDIF
    32     42   
    33     43   # Set this 0 to skip the compiling and embedding of version resources.
    34     44   #
           45  +!IFNDEF USE_RC
    35     46   USE_RC = 1
           47  +!ENDIF
    36     48   
    37     49   # Set this non-0 to compile binaries suitable for the WinRT environment.
    38     50   # This setting does not apply to any binaries that require Tcl to operate
    39     51   # properly (i.e. the text fixture, etc).
    40     52   #
           53  +!IFNDEF FOR_WINRT
    41     54   FOR_WINRT = 0
           55  +!ENDIF
    42     56   
    43     57   # Set this non-0 to skip attempting to look for and/or link with the Tcl
    44     58   # runtime library.
    45     59   #
           60  +!IFNDEF NO_TCL
    46     61   NO_TCL = 0
           62  +!ENDIF
    47     63   
    48     64   # Set this to non-0 to create and use PDBs.
    49     65   #
           66  +!IFNDEF SYMBOLS
    50     67   SYMBOLS = 1
           68  +!ENDIF
    51     69   
    52     70   # Set this to non-0 to use the SQLite debugging heap subsystem.
    53     71   #
           72  +!IFNDEF MEMDEBUG
    54     73   MEMDEBUG = 0
           74  +!ENDIF
    55     75   
    56     76   # Set this to non-0 to use the Win32 native heap subsystem.
    57     77   #
           78  +!IFNDEF WIN32HEAP
    58     79   WIN32HEAP = 0
           80  +!ENDIF
    59     81   
    60     82   # Set this to one of the following values to enable various debugging
    61     83   # features.  Each level includes the debugging options from the previous
    62     84   # levels.  Currently, the recognized values for DEBUG are:
    63     85   #
    64     86   # 0 == NDEBUG: Disables assert() and other runtime diagnostics.
    65     87   # 1 == Disables NDEBUG and all optimizations and then enables PDBs.
    66     88   # 2 == SQLITE_DEBUG: Enables various diagnostics messages and code.
    67     89   # 3 == SQLITE_WIN32_MALLOC_VALIDATE: Validate the Win32 native heap per call.
    68     90   # 4 == SQLITE_DEBUG_OS_TRACE: Enables output from the OSTRACE() macros.
    69     91   # 5 == SQLITE_ENABLE_IOTRACE: Enables output from the IOTRACE() macros.
    70     92   #
           93  +!IFNDEF DEBUG
    71     94   DEBUG = 0
           95  +!ENDIF
    72     96   
    73     97   # Check for the predefined command macro CC.  This should point to the compiler
    74     98   # binary for the target platform.  If it is not defined, simply define it to
    75     99   # the legacy default value 'cl.exe'.
    76    100   #
    77    101   !IFNDEF CC
    78    102   CC = cl.exe

Changes to tool/build-all-msvc.bat.

     6      6   :: Multi-Platform Build Tool for MSVC
     7      7   ::
     8      8   
     9      9   SETLOCAL
    10     10   
    11     11   REM SET __ECHO=ECHO
    12     12   REM SET __ECHO2=ECHO
           13  +REM SET __ECHO3=ECHO
    13     14   IF NOT DEFINED _AECHO (SET _AECHO=REM)
    14     15   IF NOT DEFINED _CECHO (SET _CECHO=REM)
    15     16   IF NOT DEFINED _VECHO (SET _VECHO=REM)
    16     17   
    17     18   %_AECHO% Running %0 %*
    18     19   
    19     20   REM SET DFLAGS=/L
................................................................................
   177    178       CALL :fn_UnsetVariable WindowsSdkDir_old
   178    179   
   179    180       REM
   180    181       REM NOTE: Reset the PATH here to the absolute bare minimum required.
   181    182       REM
   182    183       SET PATH=%TOOLPATH%;%SystemRoot%\System32;%SystemRoot%
   183    184   
          185  +    FOR %%B IN (Debug Retail) DO (
          186  +      REM
          187  +      REM NOTE: When preparing the debug build, set the DEBUG and MEMDEBUG
          188  +      REM       environment variables to be picked up by the MSVC makefile
          189  +      REM       itself.
          190  +      REM
          191  +      IF /I "%%B" == "Debug" (
          192  +        SET DEBUG=2
          193  +        SET MEMDEBUG=1
          194  +      ) ELSE (
          195  +        CALL :fn_UnsetVariable DEBUG
          196  +        CALL :fn_UnsetVariable MEMDEBUG
          197  +      )
          198  +
   184    199       REM
   185    200       REM NOTE: Launch a nested command shell to perform the following steps:
   186    201       REM
   187    202       REM       1. Setup the MSVC environment for this platform using the
   188    203       REM          official batch file.
   189    204       REM
   190    205       REM       2. Make sure that no stale build output files are present.
................................................................................
   196    211       REM          platform to the platform-specific directory beneath the
   197    212       REM          binary directory.
   198    213       REM
   199    214       "%ComSpec%" /C (
   200    215         REM
   201    216         REM NOTE: Attempt to setup the MSVC environment for this platform.
   202    217         REM
   203         -      %__ECHO% CALL "%VCINSTALLDIR%\vcvarsall.bat" %%P
          218  +        %__ECHO3% CALL "%VCINSTALLDIR%\vcvarsall.bat" %%P
   204    219   
   205    220         IF ERRORLEVEL 1 (
   206    221           ECHO Failed to call "%VCINSTALLDIR%\vcvarsall.bat" for platform %%P.
   207    222           GOTO errors
   208    223         )
   209    224   
   210    225         REM
   211    226         REM NOTE: If this batch file is not running in "what-if" mode, check to
   212         -      REM       be sure we were actually able to setup the MSVC environment as
   213         -      REM       current versions of their official batch file do not set the
   214         -      REM       exit code upon failure.
          227  +        REM       be sure we were actually able to setup the MSVC environment
          228  +        REM       as current versions of their official batch file do not set
          229  +        REM       the exit code upon failure.
   215    230         REM
   216    231         IF NOT DEFINED __ECHO (
   217    232           IF NOT DEFINED WindowsSdkDir (
   218    233             ECHO Cannot build, Windows SDK not found for platform %%P.
   219    234             GOTO errors
   220    235           )
   221    236         )
................................................................................
   245    260   
   246    261           IF ERRORLEVEL 1 (
   247    262             ECHO Failed to clean for platform %%P.
   248    263             GOTO errors
   249    264           )
   250    265         ) ELSE (
   251    266           REM
   252         -        REM NOTE: Even when the cleaning step has been disabled, we still need
   253         -        REM       to remove the build output for the files we are specifically
   254         -        REM       wanting to build for each platform.
          267  +          REM NOTE: Even when the cleaning step has been disabled, we still
          268  +          REM       need to remove the build output for the files we are
          269  +          REM       specifically wanting to build for each platform.
   255    270           REM
   256    271           %__ECHO% DEL /Q sqlite3.dll sqlite3.lib sqlite3.pdb
   257    272         )
   258    273   
   259    274         REM
   260         -      REM NOTE: Invoke NMAKE with the MSVC makefile to build the "sqlite3.dll"
          275  +        REM NOTE: Call NMAKE with the MSVC makefile to build the "sqlite3.dll"
   261    276         REM       binary.  The x86 compiler will be used to compile the native
   262    277         REM       command line tools needed during the build process itself.
   263    278         REM       Also, disable looking for and/or linking to the native Tcl
   264    279         REM       runtime library.
   265    280         REM
   266         -      %__ECHO% nmake -f Makefile.msc sqlite3.dll "NCC=""%VCINSTALLDIR%\bin\cl.exe""" USE_NATIVE_LIBPATHS=1 NO_TCL=1 %NMAKE_ARGS%
          281  +        %__ECHO% nmake -f Makefile.msc sqlite3.dll XCOMPILE=1 USE_NATIVE_LIBPATHS=1 NO_TCL=1 %NMAKE_ARGS%
          282  +
          283  +        IF ERRORLEVEL 1 (
          284  +          ECHO Failed to build %%B "sqlite3.dll" for platform %%P.
          285  +          GOTO errors
          286  +        )
          287  +
          288  +        REM
          289  +        REM NOTE: Copy the "sqlite3.dll" file to the appropriate directory for
          290  +        REM       the build and platform beneath the binary directory.
          291  +        REM
          292  +        %__ECHO% XCOPY sqlite3.dll "%BINARYDIRECTORY%\%%B\%%D\" %FFLAGS% %DFLAGS%
   267    293   
   268    294         IF ERRORLEVEL 1 (
   269         -        ECHO Failed to build "sqlite3.dll" for platform %%P.
          295  +          ECHO Failed to copy "sqlite3.dll" to "%BINARYDIRECTORY%\%%B\%%D\".
   270    296           GOTO errors
   271    297         )
   272    298   
          299  +        REM
          300  +        REM NOTE: Copy the "sqlite3.lib" file to the appropriate directory for
          301  +        REM       the build and platform beneath the binary directory.
   273    302         REM
   274         -      REM NOTE: Copy the "sqlite3.dll" file to the platform-specific directory
   275         -      REM       beneath the binary directory.
   276         -      REM
   277         -      %__ECHO% XCOPY sqlite3.dll "%BINARYDIRECTORY%\%%D\" %FFLAGS% %DFLAGS%
          303  +        %__ECHO% XCOPY sqlite3.lib "%BINARYDIRECTORY%\%%B\%%D\" %FFLAGS% %DFLAGS%
   278    304   
   279    305         IF ERRORLEVEL 1 (
   280         -        ECHO Failed to copy "sqlite3.dll" to "%BINARYDIRECTORY%\%%D\".
          306  +          ECHO Failed to copy "sqlite3.lib" to "%BINARYDIRECTORY%\%%B\%%D\".
   281    307           GOTO errors
   282    308         )
   283    309   
   284    310         REM
   285         -      REM NOTE: Copy the "sqlite3.lib" file to the platform-specific directory
   286         -      REM       beneath the binary directory.
   287         -      REM
   288         -      %__ECHO% XCOPY sqlite3.lib "%BINARYDIRECTORY%\%%D\" %FFLAGS% %DFLAGS%
   289         -
   290         -      IF ERRORLEVEL 1 (
   291         -        ECHO Failed to copy "sqlite3.lib" to "%BINARYDIRECTORY%\%%D\".
   292         -        GOTO errors
   293         -      )
   294         -
   295         -      REM
   296         -      REM NOTE: Copy the "sqlite3.pdb" file to the platform-specific directory
   297         -      REM       beneath the binary directory unless we are prevented from doing
   298         -      REM       so.
          311  +        REM NOTE: Copy the "sqlite3.pdb" file to the appropriate directory for
          312  +        REM       the build and platform beneath the binary directory unless we
          313  +        REM       are prevented from doing so.
   299    314         REM
   300    315         IF NOT DEFINED NOSYMBOLS (
   301         -        %__ECHO% XCOPY sqlite3.pdb "%BINARYDIRECTORY%\%%D\" %FFLAGS% %DFLAGS%
          316  +          %__ECHO% XCOPY sqlite3.pdb "%BINARYDIRECTORY%\%%B\%%D\" %FFLAGS% %DFLAGS%
   302    317   
   303    318           IF ERRORLEVEL 1 (
   304         -          ECHO Failed to copy "sqlite3.pdb" to "%BINARYDIRECTORY%\%%D\".
          319  +            ECHO Failed to copy "sqlite3.pdb" to "%BINARYDIRECTORY%\%%B\%%D\".
   305    320             GOTO errors
   306    321           )
   307    322         )
   308    323       )
   309    324     )
          325  +  )
   310    326   
   311    327     REM
   312    328     REM NOTE: Handle any errors generated during the nested command shell.
   313    329     REM
   314    330     IF ERRORLEVEL 1 (
   315    331       GOTO errors
   316    332     )

Changes to tool/mkvsix.tcl.

    86     86     # NOTE: Performs all Tcl command, variable, and backslash substitutions in
    87     87     #       the specified file and then re-writes the contents of that same file
    88     88     #       with the substituted data.
    89     89     #
    90     90     return [writeFile $fileName [uplevel 1 [list subst [readFile $fileName]]]]
    91     91   }
    92     92   
    93         -proc replacePlatform { fileName platformName } {
           93  +proc replaceBuildAndPlatform { fileName buildName platformName } {
    94     94     #
    95     95     # NOTE: Returns the specified file name containing the platform name instead
    96     96     #       of platform placeholder tokens.
    97     97     #
    98         -  return [string map [list <platform> $platformName] $fileName]
           98  +  return [string map [list <build> $buildName <platform> $platformName] \
           99  +      $fileName]
    99    100   }
   100    101   
   101    102   set script [file normalize [info script]]
   102    103   
   103    104   if {[string length $script] == 0} then {
   104    105     fail "script file currently being evaluated is unknown" true
   105    106   }
................................................................................
   245    246   
   246    247   #
   247    248   # NOTE: Setup the master file list data, including the necessary flags.
   248    249   #
   249    250   if {![info exists fileNames(source)]} then {
   250    251     set fileNames(source) [list "" "" "" \
   251    252         [file join $sourceDirectory sqlite3.h] \
   252         -      [file join $binaryDirectory <platform> sqlite3.lib] \
   253         -      [file join $binaryDirectory <platform> sqlite3.dll]]
          253  +      [file join $binaryDirectory <build> <platform> sqlite3.lib] \
          254  +      [file join $binaryDirectory <build> <platform> sqlite3.dll]]
   254    255   
   255    256     if {![info exists no(symbols)]} then {
   256    257       lappend fileNames(source) \
   257         -        [file join $binaryDirectory <platform> sqlite3.pdb]
          258  +        [file join $binaryDirectory <build> <platform> sqlite3.pdb]
   258    259     }
   259    260   }
   260    261   
   261    262   if {![info exists fileNames(destination)]} then {
   262    263     set fileNames(destination) [list \
   263    264         [file join $stagingDirectory extension.vsixmanifest] \
   264    265         [file join $stagingDirectory SDKManifest.xml] \
   265         -      [file join $stagingDirectory DesignTime CommonConfiguration \
   266         -          <platform> SQLite.WinRT.props] \
   267         -      [file join $stagingDirectory DesignTime CommonConfiguration \
   268         -          <platform> sqlite3.h] \
   269         -      [file join $stagingDirectory DesignTime CommonConfiguration \
   270         -          <platform> sqlite3.lib] \
   271         -      [file join $stagingDirectory Redist CommonConfiguration \
   272         -          <platform> sqlite3.dll]]
          266  +      [file join $stagingDirectory DesignTime <build> <platform> \
          267  +          SQLite.WinRT.props] \
          268  +      [file join $stagingDirectory DesignTime <build> <platform> sqlite3.h] \
          269  +      [file join $stagingDirectory DesignTime <build> <platform> sqlite3.lib] \
          270  +      [file join $stagingDirectory Redist <build> <platform> sqlite3.dll]]
   273    271   
   274    272     if {![info exists no(symbols)]} then {
   275    273       lappend fileNames(destination) \
   276         -        [file join $stagingDirectory Redist Debug \
   277         -            <platform> sqlite3.pdb]
          274  +        [file join $stagingDirectory Redist <build> <platform> sqlite3.pdb]
   278    275     }
   279    276   }
   280    277   
   281         -if {![info exists fileNames(neutral)]} then {
   282         -  set fileNames(neutral) [list 1 1 1 1 0 0]
          278  +if {![info exists fileNames(buildNeutral)]} then {
          279  +  set fileNames(buildNeutral) [list 1 1 1 1 0 0]
          280  +
          281  +  if {![info exists no(symbols)]} then {
          282  +    lappend fileNames(buildNeutral) 0
          283  +  }
          284  +}
          285  +
          286  +if {![info exists fileNames(platformNeutral)]} then {
          287  +  set fileNames(platformNeutral) [list 1 1 1 1 0 0]
   283    288   
   284    289     if {![info exists no(symbols)]} then {
   285         -    lappend fileNames(neutral) 0
          290  +    lappend fileNames(platformNeutral) 0
   286    291     }
   287    292   }
   288    293   
   289    294   if {![info exists fileNames(subst)]} then {
   290    295     set fileNames(subst) [list 1 1 1 0 0 0]
   291    296   
   292    297     if {![info exists no(symbols)]} then {
   293    298       lappend fileNames(subst) 0
   294    299     }
   295    300   }
          301  +
          302  +if {![info exists fileNames(noDebug)]} then {
          303  +  set fileNames(noDebug) [list 0 0 0 0 0 0]
          304  +
          305  +  if {![info exists no(symbols)]} then {
          306  +    lappend fileNames(noDebug) 0
          307  +  }
          308  +}
          309  +
          310  +if {![info exists fileNames(noRetail)]} then {
          311  +  set fileNames(noRetail) [list 0 0 0 0 0 0]
          312  +
          313  +  if {![info exists no(symbols)]} then {
          314  +    lappend fileNames(noRetail) 1
          315  +  }
          316  +}
          317  +
          318  +###############################################################################
          319  +
          320  +#
          321  +# NOTE: Setup the list of builds supported by this script.
          322  +#
          323  +if {![info exists buildNames]} then {
          324  +  set buildNames [list Debug Retail]
          325  +}
   296    326   
   297    327   ###############################################################################
   298    328   
   299    329   #
   300    330   # NOTE: Setup the list of platforms supported by this script.
   301    331   #
   302    332   if {![info exists platformNames]} then {
................................................................................
   334    364   #       is an empty string, then the destination file name will be assumed to
   335    365   #       already exist in the staging directory and will not be copied; however,
   336    366   #       dynamic replacements may still be performed on the destination file
   337    367   #       prior to the package being re-zipped.
   338    368   #
   339    369   foreach sourceFileName $fileNames(source) \
   340    370       destinationFileName $fileNames(destination) \
   341         -    isNeutral $fileNames(neutral) useSubst $fileNames(subst) {
          371  +    buildNeutral $fileNames(buildNeutral) platformNeutral \
          372  +    $fileNames(platformNeutral) useSubst $fileNames(subst) \
          373  +    noDebug $fileNames(noDebug) noRetail $fileNames(noRetail) {
   342    374     #
   343         -  # NOTE: If the current file is platform-neutral, then only one platform will
   344         -  #       be processed for it, namely "neutral"; otherwise, each supported
   345         -  #       platform will be processed for it individually.
          375  +  # NOTE: If the current file is build-neutral, then only one build will
          376  +  #       be processed for it, namely "CommonConfiguration"; otherwise, each
          377  +  #       supported build will be processed for it individually.
   346    378     #
   347         -  foreach platformName [expr {$isNeutral ? [list neutral] : $platformNames}] {
          379  +  foreach buildName \
          380  +      [expr {$buildNeutral ? [list CommonConfiguration] : $buildNames}] {
          381  +    #
          382  +    # NOTE: Should the current file be skipped for this build?
          383  +    #
          384  +    if {[info exists no${buildName}] && [set no${buildName}]} then {
          385  +      continue
          386  +    }
          387  +
          388  +    #
          389  +    # NOTE: If the current file is platform-neutral, then only one platform
          390  +    #       will be processed for it, namely "neutral"; otherwise, each
          391  +    #       supported platform will be processed for it individually.
          392  +    #
          393  +    foreach platformName \
          394  +        [expr {$platformNeutral ? [list neutral] : $platformNames}] {
   348    395       #
   349    396       # NOTE: Use the actual platform name in the destination file name.
   350    397       #
   351         -    set newDestinationFileName [replacePlatform $destinationFileName \
   352         -        $platformName]
          398  +      set newDestinationFileName [replaceBuildAndPlatform \
          399  +          $destinationFileName $buildName $platformName]
   353    400   
   354    401       #
   355    402       # NOTE: Does the source file need to be copied to the destination file?
   356    403       #
   357    404       if {[string length $sourceFileName] > 0} then {
   358    405         #
   359    406         # NOTE: First, make sure the destination directory exists.
   360    407         #
   361    408         file mkdir [file dirname $newDestinationFileName]
   362    409   
   363    410         #
   364    411         # NOTE: Then, copy the source file to the destination file verbatim.
   365    412         #
   366         -      file copy [replacePlatform $sourceFileName $platformName] \
   367         -          $newDestinationFileName
          413  +        file copy [replaceBuildAndPlatform $sourceFileName $buildName \
          414  +            $platformName] $newDestinationFileName
   368    415       }
   369    416   
   370    417       #
   371    418       # NOTE: Does the destination file contain dynamic replacements that must
   372    419       #       be processed now?
   373    420       #
   374    421       if {$useSubst} then {
................................................................................
   376    423         # NOTE: Perform any dynamic replacements contained in the destination
   377    424         #       file and then re-write it in-place.
   378    425         #
   379    426         substFile $newDestinationFileName
   380    427       }
   381    428     }
   382    429   }
          430  +}
   383    431   
   384    432   ###############################################################################
   385    433   
   386    434   #
   387    435   # NOTE: Change the current directory to the staging directory so that the
   388    436   #       external archive building tool can pickup the necessary files using
   389    437   #       relative paths.