@@ -15,6 +15,12 @@ USE_AMALGAMATION = 1
1515#
1616USE_ICU = 0
1717
18+ # Set this non-0 to compile binaries suitable for the WinRT environment.
19+ # This setting does not apply to any binaries that require Tcl to operate
20+ # properly (i.e. the text fixture, etc).
21+ #
22+ FOR_WINRT = 0
23+
1824# Set this to non-0 to create and use PDBs.
1925#
2026SYMBOLS = 1
@@ -32,24 +38,29 @@ SYMBOLS = 1
3238#
3339DEBUG = 0
3440
35- # Version numbers and release number for the SQLite being compiled.
36- #
37- VERSION = 3.7
38- VERSION_NUMBER = 3007009
39- RELEASE = 3.7.9
40-
4141# C Compiler and options for use in building executables that
4242# will run on the platform that is doing the build.
4343#
44- BCC = cl.exe
44+ BCC = cl.exe -W3
4545
4646# C Compile and options for use in building executables that
4747# will run on the target platform. (BCC and TCC are usually the
4848# same unless your are cross-compiling.)
4949#
5050TCC = cl.exe -W3 -DSQLITE_OS_WIN=1 -I. -I$(TOP)\src -fp:precise
5151
52- # The mksqlite3c.tcl and mksqlite3h.tcl scripts will pull in
52+ # When compiling the library for use in the WinRT environment,
53+ # the following compile-time options must be used as well to
54+ # disable use of Win32 APIs that are not available and to enable
55+ # use of Win32 APIs that are specific to Windows 8 and/or WinRT.
56+ # Also, we need to dynamically link to the MSVC runtime when
57+ # compiling for WinRT.
58+ #
59+ !IF $(FOR_WINRT)!=0
60+ TCC = $(TCC) -DSQLITE_OS_WINRT=1 -MD
61+ !ENDIF
62+
63+ # The mksqlite3c.tcl and mksqlite3h.tcl scripts will pull in
5364# any extension header files by default. For non-amalgamation
5465# builds, we need to make sure the compiler can find these.
5566#
@@ -64,6 +75,7 @@ TCC = $(TCC) -I$(TOP)\ext\rtree
6475#
6576!IF $(DEBUG)==0
6677TCC = $(TCC) -DNDEBUG
78+ BCC = $(BCC) -DNDEBUG
6779!ENDIF
6880
6981!IF $(DEBUG)>1
@@ -82,6 +94,7 @@ TCC = $(TCC) -DSQLITE_ENABLE_IOTRACE
8294# Prevent warnings about "insecure" runtime library functions being used.
8395#
8496TCC = $(TCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
97+ BCC = $(BCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
8598
8699#
87100# Use native Win32 heap instead of malloc/free?
@@ -194,12 +207,15 @@ TCC = $(TCC) $(OPTS)
194207# If debugging is enabled, disable all optimizations and enable PDBs.
195208!IF $(DEBUG)>0
196209TCC = $(TCC) -Od -D_DEBUG
210+ BCC = $(BCC) -Od -D_DEBUG
197211!ELSE
198212TCC = $(TCC) -O2
213+ BCC = $(BCC) -O2
199214!ENDIF
200215
201216!IF $(DEBUG)>0 || $(SYMBOLS)!=0
202217TCC = $(TCC) -Zi
218+ BCC = $(BCC) -Zi
203219!ENDIF
204220
205221# If ICU support is enabled, add the compiler options for it.
@@ -223,9 +239,18 @@ LTLINKOPTS = /MACHINE:$(PLATFORM)
223239LTLIBOPTS = /MACHINE:$(PLATFORM)
224240!ENDIF
225241
226- # If debugging is enabled, enable PDBs.
242+ # When compiling for use in the WinRT environment, the following
243+ # linker option must be used to mark the executable as runnable
244+ # only in the context of an application container.
245+ #
246+ !IF $(FOR_WINRT)!=0
247+ LTLINKOPTS = $(LTLINKOPTS) /APPCONTAINER
248+ !ENDIF
249+
250+ # If either debugging or symbols are enabled, enable PDBs.
227251!IF $(DEBUG)>0 || $(SYMBOLS)!=0
228252LTLINKOPTS = $(LTLINKOPTS) /DEBUG
253+ BCC = $(BCC) /DEBUG
229254!ENDIF
230255
231256# Start with the Tcl related linker options.
@@ -250,8 +275,9 @@ LIBOBJS0 = alter.lo analyze.lo attach.lo auth.lo \
250275 backup.lo bitvec.lo btmutex.lo btree.lo build.lo \
251276 callback.lo complete.lo ctime.lo date.lo delete.lo \
252277 expr.lo fault.lo fkey.lo \
253- fts3.lo fts3_aux.lo fts3_expr.lo fts3_hash.lo fts3_icu.lo fts3_porter.lo \
254- fts3_snippet.lo fts3_tokenizer.lo fts3_tokenizer1.lo fts3_write.lo \
278+ fts3.lo fts3_aux.lo fts3_expr.lo fts3_hash.lo fts3_icu.lo \
279+ fts3_porter.lo fts3_snippet.lo fts3_tokenizer.lo fts3_tokenizer1.lo \
280+ fts3_unicode.lo fts3_unicode2.lo fts3_write.lo \
255281 func.lo global.lo hash.lo \
256282 icu.lo insert.lo journal.lo legacy.lo loadext.lo \
257283 main.lo malloc.lo mem0.lo mem1.lo mem2.lo mem3.lo mem5.lo \
@@ -405,6 +431,8 @@ SRC = $(SRC) \
405431 $(TOP)\ext\fts3\fts3_tokenizer.h \
406432 $(TOP)\ext\fts3\fts3_tokenizer.c \
407433 $(TOP)\ext\fts3\fts3_tokenizer1.c \
434+ $(TOP)\ext\fts3\fts3_unicode.c \
435+ $(TOP)\ext\fts3\fts3_unicode2.c \
408436 $(TOP)\ext\fts3\fts3_write.c
409437SRC = $(SRC) \
410438 $(TOP)\ext\icu\sqliteicu.h \
@@ -512,6 +540,8 @@ TESTSRC2 = \
512540 $(TOP)\ext\fts3\fts3_aux.c \
513541 $(TOP)\ext\fts3\fts3_expr.c \
514542 $(TOP)\ext\fts3\fts3_tokenizer.c \
543+ $(TOP)\ext\fts3\fts3_unicode.c \
544+ $(TOP)\ext\fts3\fts3_unicode2.c \
515545 $(TOP)\ext\fts3\fts3_write.c \
516546 $(TOP)\ext\async\sqlite3async.c
517547
@@ -926,6 +956,12 @@ fts3_tokenizer.lo: $(TOP)\ext\fts3\fts3_tokenizer.c $(HDR) $(EXTHDR)
926956fts3_tokenizer1.lo: $(TOP)\ext\fts3\fts3_tokenizer1.c $(HDR) $(EXTHDR)
927957 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_tokenizer1.c
928958
959+ fts3_unicode.lo: $(TOP)\ext\fts3\fts3_unicode.c $(HDR) $(EXTHDR)
960+ $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_unicode.c
961+
962+ fts3_unicode2.lo: $(TOP)\ext\fts3\fts3_unicode2.c $(HDR) $(EXTHDR)
963+ $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_unicode2.c
964+
929965fts3_write.lo: $(TOP)\ext\fts3\fts3_write.c $(HDR) $(EXTHDR)
930966 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_write.c
931967
0 commit comments