From: mistachkin Date: Fri, 12 Oct 2012 18:22:51 +0000 (+0000) Subject: Backport of tooling support for including the debug build in the VSIX package. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=67bfbb4712a86de3e05c0359a13f63a9c57e6a87;p=thirdparty%2Fsqlite.git Backport of tooling support for including the debug build in the VSIX package. FossilOrigin-Name: c188896719cb6b942936e27fab4ead52e2c63c54 --- diff --git a/Makefile.msc b/Makefile.msc index 2b79c2b9b7..db997fd34b 100644 --- a/Makefile.msc +++ b/Makefile.msc @@ -9,49 +9,75 @@ TOP = . # Set this non-0 to create and use the SQLite amalgamation file. # +!IFNDEF USE_AMALGAMATION USE_AMALGAMATION = 1 +!ENDIF # Set this non-0 to use the International Components for Unicode (ICU). # +!IFNDEF USE_ICU USE_ICU = 0 +!ENDIF # Set this non-0 to dynamically link to the MSVC runtime library. # +!IFNDEF USE_CRT_DLL USE_CRT_DLL = 0 +!ENDIF # Set this non-0 to attempt setting the native compiler automatically # for cross-compiling the command line tools needed during the compilation # process. # +!IFNDEF XCOMPILE XCOMPILE = 0 +!ENDIF # Set this non-0 to use the native libraries paths for cross-compiling # the command line tools needed during the compilation process. # +!IFNDEF USE_NATIVE_LIBPATHS USE_NATIVE_LIBPATHS = 0 +!ENDIF + +# Set this 0 to skip the compiling and embedding of version resources. +# +!IFNDEF USE_RC +USE_RC = 1 +!ENDIF # Set this non-0 to compile binaries suitable for the WinRT environment. # This setting does not apply to any binaries that require Tcl to operate # properly (i.e. the text fixture, etc). # +!IFNDEF FOR_WINRT FOR_WINRT = 0 +!ENDIF # Set this non-0 to skip attempting to look for and/or link with the Tcl # runtime library. # +!IFNDEF NO_TCL NO_TCL = 0 +!ENDIF # Set this to non-0 to create and use PDBs. # +!IFNDEF SYMBOLS SYMBOLS = 1 +!ENDIF # Set this to non-0 to use the SQLite debugging heap subsystem. # +!IFNDEF MEMDEBUG MEMDEBUG = 0 +!ENDIF # Set this to non-0 to use the Win32 native heap subsystem. # +!IFNDEF WIN32HEAP WIN32HEAP = 0 +!ENDIF # Set this to one of the following values to enable various debugging # features. Each level includes the debugging options from the previous @@ -64,7 +90,9 @@ WIN32HEAP = 0 # 4 == SQLITE_DEBUG_OS_TRACE: Enables output from the OSTRACE() macros. # 5 == SQLITE_ENABLE_IOTRACE: Enables output from the IOTRACE() macros. # +!IFNDEF DEBUG DEBUG = 0 +!ENDIF # Check for the predefined command macro CC. This should point to the compiler # binary for the target platform. If it is not defined, simply define it to @@ -157,8 +185,8 @@ NLTLIBPATHS = "/LIBPATH:$(NCRTLIBPATH)" "/LIBPATH:$(NSDKLIBPATH)" # will run on the target platform. (BCC and TCC are usually the # same unless your are cross-compiling.) # -TCC = $(CC) -W3 -DSQLITE_OS_WIN=1 -I. -I$(TOP)\src -fp:precise -RCC = $(RC) -DSQLITE_OS_WIN=1 -I. -I$(TOP)\src +TCC = $(CC) -W3 -DSQLITE_OS_WIN=1 -I$(TOP) -I$(TOP)\src -fp:precise +RCC = $(RC) -DSQLITE_OS_WIN=1 -I$(TOP) -I$(TOP)\src # When compiling the library for use in the WinRT environment, # the following compile-time options must be used as well to @@ -168,8 +196,8 @@ RCC = $(RC) -DSQLITE_OS_WIN=1 -I. -I$(TOP)\src !IF $(FOR_WINRT)!=0 TCC = $(TCC) -DSQLITE_OS_WINRT=1 RCC = $(RCC) -DSQLITE_OS_WINRT=1 -TCC = $(TCC) -DWINAPI_FAMILY=WINAPI_PARTITION_APP -RCC = $(RCC) -DWINAPI_FAMILY=WINAPI_PARTITION_APP +TCC = $(TCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP +RCC = $(RCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP !ENDIF # Also, we need to dynamically link to the correct MSVC runtime @@ -180,14 +208,18 @@ RCC = $(RCC) -DWINAPI_FAMILY=WINAPI_PARTITION_APP !IF $(FOR_WINRT)!=0 || $(USE_CRT_DLL)!=0 !IF $(DEBUG)>0 TCC = $(TCC) -MDd +BCC = $(BCC) -MDd !ELSE TCC = $(TCC) -MD +BCC = $(BCC) -MD !ENDIF !ELSE !IF $(DEBUG)>0 TCC = $(TCC) -MTd +BCC = $(BCC) -MTd !ELSE TCC = $(TCC) -MT +BCC = $(BCC) -MT !ENDIF !ENDIF @@ -472,6 +504,14 @@ LIBOBJ = $(LIBOBJS0) LIBOBJ = $(LIBOBJS1) !ENDIF +# Determine if embedded resource compilation and usage are enabled. +# +!IF $(USE_RC)!=0 +LIBRESOBJS = sqlite3res.lo +!ELSE +LIBRESOBJS = +!ENDIF + # All of the source code files. # SRC = \ @@ -766,10 +806,10 @@ libsqlite3.lib: $(LIBOBJ) libtclsqlite3.lib: tclsqlite.lo libsqlite3.lib $(LTLIB) $(LTLIBOPTS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo libsqlite3.lib $(LIBTCL:tcl=tclstub) $(TLIBS) -sqlite3.exe: $(TOP)\src\shell.c libsqlite3.lib sqlite3res.lo sqlite3.h +sqlite3.exe: $(TOP)\src\shell.c libsqlite3.lib $(LIBRESOBJS) sqlite3.h $(LTLINK) $(READLINE_FLAGS) \ $(TOP)\src\shell.c \ - /link $(LTLINKOPTS) $(LTLIBPATHS) libsqlite3.lib sqlite3res.lo $(LIBREADLINE) $(LTLIBS) $(TLIBS) + /link $(LTLINKOPTS) $(LTLIBPATHS) libsqlite3.lib $(LIBRESOBJS) $(LIBREADLINE) $(LTLIBS) $(TLIBS) # This target creates a directory named "tsrc" and fills it with # copies of all of the C source code and header files needed to @@ -819,14 +859,16 @@ opcodes.lo: opcodes.c # Rule to build the Win32 resources object file. # -sqlite3res.lo: $(TOP)\src\sqlite3.rc $(HDR) +!IF $(USE_RC)!=0 +$(LIBRESOBJS): $(TOP)\src\sqlite3.rc $(HDR) echo #ifndef SQLITE_RESOURCE_VERSION > sqlite3rc.h - for /F %%V in ('type VERSION') do ( \ + for /F %%V in ('type "$(TOP)\VERSION"') do ( \ echo #define SQLITE_RESOURCE_VERSION %%V \ | $(NAWK) "/.*/ { gsub(/[.]/,\",\");print }" >> sqlite3rc.h \ ) echo #endif >> sqlite3rc.h - $(LTRCOMPILE) -fo sqlite3res.lo $(TOP)\src\sqlite3.rc + $(LTRCOMPILE) -fo $(LIBRESOBJS) $(TOP)\src\sqlite3.rc +!ENDIF # Rules to build individual *.lo files from files in the src directory. # @@ -1043,8 +1085,8 @@ tclsqlite.lo: $(TOP)\src\tclsqlite.c $(HDR) tclsqlite-shell.lo: $(TOP)\src\tclsqlite.c $(HDR) $(LTCOMPILE) -DTCLSH=1 -DBUILD_sqlite -I$(TCLINCDIR) -c $(TOP)\src\tclsqlite.c -tclsqlite3.exe: tclsqlite-shell.lo libsqlite3.lib sqlite3res.lo - $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /OUT:$@ libsqlite3.lib tclsqlite-shell.lo sqlite3res.lo $(LTLIBS) $(TLIBS) +tclsqlite3.exe: tclsqlite-shell.lo libsqlite3.lib $(LIBRESOBJS) + $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /OUT:$@ libsqlite3.lib tclsqlite-shell.lo $(LIBRESOBJS) $(LTLIBS) $(TLIBS) # Rules to build opcodes.c and opcodes.h # @@ -1157,11 +1199,11 @@ TESTFIXTURE_SRC = $(TESTSRC) $(TOP)\src\tclsqlite.c $(TESTFIXTURE_SRC0) TESTFIXTURE_SRC = $(TESTSRC) $(TOP)\src\tclsqlite.c $(TESTFIXTURE_SRC1) !ENDIF -testfixture.exe: $(TESTFIXTURE_SRC) sqlite3res.lo $(HDR) +testfixture.exe: $(TESTFIXTURE_SRC) $(LIBRESOBJS) $(HDR) $(LTLINK) -DSQLITE_NO_SYNC=1 $(TESTFIXTURE_FLAGS) \ -DBUILD_sqlite -I$(TCLINCDIR) \ $(TESTFIXTURE_SRC) \ - /link $(LTLINKOPTS) $(LTLIBPATHS) sqlite3res.lo $(LTLIBS) $(TLIBS) + /link $(LTLINKOPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LTLIBS) $(TLIBS) fulltest: testfixture.exe sqlite3.exe .\testfixture.exe $(TOP)\test\all.test @@ -1169,6 +1211,9 @@ fulltest: testfixture.exe sqlite3.exe soaktest: testfixture.exe sqlite3.exe .\testfixture.exe $(TOP)\test\all.test -soak=1 +fulltestonly: testfixture.exe sqlite3.exe + .\testfixture.exe $(TOP)\test\full.test + test: testfixture.exe sqlite3.exe .\testfixture.exe $(TOP)\test\veryquick.test @@ -1179,9 +1224,9 @@ sqlite3_analyzer.c: sqlite3.c $(TOP)\src\test_stat.c $(TOP)\src\tclsqlite.c $(TO $(NAWK) -f $(TOP)\tool\tostr.awk $(TOP)\tool\spaceanal.tcl >> $@ echo ; return zMainloop; } >> $@ -sqlite3_analyzer.exe: sqlite3_analyzer.c sqlite3res.lo +sqlite3_analyzer.exe: sqlite3_analyzer.c $(LIBRESOBJS) $(LTLINK) -DBUILD_sqlite -DTCLSH=2 -I$(TCLINCDIR) sqlite3_analyzer.c \ - /link $(LTLINKOPTS) $(LTLIBPATHS) sqlite3res.lo $(LTLIBS) $(TLIBS) + /link $(LTLINKOPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LTLIBS) $(TLIBS) clean: del /Q *.lo *.ilk *.lib *.obj *.pdb sqlite3.exe libsqlite3.lib @@ -1214,5 +1259,5 @@ sqlite3.def: libsqlite3.lib | $(NAWK) "/ 1 _?sqlite3_/ { sub(/^.* _?/,\"\");print }" \ | sort >> sqlite3.def -sqlite3.dll: $(LIBOBJ) sqlite3res.lo sqlite3.def - $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL /DEF:sqlite3.def /OUT:$@ $(LIBOBJ) sqlite3res.lo $(LTLIBS) $(TLIBS) +sqlite3.dll: $(LIBOBJ) $(LIBRESOBJS) sqlite3.def + $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL /DEF:sqlite3.def /OUT:$@ $(LIBOBJ) $(LIBRESOBJS) $(LTLIBS) $(TLIBS) diff --git a/manifest b/manifest index 6cd0a460ac..95a4199c00 100644 --- a/manifest +++ b/manifest @@ -1,9 +1,9 @@ -C Version\s3.7.14.1 -D 2012-10-04T19:37:12.994 +C Backport\sof\stooling\ssupport\sfor\sincluding\sthe\sdebug\sbuild\sin\sthe\sVSIX\spackage. +D 2012-10-12T18:22:51.788 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in abd5c10d21d1395f140d9e50ea999df8fa4d6376 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 -F Makefile.msc 2d696f01c228995e98b3b953a08b7bba1d48c130 +F Makefile.msc 1d8a5d3cf33b8b8d3247c99367a37af384cc7ebd F Makefile.vxworks 879f034a64062a364b21000266bbd5bc6e0c19b9 F README cd04a36fbc7ea56932a4052d7d0b7f09f27c33d6 F VERSION 9694dff497fc7e53037a5890f30ab069c26e8ab7 @@ -971,7 +971,7 @@ F test/wherelimit.test 5e9fd41e79bb2b2d588ed999d641d9c965619b31 F test/win32lock.test b2a539e85ae6b2d78475e016a9636b4451dc7fb9 F test/zeroblob.test caaecfb4f908f7bc086ed238668049f96774d688 F test/zerodamage.test 0de750389990b1078bab203c712dc3fefd1d8b82 -F tool/build-all-msvc.bat 1a18aa39983ae7354d834bc55a850a54fc007576 x +F tool/build-all-msvc.bat 76b835e0ab91e30f22d8aa48db9dea4d2dc59e9f x F tool/build-shell.sh b64a481901fc9ffe5ca8812a2a9255b6cfb77381 F tool/checkSpacing.c 810e51703529a204fc4e1eb060e9ab663e3c06d2 F tool/diffdb.c 7524b1b5df217c20cd0431f6789851a4e0cb191b @@ -989,7 +989,7 @@ F tool/mksqlite3c-noext.tcl 8bce31074e4cbe631bb7676526a048335f4c9f02 F tool/mksqlite3c.tcl 589c7f44e990be1b8443cfe4808dce392b0327fa F tool/mksqlite3h.tcl 78013ad79a5e492e5f764f3c7a8ef834255061f8 F tool/mksqlite3internalh.tcl 3dca7bb5374cee003379b8cbac73714f610ef795 -F tool/mkvsix.tcl 19b2ab9ea16445953a76568a5bbe4cb864f92dfe +F tool/mkvsix.tcl a27951f30bb39c3504196610f17f687fc0b1c94d F tool/offsets.c fe4262fdfa378e8f5499a42136d17bf3b98f6091 F tool/omittest.tcl 4665982e95a6e5c1bd806cf7bc3dea95be422d77 F tool/opcodeDoc.awk b3a2a3d5d3075b8bd90b7afe24283efdd586659c @@ -1014,10 +1014,7 @@ F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381 F tool/win/sqlite.vsix 67d8a99aceb56384a81b3f30d6c71743146d2cc9 -P 81fd941da62956e32d1c4ffcdb39abecba7a6f3b -R a82bf185a73888ab1f23d02429bade9e -T +bgcolor * #d0c0ff -T +sym-release * -T +sym-version-3.7.14.1 * -U drh -Z 002ec98f7f5b76deaac3a726393245f3 +P 091570e46d04e84b67228e0bdbcd6e1fb60c6bdb +R bcccfde8794119107a5caab4043fcd6f +U mistachkin +Z 3c221b4f8f4bd86b2446cbb21b2a832f diff --git a/manifest.uuid b/manifest.uuid index e9782c2f27..a6fe80536f 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -091570e46d04e84b67228e0bdbcd6e1fb60c6bdb \ No newline at end of file +c188896719cb6b942936e27fab4ead52e2c63c54 \ No newline at end of file diff --git a/tool/build-all-msvc.bat b/tool/build-all-msvc.bat index a2d7dae3a3..989a2af795 100755 --- a/tool/build-all-msvc.bat +++ b/tool/build-all-msvc.bat @@ -10,6 +10,7 @@ SETLOCAL REM SET __ECHO=ECHO REM SET __ECHO2=ECHO +REM SET __ECHO3=ECHO IF NOT DEFINED _AECHO (SET _AECHO=REM) IF NOT DEFINED _CECHO (SET _CECHO=REM) IF NOT DEFINED _VECHO (SET _VECHO=REM) @@ -142,7 +143,7 @@ FOR %%P IN (%PLATFORMS%) DO ( REM be used for the name of the platform-specific binary directory via REM the environment variables setup earlier. REM - CALL :fn_SetVariable %%P_NAME PLATFORMNAME + CALL :fn_CopyVariable %%P_NAME PLATFORMNAME REM REM NOTE: This is the inner loop. There should be exactly one iteration. @@ -181,129 +182,144 @@ FOR %%P IN (%PLATFORMS%) DO ( REM SET PATH=%TOOLPATH%;%SystemRoot%\System32;%SystemRoot% - REM - REM NOTE: Launch a nested command shell to perform the following steps: - REM - REM 1. Setup the MSVC environment for this platform using the - REM official batch file. - REM - REM 2. Make sure that no stale build output files are present. - REM - REM 3. Build the "sqlite3.dll" and "sqlite3.lib" binaries for this - REM platform. - REM - REM 4. Copy the "sqlite3.dll" and "sqlite3.lib" binaries for this - REM platform to the platform-specific directory beneath the - REM binary directory. - REM - "%ComSpec%" /C ( + FOR %%B IN (Debug Retail) DO ( REM - REM NOTE: Attempt to setup the MSVC environment for this platform. + REM NOTE: When preparing the debug build, set the DEBUG and MEMDEBUG + REM environment variables to be picked up by the MSVC makefile + REM itself. REM - %__ECHO% CALL "%VCINSTALLDIR%\vcvarsall.bat" %%P - - IF ERRORLEVEL 1 ( - ECHO Failed to call "%VCINSTALLDIR%\vcvarsall.bat" for platform %%P. - GOTO errors + IF /I "%%B" == "Debug" ( + SET DEBUG=2 + SET MEMDEBUG=1 + ) ELSE ( + CALL :fn_UnsetVariable DEBUG + CALL :fn_UnsetVariable MEMDEBUG ) REM - REM NOTE: If this batch file is not running in "what-if" mode, check to - REM be sure we were actually able to setup the MSVC environment as - REM current versions of their official batch file do not set the - REM exit code upon failure. + REM NOTE: Launch a nested command shell to perform the following steps: REM - IF NOT DEFINED __ECHO ( - IF NOT DEFINED WindowsSdkDir ( - ECHO Cannot build, Windows SDK not found for platform %%P. - GOTO errors - ) - ) - + REM 1. Setup the MSVC environment for this platform using the + REM official batch file. REM - REM NOTE: When using MSVC 2012, the native SDK path cannot simply use - REM the "lib" sub-directory beneath the location specified in the - REM WindowsSdkDir environment variable because that location does - REM not actually contain the necessary library files for x86. - REM This must be done for each iteration because it relies upon - REM the WindowsSdkDir environment variable being set by the batch - REM file used to setup the MSVC environment. + REM 2. Make sure that no stale build output files are present. REM - IF DEFINED SET_NSDKLIBPATH ( - CALL :fn_SetVariable WindowsSdkDir NSDKLIBPATH - CALL :fn_AppendVariable NSDKLIBPATH \lib\win8\um\x86 - ) - + REM 3. Build the "sqlite3.dll" and "sqlite3.lib" binaries for this + REM platform. REM - REM NOTE: Unless prevented from doing so, invoke NMAKE with the MSVC - REM makefile to clean any stale build output from previous - REM iterations of this loop and/or previous runs of this batch - REM file, etc. + REM 4. Copy the "sqlite3.dll" and "sqlite3.lib" binaries for this + REM platform to the platform-specific directory beneath the + REM binary directory. REM - IF NOT DEFINED NOCLEAN ( - %__ECHO% nmake -f Makefile.msc clean + "%ComSpec%" /C ( + REM + REM NOTE: Attempt to setup the MSVC environment for this platform. + REM + %__ECHO3% CALL "%VCINSTALLDIR%\vcvarsall.bat" %%P IF ERRORLEVEL 1 ( - ECHO Failed to clean for platform %%P. + ECHO Failed to call "%VCINSTALLDIR%\vcvarsall.bat" for platform %%P. GOTO errors ) - ) ELSE ( + REM - REM NOTE: Even when the cleaning step has been disabled, we still need - REM to remove the build output for the files we are specifically - REM wanting to build for each platform. + REM NOTE: If this batch file is not running in "what-if" mode, check to + REM be sure we were actually able to setup the MSVC environment + REM as current versions of their official batch file do not set + REM the exit code upon failure. REM - %__ECHO% DEL /Q sqlite3.dll sqlite3.lib sqlite3.pdb - ) + IF NOT DEFINED __ECHO ( + IF NOT DEFINED WindowsSdkDir ( + ECHO Cannot build, Windows SDK not found for platform %%P. + GOTO errors + ) + ) - REM - REM NOTE: Invoke NMAKE with the MSVC makefile to build the "sqlite3.dll" - REM binary. The x86 compiler will be used to compile the native - REM command line tools needed during the build process itself. - REM Also, disable looking for and/or linking to the native Tcl - REM runtime library. - REM - %__ECHO% nmake -f Makefile.msc sqlite3.dll "NCC=""%VCINSTALLDIR%\bin\cl.exe""" USE_NATIVE_LIBPATHS=1 NO_TCL=1 %NMAKE_ARGS% + REM + REM NOTE: When using MSVC 2012, the native SDK path cannot simply use + REM the "lib" sub-directory beneath the location specified in the + REM WindowsSdkDir environment variable because that location does + REM not actually contain the necessary library files for x86. + REM This must be done for each iteration because it relies upon + REM the WindowsSdkDir environment variable being set by the batch + REM file used to setup the MSVC environment. + REM + IF DEFINED SET_NSDKLIBPATH ( + CALL :fn_CopyVariable WindowsSdkDir NSDKLIBPATH + CALL :fn_AppendVariable NSDKLIBPATH \lib\win8\um\x86 + ) - IF ERRORLEVEL 1 ( - ECHO Failed to build "sqlite3.dll" for platform %%P. - GOTO errors - ) + REM + REM NOTE: Unless prevented from doing so, invoke NMAKE with the MSVC + REM makefile to clean any stale build output from previous + REM iterations of this loop and/or previous runs of this batch + REM file, etc. + REM + IF NOT DEFINED NOCLEAN ( + %__ECHO% nmake -f Makefile.msc clean + + IF ERRORLEVEL 1 ( + ECHO Failed to clean for platform %%P. + GOTO errors + ) + ) ELSE ( + REM + REM NOTE: Even when the cleaning step has been disabled, we still + REM need to remove the build output for the files we are + REM specifically wanting to build for each platform. + REM + %__ECHO% DEL /Q sqlite3.dll sqlite3.lib sqlite3.pdb + ) - REM - REM NOTE: Copy the "sqlite3.dll" file to the platform-specific directory - REM beneath the binary directory. - REM - %__ECHO% XCOPY sqlite3.dll "%BINARYDIRECTORY%\%%D\" %FFLAGS% %DFLAGS% + REM + REM NOTE: Call NMAKE with the MSVC makefile to build the "sqlite3.dll" + REM binary. The x86 compiler will be used to compile the native + REM command line tools needed during the build process itself. + REM Also, disable looking for and/or linking to the native Tcl + REM runtime library. + REM + %__ECHO% nmake -f Makefile.msc sqlite3.dll XCOMPILE=1 USE_NATIVE_LIBPATHS=1 NO_TCL=1 %NMAKE_ARGS% - IF ERRORLEVEL 1 ( - ECHO Failed to copy "sqlite3.dll" to "%BINARYDIRECTORY%\%%D\". - GOTO errors - ) + IF ERRORLEVEL 1 ( + ECHO Failed to build %%B "sqlite3.dll" for platform %%P. + GOTO errors + ) - REM - REM NOTE: Copy the "sqlite3.lib" file to the platform-specific directory - REM beneath the binary directory. - REM - %__ECHO% XCOPY sqlite3.lib "%BINARYDIRECTORY%\%%D\" %FFLAGS% %DFLAGS% + REM + REM NOTE: Copy the "sqlite3.dll" file to the appropriate directory for + REM the build and platform beneath the binary directory. + REM + %__ECHO% XCOPY sqlite3.dll "%BINARYDIRECTORY%\%%B\%%D\" %FFLAGS% %DFLAGS% - IF ERRORLEVEL 1 ( - ECHO Failed to copy "sqlite3.lib" to "%BINARYDIRECTORY%\%%D\". - GOTO errors - ) + IF ERRORLEVEL 1 ( + ECHO Failed to copy "sqlite3.dll" to "%BINARYDIRECTORY%\%%B\%%D\". + GOTO errors + ) - REM - REM NOTE: Copy the "sqlite3.pdb" file to the platform-specific directory - REM beneath the binary directory unless we are prevented from doing - REM so. - REM - IF NOT DEFINED NOSYMBOLS ( - %__ECHO% XCOPY sqlite3.pdb "%BINARYDIRECTORY%\%%D\" %FFLAGS% %DFLAGS% + REM + REM NOTE: Copy the "sqlite3.lib" file to the appropriate directory for + REM the build and platform beneath the binary directory. + REM + %__ECHO% XCOPY sqlite3.lib "%BINARYDIRECTORY%\%%B\%%D\" %FFLAGS% %DFLAGS% IF ERRORLEVEL 1 ( - ECHO Failed to copy "sqlite3.pdb" to "%BINARYDIRECTORY%\%%D\". + ECHO Failed to copy "sqlite3.lib" to "%BINARYDIRECTORY%\%%B\%%D\". GOTO errors ) + + REM + REM NOTE: Copy the "sqlite3.pdb" file to the appropriate directory for + REM the build and platform beneath the binary directory unless we + REM are prevented from doing so. + REM + IF NOT DEFINED NOSYMBOLS ( + %__ECHO% XCOPY sqlite3.pdb "%BINARYDIRECTORY%\%%B\%%D\" %FFLAGS% %DFLAGS% + + IF ERRORLEVEL 1 ( + ECHO Failed to copy "sqlite3.pdb" to "%BINARYDIRECTORY%\%%B\%%D\". + GOTO errors + ) + ) ) ) ) @@ -339,7 +355,7 @@ GOTO no_errors VERIFY MAYBE 2> NUL GOTO :EOF -:fn_SetVariable +:fn_CopyVariable SETLOCAL IF NOT DEFINED %1 GOTO :EOF IF "%2" == "" GOTO :EOF diff --git a/tool/mkvsix.tcl b/tool/mkvsix.tcl index a7517786c5..6a84758cc8 100644 --- a/tool/mkvsix.tcl +++ b/tool/mkvsix.tcl @@ -90,12 +90,13 @@ proc substFile { fileName } { return [writeFile $fileName [uplevel 1 [list subst [readFile $fileName]]]] } -proc replacePlatform { fileName platformName } { +proc replaceBuildAndPlatform { fileName buildName platformName } { # # NOTE: Returns the specified file name containing the platform name instead # of platform placeholder tokens. # - return [string map [list $platformName] $fileName] + return [string map [list $buildName $platformName] \ + $fileName] } set script [file normalize [info script]] @@ -249,12 +250,12 @@ if {![regexp -line -- $pattern $data dummy version]} then { if {![info exists fileNames(source)]} then { set fileNames(source) [list "" "" "" \ [file join $sourceDirectory sqlite3.h] \ - [file join $binaryDirectory sqlite3.lib] \ - [file join $binaryDirectory sqlite3.dll]] + [file join $binaryDirectory sqlite3.lib] \ + [file join $binaryDirectory sqlite3.dll]] if {![info exists no(symbols)]} then { lappend fileNames(source) \ - [file join $binaryDirectory sqlite3.pdb] + [file join $binaryDirectory sqlite3.pdb] } } @@ -262,27 +263,31 @@ if {![info exists fileNames(destination)]} then { set fileNames(destination) [list \ [file join $stagingDirectory extension.vsixmanifest] \ [file join $stagingDirectory SDKManifest.xml] \ - [file join $stagingDirectory DesignTime CommonConfiguration \ - SQLite.WinRT.props] \ - [file join $stagingDirectory DesignTime CommonConfiguration \ - sqlite3.h] \ - [file join $stagingDirectory DesignTime CommonConfiguration \ - sqlite3.lib] \ - [file join $stagingDirectory Redist CommonConfiguration \ - sqlite3.dll]] + [file join $stagingDirectory DesignTime \ + SQLite.WinRT.props] \ + [file join $stagingDirectory DesignTime sqlite3.h] \ + [file join $stagingDirectory DesignTime sqlite3.lib] \ + [file join $stagingDirectory Redist sqlite3.dll]] if {![info exists no(symbols)]} then { lappend fileNames(destination) \ - [file join $stagingDirectory Redist Debug \ - sqlite3.pdb] + [file join $stagingDirectory Redist sqlite3.pdb] } } -if {![info exists fileNames(neutral)]} then { - set fileNames(neutral) [list 1 1 1 1 0 0] +if {![info exists fileNames(buildNeutral)]} then { + set fileNames(buildNeutral) [list 1 1 1 1 0 0] if {![info exists no(symbols)]} then { - lappend fileNames(neutral) 0 + lappend fileNames(buildNeutral) 0 + } +} + +if {![info exists fileNames(platformNeutral)]} then { + set fileNames(platformNeutral) [list 1 1 1 1 0 0] + + if {![info exists no(symbols)]} then { + lappend fileNames(platformNeutral) 0 } } @@ -294,6 +299,31 @@ if {![info exists fileNames(subst)]} then { } } +if {![info exists fileNames(noDebug)]} then { + set fileNames(noDebug) [list 0 0 0 0 0 0] + + if {![info exists no(symbols)]} then { + lappend fileNames(noDebug) 0 + } +} + +if {![info exists fileNames(noRetail)]} then { + set fileNames(noRetail) [list 0 0 0 0 0 0] + + if {![info exists no(symbols)]} then { + lappend fileNames(noRetail) 1 + } +} + +############################################################################### + +# +# NOTE: Setup the list of builds supported by this script. +# +if {![info exists buildNames]} then { + set buildNames [list Debug Retail] +} + ############################################################################### # @@ -338,45 +368,63 @@ eval $extractCommand # foreach sourceFileName $fileNames(source) \ destinationFileName $fileNames(destination) \ - isNeutral $fileNames(neutral) useSubst $fileNames(subst) { + buildNeutral $fileNames(buildNeutral) platformNeutral \ + $fileNames(platformNeutral) useSubst $fileNames(subst) \ + noDebug $fileNames(noDebug) noRetail $fileNames(noRetail) { # - # NOTE: If the current file is platform-neutral, then only one platform will - # be processed for it, namely "neutral"; otherwise, each supported - # platform will be processed for it individually. + # NOTE: If the current file is build-neutral, then only one build will + # be processed for it, namely "CommonConfiguration"; otherwise, each + # supported build will be processed for it individually. # - foreach platformName [expr {$isNeutral ? [list neutral] : $platformNames}] { + foreach buildName \ + [expr {$buildNeutral ? [list CommonConfiguration] : $buildNames}] { # - # NOTE: Use the actual platform name in the destination file name. + # NOTE: Should the current file be skipped for this build? # - set newDestinationFileName [replacePlatform $destinationFileName \ - $platformName] + if {[info exists no${buildName}] && [set no${buildName}]} then { + continue + } # - # NOTE: Does the source file need to be copied to the destination file? + # NOTE: If the current file is platform-neutral, then only one platform + # will be processed for it, namely "neutral"; otherwise, each + # supported platform will be processed for it individually. # - if {[string length $sourceFileName] > 0} then { + foreach platformName \ + [expr {$platformNeutral ? [list neutral] : $platformNames}] { # - # NOTE: First, make sure the destination directory exists. + # NOTE: Use the actual platform name in the destination file name. # - file mkdir [file dirname $newDestinationFileName] + set newDestinationFileName [replaceBuildAndPlatform \ + $destinationFileName $buildName $platformName] # - # NOTE: Then, copy the source file to the destination file verbatim. + # NOTE: Does the source file need to be copied to the destination file? # - file copy [replacePlatform $sourceFileName $platformName] \ - $newDestinationFileName - } + if {[string length $sourceFileName] > 0} then { + # + # NOTE: First, make sure the destination directory exists. + # + file mkdir [file dirname $newDestinationFileName] + + # + # NOTE: Then, copy the source file to the destination file verbatim. + # + file copy [replaceBuildAndPlatform $sourceFileName $buildName \ + $platformName] $newDestinationFileName + } - # - # NOTE: Does the destination file contain dynamic replacements that must - # be processed now? - # - if {$useSubst} then { # - # NOTE: Perform any dynamic replacements contained in the destination - # file and then re-write it in-place. + # NOTE: Does the destination file contain dynamic replacements that must + # be processed now? # - substFile $newDestinationFileName + if {$useSubst} then { + # + # NOTE: Perform any dynamic replacements contained in the destination + # file and then re-write it in-place. + # + substFile $newDestinationFileName + } } } }