├── .gitignore
├── .gitmodules
├── .travis.yml
├── Build
├── Makefile
├── catch_test.make
├── catch_test.vcxproj
├── catch_test.vcxproj.filters
├── hiberlite.make
├── hiberlite.sln
├── hiberlite.vcxproj
├── hiberlite.vcxproj.filters
├── hiberlite_test.make
├── hiberlite_test.vcxproj
├── hiberlite_test.vcxproj.filters
├── sample.make
├── sample.vcxproj
├── sample.vcxproj.filters
├── sqlite.make
├── sqlite.vcxproj
└── sqlite.vcxproj.filters
├── CMakeLists.txt
├── LICENSE
├── Makefile
├── README
├── README.md
├── catch_tests.cpp
├── include
├── BeanLoader.h
├── BeanLoader_impl.hpp
├── BeanUpdater.h
├── BeanUpdater_impl.hpp
├── ChildKiller.h
├── ChildKiller_impl.hpp
├── CppModel.h
├── Database.h
├── Database_tmpl_impl.hpp
├── ModelExtractor.h
├── ModelExtractor_impl.hpp
├── Registry.h
├── Registry_impl.hpp
├── SQLiteStmt.h
├── UpdateVisitor_tmpl.hpp
├── Visitor.h
├── Visitor_tmpl_impl.hpp
├── bean_ptr.h
├── bean_ptr_impl.hpp
├── common.h
├── db_error.h
├── hiberdefs.h
├── hiberlite.h
├── nvp.h
├── shared_res.h
└── some_types.h
├── make_vs2013.bat
├── premake5.lua
├── sample.cpp
├── src
├── BeanLoader.cpp
├── BeanUpdater.cpp
├── ChildKiller.cpp
├── CppModel.cpp
├── Database.cpp
├── ModelExtractor.cpp
├── Registry.cpp
├── SQLiteStmt.cpp
├── Visitor.cpp
└── shared_res.cpp
└── tests.cpp
/.gitignore:
--------------------------------------------------------------------------------
1 | #################
2 | ## Eclipse
3 | #################
4 |
5 | *.pydevproject
6 | .project
7 | .metadata
8 | bin/
9 | tmp/
10 | *.tmp
11 | *.bak
12 | *.swp
13 | *~.nib
14 | local.properties
15 | .classpath
16 | .settings/
17 | .loadpath
18 |
19 | # External tool builders
20 | .externalToolBuilders/
21 |
22 | # Locally stored "Eclipse launch configurations"
23 | *.launch
24 |
25 | # CDT-specific
26 | .cproject
27 |
28 | # PDT-specific
29 | .buildpath
30 |
31 |
32 | #################
33 | ## Visual Studio
34 | #################
35 |
36 | ## Ignore Visual Studio temporary files, build results, and
37 | ## files generated by popular Visual Studio add-ons.
38 |
39 | # User-specific files
40 | *.suo
41 | *.user
42 | *.sln.docstates
43 |
44 | # Build results
45 |
46 | [Dd]ebug/
47 | [Rr]elease/
48 | x64/
49 | [Bb]in/
50 | [Oo]bj/
51 |
52 | # MSTest test Results
53 | [Tt]est[Rr]esult*/
54 | [Bb]uild[Ll]og.*
55 |
56 | *_i.c
57 | *_p.c
58 | *.ilk
59 | *.meta
60 | *.obj
61 | *.pch
62 | *.pdb
63 | *.pgc
64 | *.pgd
65 | *.rsp
66 | *.sbr
67 | *.tlb
68 | *.tli
69 | *.tlh
70 | *.tmp
71 | *.tmp_proj
72 | *.log
73 | *.vspscc
74 | *.vssscc
75 | .builds
76 | *.pidb
77 | *.log
78 | *.scc
79 |
80 | # Visual C++ cache files
81 | ipch/
82 | *.aps
83 | *.ncb
84 | *.opensdf
85 | *.sdf
86 | *.cachefile
87 |
88 | # Visual Studio profiler
89 | *.psess
90 | *.vsp
91 | *.vspx
92 |
93 | # Guidance Automation Toolkit
94 | *.gpState
95 |
96 | # ReSharper is a .NET coding add-in
97 | _ReSharper*/
98 | *.[Rr]e[Ss]harper
99 |
100 | # TeamCity is a build add-in
101 | _TeamCity*
102 |
103 | # DotCover is a Code Coverage Tool
104 | *.dotCover
105 |
106 | # NCrunch
107 | *.ncrunch*
108 | .*crunch*.local.xml
109 |
110 | # Installshield output folder
111 | [Ee]xpress/
112 |
113 | # DocProject is a documentation generator add-in
114 | DocProject/buildhelp/
115 | DocProject/Help/*.HxT
116 | DocProject/Help/*.HxC
117 | DocProject/Help/*.hhc
118 | DocProject/Help/*.hhk
119 | DocProject/Help/*.hhp
120 | DocProject/Help/Html2
121 | DocProject/Help/html
122 |
123 | # Click-Once directory
124 | publish/
125 |
126 | # Publish Web Output
127 | *.Publish.xml
128 | *.pubxml
129 |
130 | # NuGet Packages Directory
131 | ## TODO: If you have NuGet Package Restore enabled, uncomment the next line
132 | #packages/
133 |
134 | # Windows Azure Build Output
135 | csx
136 | *.build.csdef
137 |
138 | # Windows Store app package directory
139 | AppPackages/
140 |
141 | # Others
142 | sql/
143 | *.Cache
144 | ClientBin/
145 | [Ss]tyle[Cc]op.*
146 | ~$*
147 | *~
148 | *.dbmdl
149 | *.[Pp]ublish.xml
150 | *.pfx
151 | *.publishsettings
152 |
153 | # RIA/Silverlight projects
154 | Generated_Code/
155 |
156 | # Backup & report files from converting an old project file to a newer
157 | # Visual Studio version. Backup files are not needed, because we have git ;-)
158 | _UpgradeReport_Files/
159 | Backup*/
160 | UpgradeLog*.XML
161 | UpgradeLog*.htm
162 |
163 | # SQL Server files
164 | App_Data/*.mdf
165 | App_Data/*.ldf
166 |
167 | #############
168 | ## Windows detritus
169 | #############
170 |
171 | # Windows image file caches
172 | Thumbs.db
173 | ehthumbs.db
174 |
175 | # Folder config file
176 | Desktop.ini
177 |
178 | # Recycle Bin used on file shares
179 | $RECYCLE.BIN/
180 |
181 | # Mac crap
182 | .DS_Store
183 |
184 |
185 | #############
186 | ## Python
187 | #############
188 |
189 | *.py[co]
190 |
191 | # Packages
192 | *.egg
193 | *.egg-info
194 | dist/
195 | eggs/
196 | parts/
197 | var/
198 | sdist/
199 | develop-eggs/
200 | .installed.cfg
201 |
202 | # Installer logs
203 | pip-log.txt
204 |
205 | # Unit test / coverage reports
206 | .coverage
207 | .tox
208 |
209 | #Translations
210 | *.mo
211 |
212 | #Mr Developer
213 | .mr.developer.cfg
214 |
215 | *.db
216 | *.idb
217 | *.lib
218 | *.exe
219 | !premake4.exe
220 | *.a
221 | *.opendb
222 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "Catch"]
2 | path = Catch
3 | url = https://github.com/philsquared/Catch.git
4 | [submodule "sqlite-amalgamation"]
5 | path = sqlite-amalgamation
6 | url = https://github.com/sqlg/sqlite-amalgamation.git
7 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: cpp
2 |
3 | sudo: false
4 |
5 | script:
6 | - make -C Build
7 |
--------------------------------------------------------------------------------
/Build/Makefile:
--------------------------------------------------------------------------------
1 | # GNU Make solution makefile autogenerated by Premake
2 | # Type "make help" for usage help
3 |
4 | ifndef config
5 | config=debug
6 | endif
7 | export config
8 |
9 | PROJECTS := hiberlite sqlite sample catch_test hiberlite_test
10 |
11 | .PHONY: all clean help $(PROJECTS)
12 |
13 | all: $(PROJECTS)
14 |
15 | hiberlite:
16 | @echo "==== Building hiberlite ($(config)) ===="
17 | @${MAKE} --no-print-directory -C . -f hiberlite.make
18 |
19 | sqlite:
20 | @echo "==== Building sqlite ($(config)) ===="
21 | @${MAKE} --no-print-directory -C . -f sqlite.make
22 |
23 | sample: hiberlite sqlite
24 | @echo "==== Building sample ($(config)) ===="
25 | @${MAKE} --no-print-directory -C . -f sample.make
26 |
27 | catch_test: hiberlite sqlite
28 | @echo "==== Building catch_test ($(config)) ===="
29 | @${MAKE} --no-print-directory -C . -f catch_test.make
30 |
31 | hiberlite_test: hiberlite sqlite
32 | @echo "==== Building hiberlite_test ($(config)) ===="
33 | @${MAKE} --no-print-directory -C . -f hiberlite_test.make
34 |
35 | clean:
36 | @${MAKE} --no-print-directory -C . -f hiberlite.make clean
37 | @${MAKE} --no-print-directory -C . -f sqlite.make clean
38 | @${MAKE} --no-print-directory -C . -f sample.make clean
39 | @${MAKE} --no-print-directory -C . -f catch_test.make clean
40 | @${MAKE} --no-print-directory -C . -f hiberlite_test.make clean
41 |
42 | help:
43 | @echo "Usage: make [config=name] [target]"
44 | @echo ""
45 | @echo "CONFIGURATIONS:"
46 | @echo " debug"
47 | @echo " release"
48 | @echo " debug32"
49 | @echo " release32"
50 | @echo " debug64"
51 | @echo " release64"
52 | @echo ""
53 | @echo "TARGETS:"
54 | @echo " all (default)"
55 | @echo " clean"
56 | @echo " hiberlite"
57 | @echo " sqlite"
58 | @echo " sample"
59 | @echo " catch_test"
60 | @echo " hiberlite_test"
61 | @echo ""
62 | @echo "For more information, see http://industriousone.com/premake/quick-start"
63 |
--------------------------------------------------------------------------------
/Build/catch_test.make:
--------------------------------------------------------------------------------
1 | # GNU Make project makefile autogenerated by Premake
2 | ifndef config
3 | config=debug
4 | endif
5 |
6 | ifndef verbose
7 | SILENT = @
8 | endif
9 |
10 | ifndef CC
11 | CC = gcc
12 | endif
13 |
14 | ifndef CXX
15 | CXX = g++
16 | endif
17 |
18 | ifndef AR
19 | AR = ar
20 | endif
21 |
22 | ifndef RESCOMP
23 | ifdef WINDRES
24 | RESCOMP = $(WINDRES)
25 | else
26 | RESCOMP = windres
27 | endif
28 | endif
29 |
30 | ifeq ($(config),debug)
31 | OBJDIR = obj/Debug/catch_test
32 | TARGETDIR = ..
33 | TARGET = $(TARGETDIR)/catch_test
34 | DEFINES += -DDEBUG -D_DEBUG
35 | INCLUDES += -I../include -I../sqlite-amalgamation -I../Catch/single_include
36 | CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES)
37 | CFLAGS += $(CPPFLAGS) $(ARCH) -g -v -std=c++0x
38 | CXXFLAGS += $(CFLAGS)
39 | LDFLAGS += -L..
40 | RESFLAGS += $(DEFINES) $(INCLUDES)
41 | LIBS += ../libhiberlite.a ../libsqlite.a -ldl -lpthread
42 | LDDEPS += ../libhiberlite.a ../libsqlite.a
43 | LINKCMD = $(CXX) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(LIBS) $(LDFLAGS)
44 | define PREBUILDCMDS
45 | endef
46 | define PRELINKCMDS
47 | endef
48 | define POSTBUILDCMDS
49 | @echo Running post-build commands
50 | $(TARGET)
51 | endef
52 | endif
53 |
54 | ifeq ($(config),release)
55 | OBJDIR = obj/Release/catch_test
56 | TARGETDIR = ..
57 | TARGET = $(TARGETDIR)/catch_test
58 | DEFINES += -DRELEASE
59 | INCLUDES += -I../include -I../sqlite-amalgamation -I../Catch/single_include
60 | CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES)
61 | CFLAGS += $(CPPFLAGS) $(ARCH) -O2 -v -std=c++0x
62 | CXXFLAGS += $(CFLAGS)
63 | LDFLAGS += -L.. -s
64 | RESFLAGS += $(DEFINES) $(INCLUDES)
65 | LIBS += ../libhiberlite.a ../libsqlite.a -ldl -lpthread
66 | LDDEPS += ../libhiberlite.a ../libsqlite.a
67 | LINKCMD = $(CXX) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(LIBS) $(LDFLAGS)
68 | define PREBUILDCMDS
69 | endef
70 | define PRELINKCMDS
71 | endef
72 | define POSTBUILDCMDS
73 | @echo Running post-build commands
74 | $(TARGET)
75 | endef
76 | endif
77 |
78 | ifeq ($(config),debug32)
79 | OBJDIR = obj/x32/Debug/catch_test
80 | TARGETDIR = ..
81 | TARGET = $(TARGETDIR)/catch_test
82 | DEFINES += -DDEBUG -D_DEBUG
83 | INCLUDES += -I../include -I../sqlite-amalgamation -I../Catch/single_include
84 | CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES)
85 | CFLAGS += $(CPPFLAGS) $(ARCH) -g -m32 -v -std=c++0x
86 | CXXFLAGS += $(CFLAGS)
87 | LDFLAGS += -L.. -m32 -L/usr/lib32
88 | RESFLAGS += $(DEFINES) $(INCLUDES)
89 | LIBS += ../libhiberlite.a ../libsqlite.a -ldl -lpthread
90 | LDDEPS += ../libhiberlite.a ../libsqlite.a
91 | LINKCMD = $(CXX) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(LIBS) $(LDFLAGS)
92 | define PREBUILDCMDS
93 | endef
94 | define PRELINKCMDS
95 | endef
96 | define POSTBUILDCMDS
97 | @echo Running post-build commands
98 | $(TARGET)
99 | endef
100 | endif
101 |
102 | ifeq ($(config),release32)
103 | OBJDIR = obj/x32/Release/catch_test
104 | TARGETDIR = ..
105 | TARGET = $(TARGETDIR)/catch_test
106 | DEFINES += -DRELEASE
107 | INCLUDES += -I../include -I../sqlite-amalgamation -I../Catch/single_include
108 | CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES)
109 | CFLAGS += $(CPPFLAGS) $(ARCH) -O2 -m32 -v -std=c++0x
110 | CXXFLAGS += $(CFLAGS)
111 | LDFLAGS += -L.. -s -m32 -L/usr/lib32
112 | RESFLAGS += $(DEFINES) $(INCLUDES)
113 | LIBS += ../libhiberlite.a ../libsqlite.a -ldl -lpthread
114 | LDDEPS += ../libhiberlite.a ../libsqlite.a
115 | LINKCMD = $(CXX) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(LIBS) $(LDFLAGS)
116 | define PREBUILDCMDS
117 | endef
118 | define PRELINKCMDS
119 | endef
120 | define POSTBUILDCMDS
121 | @echo Running post-build commands
122 | $(TARGET)
123 | endef
124 | endif
125 |
126 | ifeq ($(config),debug64)
127 | OBJDIR = obj/x64/Debug/catch_test
128 | TARGETDIR = ..
129 | TARGET = $(TARGETDIR)/catch_test
130 | DEFINES += -DDEBUG -D_DEBUG
131 | INCLUDES += -I../include -I../sqlite-amalgamation -I../Catch/single_include
132 | CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES)
133 | CFLAGS += $(CPPFLAGS) $(ARCH) -g -m64 -v -std=c++0x
134 | CXXFLAGS += $(CFLAGS)
135 | LDFLAGS += -L.. -m64 -L/usr/lib64
136 | RESFLAGS += $(DEFINES) $(INCLUDES)
137 | LIBS += ../libhiberlite.a ../libsqlite.a -ldl -lpthread
138 | LDDEPS += ../libhiberlite.a ../libsqlite.a
139 | LINKCMD = $(CXX) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(LIBS) $(LDFLAGS)
140 | define PREBUILDCMDS
141 | endef
142 | define PRELINKCMDS
143 | endef
144 | define POSTBUILDCMDS
145 | @echo Running post-build commands
146 | $(TARGET)
147 | endef
148 | endif
149 |
150 | ifeq ($(config),release64)
151 | OBJDIR = obj/x64/Release/catch_test
152 | TARGETDIR = ..
153 | TARGET = $(TARGETDIR)/catch_test
154 | DEFINES += -DRELEASE
155 | INCLUDES += -I../include -I../sqlite-amalgamation -I../Catch/single_include
156 | CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES)
157 | CFLAGS += $(CPPFLAGS) $(ARCH) -O2 -m64 -v -std=c++0x
158 | CXXFLAGS += $(CFLAGS)
159 | LDFLAGS += -L.. -s -m64 -L/usr/lib64
160 | RESFLAGS += $(DEFINES) $(INCLUDES)
161 | LIBS += ../libhiberlite.a ../libsqlite.a -ldl -lpthread
162 | LDDEPS += ../libhiberlite.a ../libsqlite.a
163 | LINKCMD = $(CXX) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(LIBS) $(LDFLAGS)
164 | define PREBUILDCMDS
165 | endef
166 | define PRELINKCMDS
167 | endef
168 | define POSTBUILDCMDS
169 | @echo Running post-build commands
170 | $(TARGET)
171 | endef
172 | endif
173 |
174 | OBJECTS := \
175 | $(OBJDIR)/catch_tests.o \
176 |
177 | RESOURCES := \
178 |
179 | SHELLTYPE := msdos
180 | ifeq (,$(ComSpec)$(COMSPEC))
181 | SHELLTYPE := posix
182 | endif
183 | ifeq (/bin,$(findstring /bin,$(SHELL)))
184 | SHELLTYPE := posix
185 | endif
186 |
187 | .PHONY: clean prebuild prelink
188 |
189 | all: $(TARGETDIR) $(OBJDIR) prebuild prelink $(TARGET)
190 | @:
191 |
192 | $(TARGET): $(GCH) $(OBJECTS) $(LDDEPS) $(RESOURCES)
193 | @echo Linking catch_test
194 | $(SILENT) $(LINKCMD)
195 | $(POSTBUILDCMDS)
196 |
197 | $(TARGETDIR):
198 | @echo Creating $(TARGETDIR)
199 | ifeq (posix,$(SHELLTYPE))
200 | $(SILENT) mkdir -p $(TARGETDIR)
201 | else
202 | $(SILENT) mkdir $(subst /,\\,$(TARGETDIR))
203 | endif
204 |
205 | $(OBJDIR):
206 | @echo Creating $(OBJDIR)
207 | ifeq (posix,$(SHELLTYPE))
208 | $(SILENT) mkdir -p $(OBJDIR)
209 | else
210 | $(SILENT) mkdir $(subst /,\\,$(OBJDIR))
211 | endif
212 |
213 | clean:
214 | @echo Cleaning catch_test
215 | ifeq (posix,$(SHELLTYPE))
216 | $(SILENT) rm -f $(TARGET)
217 | $(SILENT) rm -rf $(OBJDIR)
218 | else
219 | $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET))
220 | $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR))
221 | endif
222 |
223 | prebuild:
224 | $(PREBUILDCMDS)
225 |
226 | prelink:
227 | $(PRELINKCMDS)
228 |
229 | ifneq (,$(PCH))
230 | $(GCH): $(PCH)
231 | @echo $(notdir $<)
232 | ifeq (posix,$(SHELLTYPE))
233 | -$(SILENT) cp $< $(OBJDIR)
234 | else
235 | $(SILENT) xcopy /D /Y /Q "$(subst /,\,$<)" "$(subst /,\,$(OBJDIR))" 1>nul
236 | endif
237 | $(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -MF $(@:%.o=%.d) -c "$<"
238 | endif
239 |
240 | $(OBJDIR)/catch_tests.o: ../catch_tests.cpp
241 | @echo $(notdir $<)
242 | $(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -MF $(@:%.o=%.d) -c "$<"
243 |
244 | -include $(OBJECTS:%.o=%.d)
245 |
--------------------------------------------------------------------------------
/Build/catch_test.vcxproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug native
6 | Win32
7 |
8 |
9 | Debug native
10 | x64
11 |
12 |
13 | Debug
14 | Win32
15 |
16 |
17 | Debug
18 | x64
19 |
20 |
21 | Release native
22 | Win32
23 |
24 |
25 | Release native
26 | x64
27 |
28 |
29 | Release
30 | Win32
31 |
32 |
33 | Release
34 | x64
35 |
36 |
37 |
38 | {27B715B5-136F-5702-7C76-305E684DF2F2}
39 | true
40 | Win32Proj
41 | catch_test
42 |
43 |
44 |
45 | Application
46 | true
47 | MultiByte
48 | v120
49 |
50 |
51 | Application
52 | true
53 | MultiByte
54 | v120
55 |
56 |
57 | Application
58 | true
59 | MultiByte
60 | v120
61 |
62 |
63 | Application
64 | false
65 | MultiByte
66 | v120
67 |
68 |
69 | Application
70 | false
71 | MultiByte
72 | v120
73 |
74 |
75 | Application
76 | false
77 | MultiByte
78 | v120
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 | true
104 | ..\bin\catch_test\Debug\
105 | ..\obj\catch_test\Debug\native\
106 | catch_test
107 | .exe
108 |
109 |
110 | true
111 | ..\bin\catch_test\Debug\
112 | ..\obj\catch_test\Debug\x32\
113 | catch_test
114 | .exe
115 |
116 |
117 | true
118 | ..\bin\catch_test\Debug\
119 | ..\obj\catch_test\Debug\x64\
120 | catch_test
121 | .exe
122 |
123 |
124 | false
125 | ..\bin\catch_test\Release\
126 | ..\obj\catch_test\Release\native\
127 | catch_test
128 | .exe
129 |
130 |
131 | false
132 | ..\bin\catch_test\Release\
133 | ..\obj\catch_test\Release\x32\
134 | catch_test
135 | .exe
136 |
137 |
138 | false
139 | ..\bin\catch_test\Release\
140 | ..\obj\catch_test\Release\x64\
141 | catch_test
142 | .exe
143 |
144 |
145 |
146 | NotUsing
147 | Level3
148 | DEBUG;_DEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)
149 | ..\include;..\sqlite-amalgamation;..\Catch\single_include;%(AdditionalIncludeDirectories)
150 | EditAndContinue
151 | Disabled
152 |
153 |
154 | Console
155 | true
156 | mainCRTStartup
157 |
158 |
159 | "$(TargetPath)"
160 |
161 |
162 |
163 |
164 | NotUsing
165 | Level3
166 | DEBUG;_DEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)
167 | ..\include;..\sqlite-amalgamation;..\Catch\single_include;%(AdditionalIncludeDirectories)
168 | EditAndContinue
169 | Disabled
170 |
171 |
172 | Console
173 | true
174 | mainCRTStartup
175 |
176 |
177 | "$(TargetPath)"
178 |
179 |
180 |
181 |
182 | NotUsing
183 | Level3
184 | DEBUG;_DEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)
185 | ..\include;..\sqlite-amalgamation;..\Catch\single_include;%(AdditionalIncludeDirectories)
186 | ProgramDatabase
187 | Disabled
188 |
189 |
190 | Console
191 | true
192 | mainCRTStartup
193 |
194 |
195 | "$(TargetPath)"
196 |
197 |
198 |
199 |
200 | NotUsing
201 | Level3
202 | RELEASE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)
203 | ..\include;..\sqlite-amalgamation;..\Catch\single_include;%(AdditionalIncludeDirectories)
204 | Full
205 | true
206 | true
207 | false
208 | true
209 |
210 |
211 | Console
212 | false
213 | true
214 | true
215 | mainCRTStartup
216 |
217 |
218 | "$(TargetPath)"
219 |
220 |
221 |
222 |
223 | NotUsing
224 | Level3
225 | RELEASE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)
226 | ..\include;..\sqlite-amalgamation;..\Catch\single_include;%(AdditionalIncludeDirectories)
227 | Full
228 | true
229 | true
230 | false
231 | true
232 |
233 |
234 | Console
235 | false
236 | true
237 | true
238 | mainCRTStartup
239 |
240 |
241 | "$(TargetPath)"
242 |
243 |
244 |
245 |
246 | NotUsing
247 | Level3
248 | RELEASE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)
249 | ..\include;..\sqlite-amalgamation;..\Catch\single_include;%(AdditionalIncludeDirectories)
250 | Full
251 | true
252 | true
253 | false
254 | true
255 |
256 |
257 | Console
258 | false
259 | true
260 | true
261 | mainCRTStartup
262 |
263 |
264 | "$(TargetPath)"
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 | {1DFD5A97-8967-0F0E-D2A5-C0B33E4FED62}
273 |
274 |
275 | {F71C5A1C-E3BE-84F2-CC79-9846B8BA0B43}
276 |
277 |
278 |
279 |
280 |
281 |
--------------------------------------------------------------------------------
/Build/catch_test.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {89565304-F535-D29F-FE4D-5D766AAC3801}
6 |
7 |
8 |
9 |
10 | Sources
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Build/hiberlite.make:
--------------------------------------------------------------------------------
1 | # GNU Make project makefile autogenerated by Premake
2 | ifndef config
3 | config=debug
4 | endif
5 |
6 | ifndef verbose
7 | SILENT = @
8 | endif
9 |
10 | ifndef CC
11 | CC = gcc
12 | endif
13 |
14 | ifndef CXX
15 | CXX = g++
16 | endif
17 |
18 | ifndef AR
19 | AR = ar
20 | endif
21 |
22 | ifndef RESCOMP
23 | ifdef WINDRES
24 | RESCOMP = $(WINDRES)
25 | else
26 | RESCOMP = windres
27 | endif
28 | endif
29 |
30 | ifeq ($(config),debug)
31 | OBJDIR = obj/Debug/hiberlite
32 | TARGETDIR = ..
33 | TARGET = $(TARGETDIR)/libhiberlite.a
34 | DEFINES += -DDEBUG -D_DEBUG
35 | INCLUDES += -I../include -I../sqlite-amalgamation -I../Catch/single_include
36 | CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES)
37 | CFLAGS += $(CPPFLAGS) $(ARCH) -g -v -std=c++0x
38 | CXXFLAGS += $(CFLAGS)
39 | LDFLAGS +=
40 | RESFLAGS += $(DEFINES) $(INCLUDES)
41 | LIBS +=
42 | LDDEPS +=
43 | LINKCMD = $(AR) -rcs $(TARGET) $(OBJECTS)
44 | define PREBUILDCMDS
45 | endef
46 | define PRELINKCMDS
47 | endef
48 | define POSTBUILDCMDS
49 | endef
50 | endif
51 |
52 | ifeq ($(config),release)
53 | OBJDIR = obj/Release/hiberlite
54 | TARGETDIR = ..
55 | TARGET = $(TARGETDIR)/libhiberlite.a
56 | DEFINES += -DRELEASE
57 | INCLUDES += -I../include -I../sqlite-amalgamation -I../Catch/single_include
58 | CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES)
59 | CFLAGS += $(CPPFLAGS) $(ARCH) -O2 -v -std=c++0x
60 | CXXFLAGS += $(CFLAGS)
61 | LDFLAGS += -s
62 | RESFLAGS += $(DEFINES) $(INCLUDES)
63 | LIBS +=
64 | LDDEPS +=
65 | LINKCMD = $(AR) -rcs $(TARGET) $(OBJECTS)
66 | define PREBUILDCMDS
67 | endef
68 | define PRELINKCMDS
69 | endef
70 | define POSTBUILDCMDS
71 | endef
72 | endif
73 |
74 | ifeq ($(config),debug32)
75 | OBJDIR = obj/x32/Debug/hiberlite
76 | TARGETDIR = ..
77 | TARGET = $(TARGETDIR)/libhiberlite.a
78 | DEFINES += -DDEBUG -D_DEBUG
79 | INCLUDES += -I../include -I../sqlite-amalgamation -I../Catch/single_include
80 | CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES)
81 | CFLAGS += $(CPPFLAGS) $(ARCH) -g -m32 -v -std=c++0x
82 | CXXFLAGS += $(CFLAGS)
83 | LDFLAGS += -m32 -L/usr/lib32
84 | RESFLAGS += $(DEFINES) $(INCLUDES)
85 | LIBS +=
86 | LDDEPS +=
87 | LINKCMD = $(AR) -rcs $(TARGET) $(OBJECTS)
88 | define PREBUILDCMDS
89 | endef
90 | define PRELINKCMDS
91 | endef
92 | define POSTBUILDCMDS
93 | endef
94 | endif
95 |
96 | ifeq ($(config),release32)
97 | OBJDIR = obj/x32/Release/hiberlite
98 | TARGETDIR = ..
99 | TARGET = $(TARGETDIR)/libhiberlite.a
100 | DEFINES += -DRELEASE
101 | INCLUDES += -I../include -I../sqlite-amalgamation -I../Catch/single_include
102 | CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES)
103 | CFLAGS += $(CPPFLAGS) $(ARCH) -O2 -m32 -v -std=c++0x
104 | CXXFLAGS += $(CFLAGS)
105 | LDFLAGS += -s -m32 -L/usr/lib32
106 | RESFLAGS += $(DEFINES) $(INCLUDES)
107 | LIBS +=
108 | LDDEPS +=
109 | LINKCMD = $(AR) -rcs $(TARGET) $(OBJECTS)
110 | define PREBUILDCMDS
111 | endef
112 | define PRELINKCMDS
113 | endef
114 | define POSTBUILDCMDS
115 | endef
116 | endif
117 |
118 | ifeq ($(config),debug64)
119 | OBJDIR = obj/x64/Debug/hiberlite
120 | TARGETDIR = ..
121 | TARGET = $(TARGETDIR)/libhiberlite.a
122 | DEFINES += -DDEBUG -D_DEBUG
123 | INCLUDES += -I../include -I../sqlite-amalgamation -I../Catch/single_include
124 | CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES)
125 | CFLAGS += $(CPPFLAGS) $(ARCH) -g -m64 -v -std=c++0x
126 | CXXFLAGS += $(CFLAGS)
127 | LDFLAGS += -m64 -L/usr/lib64
128 | RESFLAGS += $(DEFINES) $(INCLUDES)
129 | LIBS +=
130 | LDDEPS +=
131 | LINKCMD = $(AR) -rcs $(TARGET) $(OBJECTS)
132 | define PREBUILDCMDS
133 | endef
134 | define PRELINKCMDS
135 | endef
136 | define POSTBUILDCMDS
137 | endef
138 | endif
139 |
140 | ifeq ($(config),release64)
141 | OBJDIR = obj/x64/Release/hiberlite
142 | TARGETDIR = ..
143 | TARGET = $(TARGETDIR)/libhiberlite.a
144 | DEFINES += -DRELEASE
145 | INCLUDES += -I../include -I../sqlite-amalgamation -I../Catch/single_include
146 | CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES)
147 | CFLAGS += $(CPPFLAGS) $(ARCH) -O2 -m64 -v -std=c++0x
148 | CXXFLAGS += $(CFLAGS)
149 | LDFLAGS += -s -m64 -L/usr/lib64
150 | RESFLAGS += $(DEFINES) $(INCLUDES)
151 | LIBS +=
152 | LDDEPS +=
153 | LINKCMD = $(AR) -rcs $(TARGET) $(OBJECTS)
154 | define PREBUILDCMDS
155 | endef
156 | define PRELINKCMDS
157 | endef
158 | define POSTBUILDCMDS
159 | endef
160 | endif
161 |
162 | OBJECTS := \
163 | $(OBJDIR)/Visitor.o \
164 | $(OBJDIR)/Database.o \
165 | $(OBJDIR)/CppModel.o \
166 | $(OBJDIR)/BeanLoader.o \
167 | $(OBJDIR)/BeanUpdater.o \
168 | $(OBJDIR)/ChildKiller.o \
169 | $(OBJDIR)/ModelExtractor.o \
170 | $(OBJDIR)/shared_res.o \
171 | $(OBJDIR)/Registry.o \
172 | $(OBJDIR)/SQLiteStmt.o \
173 |
174 | RESOURCES := \
175 |
176 | SHELLTYPE := msdos
177 | ifeq (,$(ComSpec)$(COMSPEC))
178 | SHELLTYPE := posix
179 | endif
180 | ifeq (/bin,$(findstring /bin,$(SHELL)))
181 | SHELLTYPE := posix
182 | endif
183 |
184 | .PHONY: clean prebuild prelink
185 |
186 | all: $(TARGETDIR) $(OBJDIR) prebuild prelink $(TARGET)
187 | @:
188 |
189 | $(TARGET): $(GCH) $(OBJECTS) $(LDDEPS) $(RESOURCES)
190 | @echo Linking hiberlite
191 | $(SILENT) $(LINKCMD)
192 | $(POSTBUILDCMDS)
193 |
194 | $(TARGETDIR):
195 | @echo Creating $(TARGETDIR)
196 | ifeq (posix,$(SHELLTYPE))
197 | $(SILENT) mkdir -p $(TARGETDIR)
198 | else
199 | $(SILENT) mkdir $(subst /,\\,$(TARGETDIR))
200 | endif
201 |
202 | $(OBJDIR):
203 | @echo Creating $(OBJDIR)
204 | ifeq (posix,$(SHELLTYPE))
205 | $(SILENT) mkdir -p $(OBJDIR)
206 | else
207 | $(SILENT) mkdir $(subst /,\\,$(OBJDIR))
208 | endif
209 |
210 | clean:
211 | @echo Cleaning hiberlite
212 | ifeq (posix,$(SHELLTYPE))
213 | $(SILENT) rm -f $(TARGET)
214 | $(SILENT) rm -rf $(OBJDIR)
215 | else
216 | $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET))
217 | $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR))
218 | endif
219 |
220 | prebuild:
221 | $(PREBUILDCMDS)
222 |
223 | prelink:
224 | $(PRELINKCMDS)
225 |
226 | ifneq (,$(PCH))
227 | $(GCH): $(PCH)
228 | @echo $(notdir $<)
229 | ifeq (posix,$(SHELLTYPE))
230 | -$(SILENT) cp $< $(OBJDIR)
231 | else
232 | $(SILENT) xcopy /D /Y /Q "$(subst /,\,$<)" "$(subst /,\,$(OBJDIR))" 1>nul
233 | endif
234 | $(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -MF $(@:%.o=%.d) -c "$<"
235 | endif
236 |
237 | $(OBJDIR)/Visitor.o: ../src/Visitor.cpp
238 | @echo $(notdir $<)
239 | $(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -MF $(@:%.o=%.d) -c "$<"
240 | $(OBJDIR)/Database.o: ../src/Database.cpp
241 | @echo $(notdir $<)
242 | $(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -MF $(@:%.o=%.d) -c "$<"
243 | $(OBJDIR)/CppModel.o: ../src/CppModel.cpp
244 | @echo $(notdir $<)
245 | $(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -MF $(@:%.o=%.d) -c "$<"
246 | $(OBJDIR)/BeanLoader.o: ../src/BeanLoader.cpp
247 | @echo $(notdir $<)
248 | $(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -MF $(@:%.o=%.d) -c "$<"
249 | $(OBJDIR)/BeanUpdater.o: ../src/BeanUpdater.cpp
250 | @echo $(notdir $<)
251 | $(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -MF $(@:%.o=%.d) -c "$<"
252 | $(OBJDIR)/ChildKiller.o: ../src/ChildKiller.cpp
253 | @echo $(notdir $<)
254 | $(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -MF $(@:%.o=%.d) -c "$<"
255 | $(OBJDIR)/ModelExtractor.o: ../src/ModelExtractor.cpp
256 | @echo $(notdir $<)
257 | $(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -MF $(@:%.o=%.d) -c "$<"
258 | $(OBJDIR)/shared_res.o: ../src/shared_res.cpp
259 | @echo $(notdir $<)
260 | $(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -MF $(@:%.o=%.d) -c "$<"
261 | $(OBJDIR)/Registry.o: ../src/Registry.cpp
262 | @echo $(notdir $<)
263 | $(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -MF $(@:%.o=%.d) -c "$<"
264 | $(OBJDIR)/SQLiteStmt.o: ../src/SQLiteStmt.cpp
265 | @echo $(notdir $<)
266 | $(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -MF $(@:%.o=%.d) -c "$<"
267 |
268 | -include $(OBJECTS:%.o=%.d)
269 |
--------------------------------------------------------------------------------
/Build/hiberlite.sln:
--------------------------------------------------------------------------------
1 | Microsoft Visual Studio Solution File, Format Version 12.00
2 | # Visual Studio 2013
3 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "catch_test", "catch_test.vcxproj", "{27B715B5-136F-5702-7C76-305E684DF2F2}"
4 | EndProject
5 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "hiberlite", "hiberlite.vcxproj", "{1DFD5A97-8967-0F0E-D2A5-C0B33E4FED62}"
6 | EndProject
7 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "hiberlite_test", "hiberlite_test.vcxproj", "{FC275FB3-E8F5-52B9-D189-C3DFBDF62E1E}"
8 | EndProject
9 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sample", "sample.vcxproj", "{073E391B-F3DF-63F1-DC9A-7745C8DBEA41}"
10 | EndProject
11 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sqlite", "sqlite.vcxproj", "{F71C5A1C-E3BE-84F2-CC79-9846B8BA0B43}"
12 | EndProject
13 | Global
14 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
15 | Debug|native = Debug|native
16 | Debug|Win32 = Debug|Win32
17 | Debug|x64 = Debug|x64
18 | Release|native = Release|native
19 | Release|Win32 = Release|Win32
20 | Release|x64 = Release|x64
21 | EndGlobalSection
22 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
23 | {27B715B5-136F-5702-7C76-305E684DF2F2}.Debug|native.ActiveCfg = Debug native|Win32
24 | {27B715B5-136F-5702-7C76-305E684DF2F2}.Debug|native.Build.0 = Debug native|Win32
25 | {27B715B5-136F-5702-7C76-305E684DF2F2}.Debug|Win32.ActiveCfg = Debug|Win32
26 | {27B715B5-136F-5702-7C76-305E684DF2F2}.Debug|Win32.Build.0 = Debug|Win32
27 | {27B715B5-136F-5702-7C76-305E684DF2F2}.Debug|x64.ActiveCfg = Debug|x64
28 | {27B715B5-136F-5702-7C76-305E684DF2F2}.Debug|x64.Build.0 = Debug|x64
29 | {27B715B5-136F-5702-7C76-305E684DF2F2}.Release|native.ActiveCfg = Release native|Win32
30 | {27B715B5-136F-5702-7C76-305E684DF2F2}.Release|native.Build.0 = Release native|Win32
31 | {27B715B5-136F-5702-7C76-305E684DF2F2}.Release|Win32.ActiveCfg = Release|Win32
32 | {27B715B5-136F-5702-7C76-305E684DF2F2}.Release|Win32.Build.0 = Release|Win32
33 | {27B715B5-136F-5702-7C76-305E684DF2F2}.Release|x64.ActiveCfg = Release|x64
34 | {27B715B5-136F-5702-7C76-305E684DF2F2}.Release|x64.Build.0 = Release|x64
35 | {1DFD5A97-8967-0F0E-D2A5-C0B33E4FED62}.Debug|native.ActiveCfg = Debug native|Win32
36 | {1DFD5A97-8967-0F0E-D2A5-C0B33E4FED62}.Debug|native.Build.0 = Debug native|Win32
37 | {1DFD5A97-8967-0F0E-D2A5-C0B33E4FED62}.Debug|Win32.ActiveCfg = Debug|Win32
38 | {1DFD5A97-8967-0F0E-D2A5-C0B33E4FED62}.Debug|Win32.Build.0 = Debug|Win32
39 | {1DFD5A97-8967-0F0E-D2A5-C0B33E4FED62}.Debug|x64.ActiveCfg = Debug|x64
40 | {1DFD5A97-8967-0F0E-D2A5-C0B33E4FED62}.Debug|x64.Build.0 = Debug|x64
41 | {1DFD5A97-8967-0F0E-D2A5-C0B33E4FED62}.Release|native.ActiveCfg = Release native|Win32
42 | {1DFD5A97-8967-0F0E-D2A5-C0B33E4FED62}.Release|native.Build.0 = Release native|Win32
43 | {1DFD5A97-8967-0F0E-D2A5-C0B33E4FED62}.Release|Win32.ActiveCfg = Release|Win32
44 | {1DFD5A97-8967-0F0E-D2A5-C0B33E4FED62}.Release|Win32.Build.0 = Release|Win32
45 | {1DFD5A97-8967-0F0E-D2A5-C0B33E4FED62}.Release|x64.ActiveCfg = Release|x64
46 | {1DFD5A97-8967-0F0E-D2A5-C0B33E4FED62}.Release|x64.Build.0 = Release|x64
47 | {FC275FB3-E8F5-52B9-D189-C3DFBDF62E1E}.Debug|native.ActiveCfg = Debug native|Win32
48 | {FC275FB3-E8F5-52B9-D189-C3DFBDF62E1E}.Debug|native.Build.0 = Debug native|Win32
49 | {FC275FB3-E8F5-52B9-D189-C3DFBDF62E1E}.Debug|Win32.ActiveCfg = Debug|Win32
50 | {FC275FB3-E8F5-52B9-D189-C3DFBDF62E1E}.Debug|Win32.Build.0 = Debug|Win32
51 | {FC275FB3-E8F5-52B9-D189-C3DFBDF62E1E}.Debug|x64.ActiveCfg = Debug|x64
52 | {FC275FB3-E8F5-52B9-D189-C3DFBDF62E1E}.Debug|x64.Build.0 = Debug|x64
53 | {FC275FB3-E8F5-52B9-D189-C3DFBDF62E1E}.Release|native.ActiveCfg = Release native|Win32
54 | {FC275FB3-E8F5-52B9-D189-C3DFBDF62E1E}.Release|native.Build.0 = Release native|Win32
55 | {FC275FB3-E8F5-52B9-D189-C3DFBDF62E1E}.Release|Win32.ActiveCfg = Release|Win32
56 | {FC275FB3-E8F5-52B9-D189-C3DFBDF62E1E}.Release|Win32.Build.0 = Release|Win32
57 | {FC275FB3-E8F5-52B9-D189-C3DFBDF62E1E}.Release|x64.ActiveCfg = Release|x64
58 | {FC275FB3-E8F5-52B9-D189-C3DFBDF62E1E}.Release|x64.Build.0 = Release|x64
59 | {073E391B-F3DF-63F1-DC9A-7745C8DBEA41}.Debug|native.ActiveCfg = Debug native|Win32
60 | {073E391B-F3DF-63F1-DC9A-7745C8DBEA41}.Debug|native.Build.0 = Debug native|Win32
61 | {073E391B-F3DF-63F1-DC9A-7745C8DBEA41}.Debug|Win32.ActiveCfg = Debug|Win32
62 | {073E391B-F3DF-63F1-DC9A-7745C8DBEA41}.Debug|Win32.Build.0 = Debug|Win32
63 | {073E391B-F3DF-63F1-DC9A-7745C8DBEA41}.Debug|x64.ActiveCfg = Debug|x64
64 | {073E391B-F3DF-63F1-DC9A-7745C8DBEA41}.Debug|x64.Build.0 = Debug|x64
65 | {073E391B-F3DF-63F1-DC9A-7745C8DBEA41}.Release|native.ActiveCfg = Release native|Win32
66 | {073E391B-F3DF-63F1-DC9A-7745C8DBEA41}.Release|native.Build.0 = Release native|Win32
67 | {073E391B-F3DF-63F1-DC9A-7745C8DBEA41}.Release|Win32.ActiveCfg = Release|Win32
68 | {073E391B-F3DF-63F1-DC9A-7745C8DBEA41}.Release|Win32.Build.0 = Release|Win32
69 | {073E391B-F3DF-63F1-DC9A-7745C8DBEA41}.Release|x64.ActiveCfg = Release|x64
70 | {073E391B-F3DF-63F1-DC9A-7745C8DBEA41}.Release|x64.Build.0 = Release|x64
71 | {F71C5A1C-E3BE-84F2-CC79-9846B8BA0B43}.Debug|native.ActiveCfg = Debug native|Win32
72 | {F71C5A1C-E3BE-84F2-CC79-9846B8BA0B43}.Debug|native.Build.0 = Debug native|Win32
73 | {F71C5A1C-E3BE-84F2-CC79-9846B8BA0B43}.Debug|Win32.ActiveCfg = Debug|Win32
74 | {F71C5A1C-E3BE-84F2-CC79-9846B8BA0B43}.Debug|Win32.Build.0 = Debug|Win32
75 | {F71C5A1C-E3BE-84F2-CC79-9846B8BA0B43}.Debug|x64.ActiveCfg = Debug|x64
76 | {F71C5A1C-E3BE-84F2-CC79-9846B8BA0B43}.Debug|x64.Build.0 = Debug|x64
77 | {F71C5A1C-E3BE-84F2-CC79-9846B8BA0B43}.Release|native.ActiveCfg = Release native|Win32
78 | {F71C5A1C-E3BE-84F2-CC79-9846B8BA0B43}.Release|native.Build.0 = Release native|Win32
79 | {F71C5A1C-E3BE-84F2-CC79-9846B8BA0B43}.Release|Win32.ActiveCfg = Release|Win32
80 | {F71C5A1C-E3BE-84F2-CC79-9846B8BA0B43}.Release|Win32.Build.0 = Release|Win32
81 | {F71C5A1C-E3BE-84F2-CC79-9846B8BA0B43}.Release|x64.ActiveCfg = Release|x64
82 | {F71C5A1C-E3BE-84F2-CC79-9846B8BA0B43}.Release|x64.Build.0 = Release|x64
83 | EndGlobalSection
84 | GlobalSection(SolutionProperties) = preSolution
85 | HideSolutionNode = FALSE
86 | EndGlobalSection
87 | EndGlobal
88 |
--------------------------------------------------------------------------------
/Build/hiberlite.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {C196CD9C-2D76-4C38-368E-D70EA2ECB299}
6 |
7 |
8 | {89565304-F535-D29F-FE4D-5D766AAC3801}
9 |
10 |
11 |
12 |
13 | Headers
14 |
15 |
16 | Headers
17 |
18 |
19 | Headers
20 |
21 |
22 | Headers
23 |
24 |
25 | Headers
26 |
27 |
28 | Headers
29 |
30 |
31 | Headers
32 |
33 |
34 | Headers
35 |
36 |
37 | Headers
38 |
39 |
40 | Headers
41 |
42 |
43 | Headers
44 |
45 |
46 | Headers
47 |
48 |
49 | Headers
50 |
51 |
52 | Headers
53 |
54 |
55 | Headers
56 |
57 |
58 | Headers
59 |
60 |
61 | Headers
62 |
63 |
64 | Headers
65 |
66 |
67 | Headers
68 |
69 |
70 | Headers
71 |
72 |
73 | Headers
74 |
75 |
76 | Headers
77 |
78 |
79 | Headers
80 |
81 |
82 | Headers
83 |
84 |
85 | Headers
86 |
87 |
88 | Headers
89 |
90 |
91 |
92 |
93 | Sources
94 |
95 |
96 | Sources
97 |
98 |
99 | Sources
100 |
101 |
102 | Sources
103 |
104 |
105 | Sources
106 |
107 |
108 | Sources
109 |
110 |
111 | Sources
112 |
113 |
114 | Sources
115 |
116 |
117 | Sources
118 |
119 |
120 | Sources
121 |
122 |
123 |
--------------------------------------------------------------------------------
/Build/hiberlite_test.make:
--------------------------------------------------------------------------------
1 | # GNU Make project makefile autogenerated by Premake
2 | ifndef config
3 | config=debug
4 | endif
5 |
6 | ifndef verbose
7 | SILENT = @
8 | endif
9 |
10 | ifndef CC
11 | CC = gcc
12 | endif
13 |
14 | ifndef CXX
15 | CXX = g++
16 | endif
17 |
18 | ifndef AR
19 | AR = ar
20 | endif
21 |
22 | ifndef RESCOMP
23 | ifdef WINDRES
24 | RESCOMP = $(WINDRES)
25 | else
26 | RESCOMP = windres
27 | endif
28 | endif
29 |
30 | ifeq ($(config),debug)
31 | OBJDIR = obj/Debug/hiberlite_test
32 | TARGETDIR = ..
33 | TARGET = $(TARGETDIR)/hiberlite_test
34 | DEFINES += -DDEBUG -D_DEBUG
35 | INCLUDES += -I../include -I../sqlite-amalgamation -I../Catch/single_include
36 | CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES)
37 | CFLAGS += $(CPPFLAGS) $(ARCH) -g -v -std=c++0x
38 | CXXFLAGS += $(CFLAGS)
39 | LDFLAGS += -L..
40 | RESFLAGS += $(DEFINES) $(INCLUDES)
41 | LIBS += ../libhiberlite.a ../libsqlite.a -ldl -lpthread
42 | LDDEPS += ../libhiberlite.a ../libsqlite.a
43 | LINKCMD = $(CXX) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(LIBS) $(LDFLAGS)
44 | define PREBUILDCMDS
45 | endef
46 | define PRELINKCMDS
47 | endef
48 | define POSTBUILDCMDS
49 | @echo Running post-build commands
50 | $(TARGET)
51 | endef
52 | endif
53 |
54 | ifeq ($(config),release)
55 | OBJDIR = obj/Release/hiberlite_test
56 | TARGETDIR = ..
57 | TARGET = $(TARGETDIR)/hiberlite_test
58 | DEFINES += -DRELEASE
59 | INCLUDES += -I../include -I../sqlite-amalgamation -I../Catch/single_include
60 | CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES)
61 | CFLAGS += $(CPPFLAGS) $(ARCH) -O2 -v -std=c++0x
62 | CXXFLAGS += $(CFLAGS)
63 | LDFLAGS += -L.. -s
64 | RESFLAGS += $(DEFINES) $(INCLUDES)
65 | LIBS += ../libhiberlite.a ../libsqlite.a -ldl -lpthread
66 | LDDEPS += ../libhiberlite.a ../libsqlite.a
67 | LINKCMD = $(CXX) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(LIBS) $(LDFLAGS)
68 | define PREBUILDCMDS
69 | endef
70 | define PRELINKCMDS
71 | endef
72 | define POSTBUILDCMDS
73 | @echo Running post-build commands
74 | $(TARGET)
75 | endef
76 | endif
77 |
78 | ifeq ($(config),debug32)
79 | OBJDIR = obj/x32/Debug/hiberlite_test
80 | TARGETDIR = ..
81 | TARGET = $(TARGETDIR)/hiberlite_test
82 | DEFINES += -DDEBUG -D_DEBUG
83 | INCLUDES += -I../include -I../sqlite-amalgamation -I../Catch/single_include
84 | CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES)
85 | CFLAGS += $(CPPFLAGS) $(ARCH) -g -m32 -v -std=c++0x
86 | CXXFLAGS += $(CFLAGS)
87 | LDFLAGS += -L.. -m32 -L/usr/lib32
88 | RESFLAGS += $(DEFINES) $(INCLUDES)
89 | LIBS += ../libhiberlite.a ../libsqlite.a -ldl -lpthread
90 | LDDEPS += ../libhiberlite.a ../libsqlite.a
91 | LINKCMD = $(CXX) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(LIBS) $(LDFLAGS)
92 | define PREBUILDCMDS
93 | endef
94 | define PRELINKCMDS
95 | endef
96 | define POSTBUILDCMDS
97 | @echo Running post-build commands
98 | $(TARGET)
99 | endef
100 | endif
101 |
102 | ifeq ($(config),release32)
103 | OBJDIR = obj/x32/Release/hiberlite_test
104 | TARGETDIR = ..
105 | TARGET = $(TARGETDIR)/hiberlite_test
106 | DEFINES += -DRELEASE
107 | INCLUDES += -I../include -I../sqlite-amalgamation -I../Catch/single_include
108 | CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES)
109 | CFLAGS += $(CPPFLAGS) $(ARCH) -O2 -m32 -v -std=c++0x
110 | CXXFLAGS += $(CFLAGS)
111 | LDFLAGS += -L.. -s -m32 -L/usr/lib32
112 | RESFLAGS += $(DEFINES) $(INCLUDES)
113 | LIBS += ../libhiberlite.a ../libsqlite.a -ldl -lpthread
114 | LDDEPS += ../libhiberlite.a ../libsqlite.a
115 | LINKCMD = $(CXX) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(LIBS) $(LDFLAGS)
116 | define PREBUILDCMDS
117 | endef
118 | define PRELINKCMDS
119 | endef
120 | define POSTBUILDCMDS
121 | @echo Running post-build commands
122 | $(TARGET)
123 | endef
124 | endif
125 |
126 | ifeq ($(config),debug64)
127 | OBJDIR = obj/x64/Debug/hiberlite_test
128 | TARGETDIR = ..
129 | TARGET = $(TARGETDIR)/hiberlite_test
130 | DEFINES += -DDEBUG -D_DEBUG
131 | INCLUDES += -I../include -I../sqlite-amalgamation -I../Catch/single_include
132 | CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES)
133 | CFLAGS += $(CPPFLAGS) $(ARCH) -g -m64 -v -std=c++0x
134 | CXXFLAGS += $(CFLAGS)
135 | LDFLAGS += -L.. -m64 -L/usr/lib64
136 | RESFLAGS += $(DEFINES) $(INCLUDES)
137 | LIBS += ../libhiberlite.a ../libsqlite.a -ldl -lpthread
138 | LDDEPS += ../libhiberlite.a ../libsqlite.a
139 | LINKCMD = $(CXX) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(LIBS) $(LDFLAGS)
140 | define PREBUILDCMDS
141 | endef
142 | define PRELINKCMDS
143 | endef
144 | define POSTBUILDCMDS
145 | @echo Running post-build commands
146 | $(TARGET)
147 | endef
148 | endif
149 |
150 | ifeq ($(config),release64)
151 | OBJDIR = obj/x64/Release/hiberlite_test
152 | TARGETDIR = ..
153 | TARGET = $(TARGETDIR)/hiberlite_test
154 | DEFINES += -DRELEASE
155 | INCLUDES += -I../include -I../sqlite-amalgamation -I../Catch/single_include
156 | CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES)
157 | CFLAGS += $(CPPFLAGS) $(ARCH) -O2 -m64 -v -std=c++0x
158 | CXXFLAGS += $(CFLAGS)
159 | LDFLAGS += -L.. -s -m64 -L/usr/lib64
160 | RESFLAGS += $(DEFINES) $(INCLUDES)
161 | LIBS += ../libhiberlite.a ../libsqlite.a -ldl -lpthread
162 | LDDEPS += ../libhiberlite.a ../libsqlite.a
163 | LINKCMD = $(CXX) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(LIBS) $(LDFLAGS)
164 | define PREBUILDCMDS
165 | endef
166 | define PRELINKCMDS
167 | endef
168 | define POSTBUILDCMDS
169 | @echo Running post-build commands
170 | $(TARGET)
171 | endef
172 | endif
173 |
174 | OBJECTS := \
175 | $(OBJDIR)/tests.o \
176 |
177 | RESOURCES := \
178 |
179 | SHELLTYPE := msdos
180 | ifeq (,$(ComSpec)$(COMSPEC))
181 | SHELLTYPE := posix
182 | endif
183 | ifeq (/bin,$(findstring /bin,$(SHELL)))
184 | SHELLTYPE := posix
185 | endif
186 |
187 | .PHONY: clean prebuild prelink
188 |
189 | all: $(TARGETDIR) $(OBJDIR) prebuild prelink $(TARGET)
190 | @:
191 |
192 | $(TARGET): $(GCH) $(OBJECTS) $(LDDEPS) $(RESOURCES)
193 | @echo Linking hiberlite_test
194 | $(SILENT) $(LINKCMD)
195 | $(POSTBUILDCMDS)
196 |
197 | $(TARGETDIR):
198 | @echo Creating $(TARGETDIR)
199 | ifeq (posix,$(SHELLTYPE))
200 | $(SILENT) mkdir -p $(TARGETDIR)
201 | else
202 | $(SILENT) mkdir $(subst /,\\,$(TARGETDIR))
203 | endif
204 |
205 | $(OBJDIR):
206 | @echo Creating $(OBJDIR)
207 | ifeq (posix,$(SHELLTYPE))
208 | $(SILENT) mkdir -p $(OBJDIR)
209 | else
210 | $(SILENT) mkdir $(subst /,\\,$(OBJDIR))
211 | endif
212 |
213 | clean:
214 | @echo Cleaning hiberlite_test
215 | ifeq (posix,$(SHELLTYPE))
216 | $(SILENT) rm -f $(TARGET)
217 | $(SILENT) rm -rf $(OBJDIR)
218 | else
219 | $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET))
220 | $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR))
221 | endif
222 |
223 | prebuild:
224 | $(PREBUILDCMDS)
225 |
226 | prelink:
227 | $(PRELINKCMDS)
228 |
229 | ifneq (,$(PCH))
230 | $(GCH): $(PCH)
231 | @echo $(notdir $<)
232 | ifeq (posix,$(SHELLTYPE))
233 | -$(SILENT) cp $< $(OBJDIR)
234 | else
235 | $(SILENT) xcopy /D /Y /Q "$(subst /,\,$<)" "$(subst /,\,$(OBJDIR))" 1>nul
236 | endif
237 | $(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -MF $(@:%.o=%.d) -c "$<"
238 | endif
239 |
240 | $(OBJDIR)/tests.o: ../tests.cpp
241 | @echo $(notdir $<)
242 | $(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -MF $(@:%.o=%.d) -c "$<"
243 |
244 | -include $(OBJECTS:%.o=%.d)
245 |
--------------------------------------------------------------------------------
/Build/hiberlite_test.vcxproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug native
6 | Win32
7 |
8 |
9 | Debug native
10 | x64
11 |
12 |
13 | Debug
14 | Win32
15 |
16 |
17 | Debug
18 | x64
19 |
20 |
21 | Release native
22 | Win32
23 |
24 |
25 | Release native
26 | x64
27 |
28 |
29 | Release
30 | Win32
31 |
32 |
33 | Release
34 | x64
35 |
36 |
37 |
38 | {FC275FB3-E8F5-52B9-D189-C3DFBDF62E1E}
39 | true
40 | Win32Proj
41 | hiberlite_test
42 |
43 |
44 |
45 | Application
46 | true
47 | MultiByte
48 | v120
49 |
50 |
51 | Application
52 | true
53 | MultiByte
54 | v120
55 |
56 |
57 | Application
58 | true
59 | MultiByte
60 | v120
61 |
62 |
63 | Application
64 | false
65 | MultiByte
66 | v120
67 |
68 |
69 | Application
70 | false
71 | MultiByte
72 | v120
73 |
74 |
75 | Application
76 | false
77 | MultiByte
78 | v120
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 | true
104 | ..\bin\hiberlite_test\Debug\
105 | ..\obj\hiberlite_test\Debug\native\
106 | hiberlite_test
107 | .exe
108 |
109 |
110 | true
111 | ..\bin\hiberlite_test\Debug\
112 | ..\obj\hiberlite_test\Debug\x32\
113 | hiberlite_test
114 | .exe
115 |
116 |
117 | true
118 | ..\bin\hiberlite_test\Debug\
119 | ..\obj\hiberlite_test\Debug\x64\
120 | hiberlite_test
121 | .exe
122 |
123 |
124 | false
125 | ..\bin\hiberlite_test\Release\
126 | ..\obj\hiberlite_test\Release\native\
127 | hiberlite_test
128 | .exe
129 |
130 |
131 | false
132 | ..\bin\hiberlite_test\Release\
133 | ..\obj\hiberlite_test\Release\x32\
134 | hiberlite_test
135 | .exe
136 |
137 |
138 | false
139 | ..\bin\hiberlite_test\Release\
140 | ..\obj\hiberlite_test\Release\x64\
141 | hiberlite_test
142 | .exe
143 |
144 |
145 |
146 | NotUsing
147 | Level3
148 | DEBUG;_DEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)
149 | ..\include;..\sqlite-amalgamation;..\Catch\single_include;%(AdditionalIncludeDirectories)
150 | EditAndContinue
151 | Disabled
152 |
153 |
154 | Console
155 | true
156 | mainCRTStartup
157 |
158 |
159 | "$(TargetPath)"
160 |
161 |
162 |
163 |
164 | NotUsing
165 | Level3
166 | DEBUG;_DEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)
167 | ..\include;..\sqlite-amalgamation;..\Catch\single_include;%(AdditionalIncludeDirectories)
168 | EditAndContinue
169 | Disabled
170 |
171 |
172 | Console
173 | true
174 | mainCRTStartup
175 |
176 |
177 | "$(TargetPath)"
178 |
179 |
180 |
181 |
182 | NotUsing
183 | Level3
184 | DEBUG;_DEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)
185 | ..\include;..\sqlite-amalgamation;..\Catch\single_include;%(AdditionalIncludeDirectories)
186 | ProgramDatabase
187 | Disabled
188 |
189 |
190 | Console
191 | true
192 | mainCRTStartup
193 |
194 |
195 | "$(TargetPath)"
196 |
197 |
198 |
199 |
200 | NotUsing
201 | Level3
202 | RELEASE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)
203 | ..\include;..\sqlite-amalgamation;..\Catch\single_include;%(AdditionalIncludeDirectories)
204 | Full
205 | true
206 | true
207 | false
208 | true
209 |
210 |
211 | Console
212 | false
213 | true
214 | true
215 | mainCRTStartup
216 |
217 |
218 | "$(TargetPath)"
219 |
220 |
221 |
222 |
223 | NotUsing
224 | Level3
225 | RELEASE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)
226 | ..\include;..\sqlite-amalgamation;..\Catch\single_include;%(AdditionalIncludeDirectories)
227 | Full
228 | true
229 | true
230 | false
231 | true
232 |
233 |
234 | Console
235 | false
236 | true
237 | true
238 | mainCRTStartup
239 |
240 |
241 | "$(TargetPath)"
242 |
243 |
244 |
245 |
246 | NotUsing
247 | Level3
248 | RELEASE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)
249 | ..\include;..\sqlite-amalgamation;..\Catch\single_include;%(AdditionalIncludeDirectories)
250 | Full
251 | true
252 | true
253 | false
254 | true
255 |
256 |
257 | Console
258 | false
259 | true
260 | true
261 | mainCRTStartup
262 |
263 |
264 | "$(TargetPath)"
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 | {1DFD5A97-8967-0F0E-D2A5-C0B33E4FED62}
273 |
274 |
275 | {F71C5A1C-E3BE-84F2-CC79-9846B8BA0B43}
276 |
277 |
278 |
279 |
280 |
281 |
--------------------------------------------------------------------------------
/Build/hiberlite_test.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {89565304-F535-D29F-FE4D-5D766AAC3801}
6 |
7 |
8 |
9 |
10 | Sources
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Build/sample.make:
--------------------------------------------------------------------------------
1 | # GNU Make project makefile autogenerated by Premake
2 | ifndef config
3 | config=debug
4 | endif
5 |
6 | ifndef verbose
7 | SILENT = @
8 | endif
9 |
10 | ifndef CC
11 | CC = gcc
12 | endif
13 |
14 | ifndef CXX
15 | CXX = g++
16 | endif
17 |
18 | ifndef AR
19 | AR = ar
20 | endif
21 |
22 | ifndef RESCOMP
23 | ifdef WINDRES
24 | RESCOMP = $(WINDRES)
25 | else
26 | RESCOMP = windres
27 | endif
28 | endif
29 |
30 | ifeq ($(config),debug)
31 | OBJDIR = obj/Debug/sample
32 | TARGETDIR = ..
33 | TARGET = $(TARGETDIR)/sample
34 | DEFINES += -DDEBUG -D_DEBUG
35 | INCLUDES += -I../include -I../sqlite-amalgamation -I../Catch/single_include
36 | CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES)
37 | CFLAGS += $(CPPFLAGS) $(ARCH) -g -v -std=c++0x
38 | CXXFLAGS += $(CFLAGS)
39 | LDFLAGS += -L..
40 | RESFLAGS += $(DEFINES) $(INCLUDES)
41 | LIBS += ../libhiberlite.a ../libsqlite.a -ldl -lpthread
42 | LDDEPS += ../libhiberlite.a ../libsqlite.a
43 | LINKCMD = $(CXX) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(LIBS) $(LDFLAGS)
44 | define PREBUILDCMDS
45 | endef
46 | define PRELINKCMDS
47 | endef
48 | define POSTBUILDCMDS
49 | @echo Running post-build commands
50 | $(TARGET)
51 | endef
52 | endif
53 |
54 | ifeq ($(config),release)
55 | OBJDIR = obj/Release/sample
56 | TARGETDIR = ..
57 | TARGET = $(TARGETDIR)/sample
58 | DEFINES += -DRELEASE
59 | INCLUDES += -I../include -I../sqlite-amalgamation -I../Catch/single_include
60 | CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES)
61 | CFLAGS += $(CPPFLAGS) $(ARCH) -O2 -v -std=c++0x
62 | CXXFLAGS += $(CFLAGS)
63 | LDFLAGS += -L.. -s
64 | RESFLAGS += $(DEFINES) $(INCLUDES)
65 | LIBS += ../libhiberlite.a ../libsqlite.a -ldl -lpthread
66 | LDDEPS += ../libhiberlite.a ../libsqlite.a
67 | LINKCMD = $(CXX) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(LIBS) $(LDFLAGS)
68 | define PREBUILDCMDS
69 | endef
70 | define PRELINKCMDS
71 | endef
72 | define POSTBUILDCMDS
73 | @echo Running post-build commands
74 | $(TARGET)
75 | endef
76 | endif
77 |
78 | ifeq ($(config),debug32)
79 | OBJDIR = obj/x32/Debug/sample
80 | TARGETDIR = ..
81 | TARGET = $(TARGETDIR)/sample
82 | DEFINES += -DDEBUG -D_DEBUG
83 | INCLUDES += -I../include -I../sqlite-amalgamation -I../Catch/single_include
84 | CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES)
85 | CFLAGS += $(CPPFLAGS) $(ARCH) -g -m32 -v -std=c++0x
86 | CXXFLAGS += $(CFLAGS)
87 | LDFLAGS += -L.. -m32 -L/usr/lib32
88 | RESFLAGS += $(DEFINES) $(INCLUDES)
89 | LIBS += ../libhiberlite.a ../libsqlite.a -ldl -lpthread
90 | LDDEPS += ../libhiberlite.a ../libsqlite.a
91 | LINKCMD = $(CXX) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(LIBS) $(LDFLAGS)
92 | define PREBUILDCMDS
93 | endef
94 | define PRELINKCMDS
95 | endef
96 | define POSTBUILDCMDS
97 | @echo Running post-build commands
98 | $(TARGET)
99 | endef
100 | endif
101 |
102 | ifeq ($(config),release32)
103 | OBJDIR = obj/x32/Release/sample
104 | TARGETDIR = ..
105 | TARGET = $(TARGETDIR)/sample
106 | DEFINES += -DRELEASE
107 | INCLUDES += -I../include -I../sqlite-amalgamation -I../Catch/single_include
108 | CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES)
109 | CFLAGS += $(CPPFLAGS) $(ARCH) -O2 -m32 -v -std=c++0x
110 | CXXFLAGS += $(CFLAGS)
111 | LDFLAGS += -L.. -s -m32 -L/usr/lib32
112 | RESFLAGS += $(DEFINES) $(INCLUDES)
113 | LIBS += ../libhiberlite.a ../libsqlite.a -ldl -lpthread
114 | LDDEPS += ../libhiberlite.a ../libsqlite.a
115 | LINKCMD = $(CXX) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(LIBS) $(LDFLAGS)
116 | define PREBUILDCMDS
117 | endef
118 | define PRELINKCMDS
119 | endef
120 | define POSTBUILDCMDS
121 | @echo Running post-build commands
122 | $(TARGET)
123 | endef
124 | endif
125 |
126 | ifeq ($(config),debug64)
127 | OBJDIR = obj/x64/Debug/sample
128 | TARGETDIR = ..
129 | TARGET = $(TARGETDIR)/sample
130 | DEFINES += -DDEBUG -D_DEBUG
131 | INCLUDES += -I../include -I../sqlite-amalgamation -I../Catch/single_include
132 | CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES)
133 | CFLAGS += $(CPPFLAGS) $(ARCH) -g -m64 -v -std=c++0x
134 | CXXFLAGS += $(CFLAGS)
135 | LDFLAGS += -L.. -m64 -L/usr/lib64
136 | RESFLAGS += $(DEFINES) $(INCLUDES)
137 | LIBS += ../libhiberlite.a ../libsqlite.a -ldl -lpthread
138 | LDDEPS += ../libhiberlite.a ../libsqlite.a
139 | LINKCMD = $(CXX) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(LIBS) $(LDFLAGS)
140 | define PREBUILDCMDS
141 | endef
142 | define PRELINKCMDS
143 | endef
144 | define POSTBUILDCMDS
145 | @echo Running post-build commands
146 | $(TARGET)
147 | endef
148 | endif
149 |
150 | ifeq ($(config),release64)
151 | OBJDIR = obj/x64/Release/sample
152 | TARGETDIR = ..
153 | TARGET = $(TARGETDIR)/sample
154 | DEFINES += -DRELEASE
155 | INCLUDES += -I../include -I../sqlite-amalgamation -I../Catch/single_include
156 | CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES)
157 | CFLAGS += $(CPPFLAGS) $(ARCH) -O2 -m64 -v -std=c++0x
158 | CXXFLAGS += $(CFLAGS)
159 | LDFLAGS += -L.. -s -m64 -L/usr/lib64
160 | RESFLAGS += $(DEFINES) $(INCLUDES)
161 | LIBS += ../libhiberlite.a ../libsqlite.a -ldl -lpthread
162 | LDDEPS += ../libhiberlite.a ../libsqlite.a
163 | LINKCMD = $(CXX) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(LIBS) $(LDFLAGS)
164 | define PREBUILDCMDS
165 | endef
166 | define PRELINKCMDS
167 | endef
168 | define POSTBUILDCMDS
169 | @echo Running post-build commands
170 | $(TARGET)
171 | endef
172 | endif
173 |
174 | OBJECTS := \
175 | $(OBJDIR)/sample.o \
176 |
177 | RESOURCES := \
178 |
179 | SHELLTYPE := msdos
180 | ifeq (,$(ComSpec)$(COMSPEC))
181 | SHELLTYPE := posix
182 | endif
183 | ifeq (/bin,$(findstring /bin,$(SHELL)))
184 | SHELLTYPE := posix
185 | endif
186 |
187 | .PHONY: clean prebuild prelink
188 |
189 | all: $(TARGETDIR) $(OBJDIR) prebuild prelink $(TARGET)
190 | @:
191 |
192 | $(TARGET): $(GCH) $(OBJECTS) $(LDDEPS) $(RESOURCES)
193 | @echo Linking sample
194 | $(SILENT) $(LINKCMD)
195 | $(POSTBUILDCMDS)
196 |
197 | $(TARGETDIR):
198 | @echo Creating $(TARGETDIR)
199 | ifeq (posix,$(SHELLTYPE))
200 | $(SILENT) mkdir -p $(TARGETDIR)
201 | else
202 | $(SILENT) mkdir $(subst /,\\,$(TARGETDIR))
203 | endif
204 |
205 | $(OBJDIR):
206 | @echo Creating $(OBJDIR)
207 | ifeq (posix,$(SHELLTYPE))
208 | $(SILENT) mkdir -p $(OBJDIR)
209 | else
210 | $(SILENT) mkdir $(subst /,\\,$(OBJDIR))
211 | endif
212 |
213 | clean:
214 | @echo Cleaning sample
215 | ifeq (posix,$(SHELLTYPE))
216 | $(SILENT) rm -f $(TARGET)
217 | $(SILENT) rm -rf $(OBJDIR)
218 | else
219 | $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET))
220 | $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR))
221 | endif
222 |
223 | prebuild:
224 | $(PREBUILDCMDS)
225 |
226 | prelink:
227 | $(PRELINKCMDS)
228 |
229 | ifneq (,$(PCH))
230 | $(GCH): $(PCH)
231 | @echo $(notdir $<)
232 | ifeq (posix,$(SHELLTYPE))
233 | -$(SILENT) cp $< $(OBJDIR)
234 | else
235 | $(SILENT) xcopy /D /Y /Q "$(subst /,\,$<)" "$(subst /,\,$(OBJDIR))" 1>nul
236 | endif
237 | $(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -MF $(@:%.o=%.d) -c "$<"
238 | endif
239 |
240 | $(OBJDIR)/sample.o: ../sample.cpp
241 | @echo $(notdir $<)
242 | $(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -MF $(@:%.o=%.d) -c "$<"
243 |
244 | -include $(OBJECTS:%.o=%.d)
245 |
--------------------------------------------------------------------------------
/Build/sample.vcxproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug native
6 | Win32
7 |
8 |
9 | Debug native
10 | x64
11 |
12 |
13 | Debug
14 | Win32
15 |
16 |
17 | Debug
18 | x64
19 |
20 |
21 | Release native
22 | Win32
23 |
24 |
25 | Release native
26 | x64
27 |
28 |
29 | Release
30 | Win32
31 |
32 |
33 | Release
34 | x64
35 |
36 |
37 |
38 | {073E391B-F3DF-63F1-DC9A-7745C8DBEA41}
39 | true
40 | Win32Proj
41 | sample
42 |
43 |
44 |
45 | Application
46 | true
47 | MultiByte
48 | v120
49 |
50 |
51 | Application
52 | true
53 | MultiByte
54 | v120
55 |
56 |
57 | Application
58 | true
59 | MultiByte
60 | v120
61 |
62 |
63 | Application
64 | false
65 | MultiByte
66 | v120
67 |
68 |
69 | Application
70 | false
71 | MultiByte
72 | v120
73 |
74 |
75 | Application
76 | false
77 | MultiByte
78 | v120
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 | true
104 | ..\bin\sample\Debug\
105 | ..\obj\sample\Debug\native\
106 | sample
107 | .exe
108 |
109 |
110 | true
111 | ..\bin\sample\Debug\
112 | ..\obj\sample\Debug\x32\
113 | sample
114 | .exe
115 |
116 |
117 | true
118 | ..\bin\sample\Debug\
119 | ..\obj\sample\Debug\x64\
120 | sample
121 | .exe
122 |
123 |
124 | false
125 | ..\bin\sample\Release\
126 | ..\obj\sample\Release\native\
127 | sample
128 | .exe
129 |
130 |
131 | false
132 | ..\bin\sample\Release\
133 | ..\obj\sample\Release\x32\
134 | sample
135 | .exe
136 |
137 |
138 | false
139 | ..\bin\sample\Release\
140 | ..\obj\sample\Release\x64\
141 | sample
142 | .exe
143 |
144 |
145 |
146 | NotUsing
147 | Level3
148 | DEBUG;_DEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)
149 | ..\include;..\sqlite-amalgamation;..\Catch\single_include;%(AdditionalIncludeDirectories)
150 | EditAndContinue
151 | Disabled
152 |
153 |
154 | Console
155 | true
156 | mainCRTStartup
157 |
158 |
159 | "$(TargetPath)"
160 |
161 |
162 |
163 |
164 | NotUsing
165 | Level3
166 | DEBUG;_DEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)
167 | ..\include;..\sqlite-amalgamation;..\Catch\single_include;%(AdditionalIncludeDirectories)
168 | EditAndContinue
169 | Disabled
170 |
171 |
172 | Console
173 | true
174 | mainCRTStartup
175 |
176 |
177 | "$(TargetPath)"
178 |
179 |
180 |
181 |
182 | NotUsing
183 | Level3
184 | DEBUG;_DEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)
185 | ..\include;..\sqlite-amalgamation;..\Catch\single_include;%(AdditionalIncludeDirectories)
186 | ProgramDatabase
187 | Disabled
188 |
189 |
190 | Console
191 | true
192 | mainCRTStartup
193 |
194 |
195 | "$(TargetPath)"
196 |
197 |
198 |
199 |
200 | NotUsing
201 | Level3
202 | RELEASE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)
203 | ..\include;..\sqlite-amalgamation;..\Catch\single_include;%(AdditionalIncludeDirectories)
204 | Full
205 | true
206 | true
207 | false
208 | true
209 |
210 |
211 | Console
212 | false
213 | true
214 | true
215 | mainCRTStartup
216 |
217 |
218 | "$(TargetPath)"
219 |
220 |
221 |
222 |
223 | NotUsing
224 | Level3
225 | RELEASE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)
226 | ..\include;..\sqlite-amalgamation;..\Catch\single_include;%(AdditionalIncludeDirectories)
227 | Full
228 | true
229 | true
230 | false
231 | true
232 |
233 |
234 | Console
235 | false
236 | true
237 | true
238 | mainCRTStartup
239 |
240 |
241 | "$(TargetPath)"
242 |
243 |
244 |
245 |
246 | NotUsing
247 | Level3
248 | RELEASE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)
249 | ..\include;..\sqlite-amalgamation;..\Catch\single_include;%(AdditionalIncludeDirectories)
250 | Full
251 | true
252 | true
253 | false
254 | true
255 |
256 |
257 | Console
258 | false
259 | true
260 | true
261 | mainCRTStartup
262 |
263 |
264 | "$(TargetPath)"
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 | {1DFD5A97-8967-0F0E-D2A5-C0B33E4FED62}
273 |
274 |
275 | {F71C5A1C-E3BE-84F2-CC79-9846B8BA0B43}
276 |
277 |
278 |
279 |
280 |
281 |
--------------------------------------------------------------------------------
/Build/sample.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {89565304-F535-D29F-FE4D-5D766AAC3801}
6 |
7 |
8 |
9 |
10 | Sources
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Build/sqlite.make:
--------------------------------------------------------------------------------
1 | # GNU Make project makefile autogenerated by Premake
2 | ifndef config
3 | config=debug
4 | endif
5 |
6 | ifndef verbose
7 | SILENT = @
8 | endif
9 |
10 | ifndef CC
11 | CC = gcc
12 | endif
13 |
14 | ifndef CXX
15 | CXX = g++
16 | endif
17 |
18 | ifndef AR
19 | AR = ar
20 | endif
21 |
22 | ifndef RESCOMP
23 | ifdef WINDRES
24 | RESCOMP = $(WINDRES)
25 | else
26 | RESCOMP = windres
27 | endif
28 | endif
29 |
30 | ifeq ($(config),debug)
31 | OBJDIR = obj/Debug/sqlite
32 | TARGETDIR = ..
33 | TARGET = $(TARGETDIR)/libsqlite.a
34 | DEFINES += -DDEBUG -D_DEBUG
35 | INCLUDES += -I../include -I../sqlite-amalgamation -I../Catch/single_include
36 | CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES)
37 | CFLAGS += $(CPPFLAGS) $(ARCH) -g
38 | CXXFLAGS += $(CFLAGS)
39 | LDFLAGS +=
40 | RESFLAGS += $(DEFINES) $(INCLUDES)
41 | LIBS +=
42 | LDDEPS +=
43 | LINKCMD = $(AR) -rcs $(TARGET) $(OBJECTS)
44 | define PREBUILDCMDS
45 | endef
46 | define PRELINKCMDS
47 | endef
48 | define POSTBUILDCMDS
49 | endef
50 | endif
51 |
52 | ifeq ($(config),release)
53 | OBJDIR = obj/Release/sqlite
54 | TARGETDIR = ..
55 | TARGET = $(TARGETDIR)/libsqlite.a
56 | DEFINES += -DRELEASE
57 | INCLUDES += -I../include -I../sqlite-amalgamation -I../Catch/single_include
58 | CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES)
59 | CFLAGS += $(CPPFLAGS) $(ARCH) -O2
60 | CXXFLAGS += $(CFLAGS)
61 | LDFLAGS += -s
62 | RESFLAGS += $(DEFINES) $(INCLUDES)
63 | LIBS +=
64 | LDDEPS +=
65 | LINKCMD = $(AR) -rcs $(TARGET) $(OBJECTS)
66 | define PREBUILDCMDS
67 | endef
68 | define PRELINKCMDS
69 | endef
70 | define POSTBUILDCMDS
71 | endef
72 | endif
73 |
74 | ifeq ($(config),debug32)
75 | OBJDIR = obj/x32/Debug/sqlite
76 | TARGETDIR = ..
77 | TARGET = $(TARGETDIR)/libsqlite.a
78 | DEFINES += -DDEBUG -D_DEBUG
79 | INCLUDES += -I../include -I../sqlite-amalgamation -I../Catch/single_include
80 | CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES)
81 | CFLAGS += $(CPPFLAGS) $(ARCH) -g -m32
82 | CXXFLAGS += $(CFLAGS)
83 | LDFLAGS += -m32 -L/usr/lib32
84 | RESFLAGS += $(DEFINES) $(INCLUDES)
85 | LIBS +=
86 | LDDEPS +=
87 | LINKCMD = $(AR) -rcs $(TARGET) $(OBJECTS)
88 | define PREBUILDCMDS
89 | endef
90 | define PRELINKCMDS
91 | endef
92 | define POSTBUILDCMDS
93 | endef
94 | endif
95 |
96 | ifeq ($(config),release32)
97 | OBJDIR = obj/x32/Release/sqlite
98 | TARGETDIR = ..
99 | TARGET = $(TARGETDIR)/libsqlite.a
100 | DEFINES += -DRELEASE
101 | INCLUDES += -I../include -I../sqlite-amalgamation -I../Catch/single_include
102 | CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES)
103 | CFLAGS += $(CPPFLAGS) $(ARCH) -O2 -m32
104 | CXXFLAGS += $(CFLAGS)
105 | LDFLAGS += -s -m32 -L/usr/lib32
106 | RESFLAGS += $(DEFINES) $(INCLUDES)
107 | LIBS +=
108 | LDDEPS +=
109 | LINKCMD = $(AR) -rcs $(TARGET) $(OBJECTS)
110 | define PREBUILDCMDS
111 | endef
112 | define PRELINKCMDS
113 | endef
114 | define POSTBUILDCMDS
115 | endef
116 | endif
117 |
118 | ifeq ($(config),debug64)
119 | OBJDIR = obj/x64/Debug/sqlite
120 | TARGETDIR = ..
121 | TARGET = $(TARGETDIR)/libsqlite.a
122 | DEFINES += -DDEBUG -D_DEBUG
123 | INCLUDES += -I../include -I../sqlite-amalgamation -I../Catch/single_include
124 | CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES)
125 | CFLAGS += $(CPPFLAGS) $(ARCH) -g -m64
126 | CXXFLAGS += $(CFLAGS)
127 | LDFLAGS += -m64 -L/usr/lib64
128 | RESFLAGS += $(DEFINES) $(INCLUDES)
129 | LIBS +=
130 | LDDEPS +=
131 | LINKCMD = $(AR) -rcs $(TARGET) $(OBJECTS)
132 | define PREBUILDCMDS
133 | endef
134 | define PRELINKCMDS
135 | endef
136 | define POSTBUILDCMDS
137 | endef
138 | endif
139 |
140 | ifeq ($(config),release64)
141 | OBJDIR = obj/x64/Release/sqlite
142 | TARGETDIR = ..
143 | TARGET = $(TARGETDIR)/libsqlite.a
144 | DEFINES += -DRELEASE
145 | INCLUDES += -I../include -I../sqlite-amalgamation -I../Catch/single_include
146 | CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES)
147 | CFLAGS += $(CPPFLAGS) $(ARCH) -O2 -m64
148 | CXXFLAGS += $(CFLAGS)
149 | LDFLAGS += -s -m64 -L/usr/lib64
150 | RESFLAGS += $(DEFINES) $(INCLUDES)
151 | LIBS +=
152 | LDDEPS +=
153 | LINKCMD = $(AR) -rcs $(TARGET) $(OBJECTS)
154 | define PREBUILDCMDS
155 | endef
156 | define PRELINKCMDS
157 | endef
158 | define POSTBUILDCMDS
159 | endef
160 | endif
161 |
162 | OBJECTS := \
163 | $(OBJDIR)/sqlite3.o \
164 |
165 | RESOURCES := \
166 |
167 | SHELLTYPE := msdos
168 | ifeq (,$(ComSpec)$(COMSPEC))
169 | SHELLTYPE := posix
170 | endif
171 | ifeq (/bin,$(findstring /bin,$(SHELL)))
172 | SHELLTYPE := posix
173 | endif
174 |
175 | .PHONY: clean prebuild prelink
176 |
177 | all: $(TARGETDIR) $(OBJDIR) prebuild prelink $(TARGET)
178 | @:
179 |
180 | $(TARGET): $(GCH) $(OBJECTS) $(LDDEPS) $(RESOURCES)
181 | @echo Linking sqlite
182 | $(SILENT) $(LINKCMD)
183 | $(POSTBUILDCMDS)
184 |
185 | $(TARGETDIR):
186 | @echo Creating $(TARGETDIR)
187 | ifeq (posix,$(SHELLTYPE))
188 | $(SILENT) mkdir -p $(TARGETDIR)
189 | else
190 | $(SILENT) mkdir $(subst /,\\,$(TARGETDIR))
191 | endif
192 |
193 | $(OBJDIR):
194 | @echo Creating $(OBJDIR)
195 | ifeq (posix,$(SHELLTYPE))
196 | $(SILENT) mkdir -p $(OBJDIR)
197 | else
198 | $(SILENT) mkdir $(subst /,\\,$(OBJDIR))
199 | endif
200 |
201 | clean:
202 | @echo Cleaning sqlite
203 | ifeq (posix,$(SHELLTYPE))
204 | $(SILENT) rm -f $(TARGET)
205 | $(SILENT) rm -rf $(OBJDIR)
206 | else
207 | $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET))
208 | $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR))
209 | endif
210 |
211 | prebuild:
212 | $(PREBUILDCMDS)
213 |
214 | prelink:
215 | $(PRELINKCMDS)
216 |
217 | ifneq (,$(PCH))
218 | $(GCH): $(PCH)
219 | @echo $(notdir $<)
220 | ifeq (posix,$(SHELLTYPE))
221 | -$(SILENT) cp $< $(OBJDIR)
222 | else
223 | $(SILENT) xcopy /D /Y /Q "$(subst /,\,$<)" "$(subst /,\,$(OBJDIR))" 1>nul
224 | endif
225 | $(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -MF $(@:%.o=%.d) -c "$<"
226 | endif
227 |
228 | $(OBJDIR)/sqlite3.o: ../sqlite-amalgamation/sqlite3.c
229 | @echo $(notdir $<)
230 | $(SILENT) $(CC) $(CFLAGS) -o "$@" -MF $(@:%.o=%.d) -c "$<"
231 |
232 | -include $(OBJECTS:%.o=%.d)
233 |
--------------------------------------------------------------------------------
/Build/sqlite.vcxproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug native
6 | Win32
7 |
8 |
9 | Debug native
10 | x64
11 |
12 |
13 | Debug
14 | Win32
15 |
16 |
17 | Debug
18 | x64
19 |
20 |
21 | Release native
22 | Win32
23 |
24 |
25 | Release native
26 | x64
27 |
28 |
29 | Release
30 | Win32
31 |
32 |
33 | Release
34 | x64
35 |
36 |
37 |
38 | {F71C5A1C-E3BE-84F2-CC79-9846B8BA0B43}
39 | true
40 | Win32Proj
41 | sqlite
42 |
43 |
44 |
45 | StaticLibrary
46 | true
47 | MultiByte
48 | v120
49 |
50 |
51 | StaticLibrary
52 | true
53 | MultiByte
54 | v120
55 |
56 |
57 | StaticLibrary
58 | true
59 | MultiByte
60 | v120
61 |
62 |
63 | StaticLibrary
64 | false
65 | MultiByte
66 | v120
67 |
68 |
69 | StaticLibrary
70 | false
71 | MultiByte
72 | v120
73 |
74 |
75 | StaticLibrary
76 | false
77 | MultiByte
78 | v120
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 | ..\bin\sqlite\Debug\
104 | ..\obj\sqlite\Debug\native\
105 | sqlite
106 | .lib
107 |
108 |
109 | ..\bin\sqlite\Debug\
110 | ..\obj\sqlite\Debug\x32\
111 | sqlite
112 | .lib
113 |
114 |
115 | ..\bin\sqlite\Debug\
116 | ..\obj\sqlite\Debug\x64\
117 | sqlite
118 | .lib
119 |
120 |
121 | ..\bin\sqlite\Release\
122 | ..\obj\sqlite\Release\native\
123 | sqlite
124 | .lib
125 |
126 |
127 | ..\bin\sqlite\Release\
128 | ..\obj\sqlite\Release\x32\
129 | sqlite
130 | .lib
131 |
132 |
133 | ..\bin\sqlite\Release\
134 | ..\obj\sqlite\Release\x64\
135 | sqlite
136 | .lib
137 |
138 |
139 |
140 | NotUsing
141 | Level3
142 | DEBUG;_DEBUG;%(PreprocessorDefinitions)
143 | ..\include;..\sqlite-amalgamation;..\Catch\single_include;%(AdditionalIncludeDirectories)
144 | EditAndContinue
145 | Disabled
146 | CompileAsC
147 |
148 |
149 | Windows
150 | true
151 |
152 |
153 |
154 |
155 | NotUsing
156 | Level3
157 | DEBUG;_DEBUG;%(PreprocessorDefinitions)
158 | ..\include;..\sqlite-amalgamation;..\Catch\single_include;%(AdditionalIncludeDirectories)
159 | EditAndContinue
160 | Disabled
161 | CompileAsC
162 |
163 |
164 | Windows
165 | true
166 |
167 |
168 |
169 |
170 | NotUsing
171 | Level3
172 | DEBUG;_DEBUG;%(PreprocessorDefinitions)
173 | ..\include;..\sqlite-amalgamation;..\Catch\single_include;%(AdditionalIncludeDirectories)
174 | ProgramDatabase
175 | Disabled
176 | CompileAsC
177 |
178 |
179 | Windows
180 | true
181 |
182 |
183 |
184 |
185 | NotUsing
186 | Level3
187 | RELEASE;%(PreprocessorDefinitions)
188 | ..\include;..\sqlite-amalgamation;..\Catch\single_include;%(AdditionalIncludeDirectories)
189 | Full
190 | true
191 | true
192 | false
193 | true
194 | CompileAsC
195 |
196 |
197 | Windows
198 | false
199 | true
200 | true
201 |
202 |
203 |
204 |
205 | NotUsing
206 | Level3
207 | RELEASE;%(PreprocessorDefinitions)
208 | ..\include;..\sqlite-amalgamation;..\Catch\single_include;%(AdditionalIncludeDirectories)
209 | Full
210 | true
211 | true
212 | false
213 | true
214 | CompileAsC
215 |
216 |
217 | Windows
218 | false
219 | true
220 | true
221 |
222 |
223 |
224 |
225 | NotUsing
226 | Level3
227 | RELEASE;%(PreprocessorDefinitions)
228 | ..\include;..\sqlite-amalgamation;..\Catch\single_include;%(AdditionalIncludeDirectories)
229 | Full
230 | true
231 | true
232 | false
233 | true
234 | CompileAsC
235 |
236 |
237 | Windows
238 | false
239 | true
240 | true
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
--------------------------------------------------------------------------------
/Build/sqlite.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {C196CD9C-2D76-4C38-368E-D70EA2ECB299}
6 |
7 |
8 | {89565304-F535-D29F-FE4D-5D766AAC3801}
9 |
10 |
11 |
12 |
13 | Headers
14 |
15 |
16 |
17 |
18 | Sources
19 |
20 |
21 |
--------------------------------------------------------------------------------
/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.6)
2 |
3 | project(hiberlite)
4 |
5 | #find_package(Qt5 CONFIG REQUIRED Core Gui Widgets)
6 |
7 | set(CMAKE_INCLUDE_CURRENT_DIR ON)
8 | set(CMAKE_CXX_STANDARD 11)
9 |
10 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-terminate")
11 |
12 | set(TARGET_NAME hiberlite)
13 |
14 | set(SOURCES_SQLITE
15 | sqlite-amalgamation/sqlite3.c
16 | sqlite-amalgamation/sqlite3.h
17 | )
18 |
19 | set(SOURCES
20 | src/BeanLoader.cpp
21 | src/BeanUpdater.cpp
22 | src/ChildKiller.cpp
23 | src/CppModel.cpp
24 | src/Database.cpp
25 | src/ModelExtractor.cpp
26 | src/Registry.cpp
27 | src/shared_res.cpp
28 | src/SQLiteStmt.cpp
29 | src/Visitor.cpp
30 |
31 | include/BeanLoader.h
32 | include/BeanLoader_impl.hpp
33 | include/BeanUpdater.h
34 | include/BeanUpdater_impl.hpp
35 | include/ChildKiller.h
36 | include/ChildKiller_impl.hpp
37 | include/CppModel.h
38 | include/Database.h
39 | include/Database_tmpl_impl.hpp
40 | include/ModelExtractor.h
41 | include/ModelExtractor_impl.hpp
42 | include/Registry.h
43 | include/Registry_impl.hpp
44 | include/SQLiteStmt.h
45 | include/UpdateVisitor_tmpl.hpp
46 | include/Visitor.h
47 | include/Visitor_tmpl_impl.hpp
48 | include/bean_ptr.h
49 | include/bean_ptr_impl.hpp
50 | include/common.h
51 | include/db_error.h
52 | include/hiberdefs.h
53 | include/hiberlite.h
54 | include/nvp.h
55 | include/shared_res.h
56 | include/some_types.h
57 | )
58 |
59 | add_library(${TARGET_NAME}
60 | ${SOURCES}
61 | ${SOURCES_SQLITE}
62 | )
63 |
64 | target_include_directories(${TARGET_NAME}
65 | PUBLIC
66 | include
67 | sqlite-amalgamation
68 | )
69 |
70 | target_link_libraries(${TARGET_NAME}
71 | pthread
72 | dl
73 | )
74 |
75 | add_executable(sample
76 | sample.cpp
77 | )
78 |
79 | target_link_libraries(sample
80 | ${TARGET_NAME}
81 | )
82 |
83 | add_executable(tests
84 | tests.cpp
85 | )
86 |
87 | target_link_libraries(tests
88 | ${TARGET_NAME}
89 | )
90 |
91 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2008-2014, Paul Korzhyk
2 | All rights reserved.
3 |
4 | Redistribution and use in source and binary forms, with or without
5 | modification, are permitted provided that the following conditions are met:
6 |
7 | * Redistributions of source code must retain the above copyright notice, this
8 | list of conditions and the following disclaimer.
9 | * Redistributions in binary form must reproduce the above copyright notice,
10 | this list of conditions and the following disclaimer in the documentation
11 | and/or other materials provided with the distribution.
12 | * Neither the name of Hiberlite nor the names of its contributors may be used
13 | to endorse or promote products derived from this software without specific
14 | prior written permission.
15 |
16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
20 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 |
2 | INSTALL_PREFIX = /usr
3 | INSTALL_HEADERS = $(INSTALL_PREFIX)/include/hiberlite
4 | INSTALL_LIB = $(INSTALL_PREFIX)/lib
5 |
6 | all : libhiberlite.a sqlite3.o tests sample
7 |
8 | OBJS=BeanLoader.o BeanUpdater.o ChildKiller.o CppModel.o Database.o ModelExtractor.o Registry.o SQLiteStmt.o Visitor.o shared_res.o sqlite3.o
9 |
10 | CXXFLAGS=-std=c++0x -Iinclude/ -Wall -Isqlite-amalgamation
11 | LDFLAGS=-lpthread -ldl
12 |
13 | libhiberlite.a : $(OBJS)
14 | ar -r -s libhiberlite.a $(OBJS)
15 |
16 | tests : libhiberlite.a
17 |
18 | install :
19 | mkdir -p $(INSTALL_HEADERS)
20 | cp include/* $(INSTALL_HEADERS)/
21 | mkdir -p $(INSTALL_LIB)
22 | cp libhiberlite.a $(INSTALL_LIB)/
23 |
24 | sqlite3.o :
25 | gcc -c sqlite-amalgamation/sqlite3.c -o sqlite3.o
26 |
27 | %.o : src/%.cpp include/*
28 | g++ -c $(CXXFLAGS) $< -o $@
29 |
30 | tests : tests.cpp libhiberlite.a
31 | g++ $(CXXFLAGS) -L./ tests.cpp -o tests -lhiberlite $(LDFLAGS)
32 |
33 | sample : sample.cpp libhiberlite.a
34 | g++ $(CXXFLAGS) -L./ sample.cpp -o sample -lhiberlite $(LDFLAGS)
35 |
36 | clean:
37 | rm -rf *.o tests sample
38 |
--------------------------------------------------------------------------------
/README:
--------------------------------------------------------------------------------
1 |
2 | C++ to Sqlite ORM
3 |
4 | USAGE: just compile and link all files under src/ to your project.
5 | Add
6 | #include "hiberlite.h"
7 | to your code.
8 |
9 |
10 | C++ object-relational mapping with API inspired by the Boost.Serialization - that means almost no API to learn.
11 |
12 | In contrast to most serialization libraries with SQL serializers, C++ objects mapped with hiberlite behave similar to active record pattern - you are not forced to follow the "read all your data/modify some small part/write everything back" path.
13 |
14 | For people who need reliable data storage, ACID transactions, simple random-access to their data files, and don't like coding in SQL.
15 |
16 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Hiberlite ORM
2 |
3 | [](https://travis-ci.org/paulftw/hiberlite) [](https://ci.appveyor.com/project/d-led/hiberlite/branch/master)
4 |
5 |
6 | C++ object-relational mapping with API inspired by the awesome Boost.Serialization - that means _almost no API to learn_.
7 |
8 | ## Usage
9 |
10 | Just compile and link all files under src/ to your project.
11 | Include the main header:
12 |
13 | ```cpp
14 | #include "hiberlite.h"
15 | ```
16 |
17 | ## Features
18 |
19 | Key features of Hiberlite are:
20 | - Boost.Serialization like API
21 | - no code generators / preprocessors
22 | - support for one-to-many and many-to-many relations
23 | - automatic code generation
24 | - lazy loading
25 | - smart pointers
26 | - no need to inherit from a single base class
27 |
28 | In contrast to most serialization libraries with SQL serializers, C++ objects mapped with
29 | hiberlite behave similar to active record pattern - you are not forced to follow the
30 | "read all your data/modify some small part/write everything back" path.
31 |
32 | For people who need reliable data storage, ACID transactions, simple random-access to their data files,
33 | and don't like coding in SQL.
34 |
35 | -----------------------
36 |
37 | # Tutorial
38 |
39 | While building a typical RDBMS application developer has to deal with the following tasks:
40 |
41 | 1. Open a database
42 | 2. Create database schema
43 | 3. Populate the tables with data
44 | 4. Read and/or modify that data
45 |
46 | Hiberlite greatly reduces the implementation of each of these tasks.
47 |
48 | ## Creating a database
49 |
50 | Opening a database is as simple as
51 |
52 | ```cpp
53 | hiberlite::Database db;
54 | db.open("sample.db");
55 | ```
56 |
57 | Where
58 |
59 | ```cpp
60 | Database::open(std::string filename)
61 | ```
62 |
63 | opens a sqlite3 file. If it doesn't exist it will be created.
64 | Another option is to have constructor automatically open/create the DB file:
65 |
66 | ```cpp
67 | hiberlite::Database db("sample.db");
68 | ```
69 |
70 |
71 | ## Creating database schema
72 |
73 | In C++ You deal with classes and objects. You know what objects You want to store in the database.
74 | And hiberlite will figure out how to store that data.
75 |
76 |
77 | ### Defining data model
78 |
79 | First You must prepare the data classes for use with hiberlite.
80 | Suppose we develop a social-network application. We define a person class as:
81 |
82 | ```cpp
83 | class Person{
84 | public:
85 | string name;
86 | int age;
87 | vector bio;
88 | };
89 | ```
90 |
91 | Now, to let hiberlite know about the internal structure of this class,
92 | we add an access method and an export declaration:
93 |
94 | ```cpp
95 | class Person{
96 | friend class hiberlite::access;
97 | template
98 | void hibernate(Archive & ar)
99 | {
100 | ar & HIBERLITE_NVP(name);
101 | ar & HIBERLITE_NVP(age);
102 | ar & HIBERLITE_NVP(bio);
103 | }
104 | public:
105 | string name;
106 | double age;
107 | vector bio;
108 | };
109 | HIBERLITE_EXPORT_CLASS(Person)
110 | ```
111 |
112 | Inside the **hibernate(Archive & ar)** method we list all the data fields we want to persist in the database.
113 | Macro **HIBERLITE_EXPORT_CLASS(Person)** is invoked to register the class name with Hiberlite.
114 | For now just remember to invoke it once per class in your project. (Placing it in the Person.cpp is a good idea)
115 |
116 | At this point hiberlite is able to map the Person to a database.
117 |
118 | ### Creating tables
119 |
120 | Database schema in hiberlite is simply a set of classes, that are stored in the database.
121 | A programmer defines that set of classes, and hiberlite determines the needed tables and their columns.
122 |
123 | Each instance of Database maintains its own copy of the database schema (set of data classes). To insert a new class to that set, use registerBeanClass template method:
124 |
125 | ```cpp
126 | db.registerBeanClass();
127 | ```
128 |
129 | In most applications several classes are stored in one database - so usually You will call **registerBeanClass** several times:
130 |
131 | ```cpp
132 | Database db("gmail2.0.db");
133 | db.registerBeanClass();
134 | db.registerBeanClass();
135 | db.registerBeanClass();
136 | ```
137 |
138 | When the classes are registered, Database can create tables to map them:
139 |
140 | ```cpp
141 | db.dropModel();
142 | db.createModel();
143 | ```
144 |
145 | **createModel()** executes several **CREATE TABLE** queries.
146 | **dropModel()** cleans the database - executes **DROP TABLE IF EXISTS** query for each table in the schema.
147 | Besides uninstallers, this method may be used to destroy the old tables (from a probably obsolete scheme)
148 | before calling createModel().
149 |
150 | ## Saving data
151 |
152 | When the database with proper schema is opened, we can put some Person objects in it:
153 |
154 | ```cpp
155 | Person x;
156 | x.name="Amanda";
157 | x.age=21;
158 | x.bio.push_back("born 1987");
159 | hiberlite::bean_ptr p=db.copyBean(x);
160 | x.age=-1; //does NOT change any database record
161 | p->age=22; //does change the database
162 | ```
163 |
164 | **copyBean(x)** template method creates a copy of its argument and saves it to the database.
165 | It returns a smart pointer - **bean_ptr**.
166 |
167 | **bean_ptr** is inspired by the **boost::shared_ptr**. The main difference is that in addition
168 | to deletion, **bean_ptr** guarantees that the referenced object will be also saved to the database,
169 | when no longer needed.
170 |
171 | An internal primary key is autogenerated for each object in the database. It can be read
172 | with **sqlid_t bean_ptr::get_id()**.
173 |
174 | Another way to create a bean is to use **createBean()** template method:
175 |
176 | ```cpp
177 | hiberlite::bean_ptr p=db.createBean();
178 | p->name="Amanda";
179 | p->age=21;
180 | p->bio.push_back("born 1987");
181 | ```
182 |
183 |
184 | ## Loading data
185 |
186 | There are several methods to query the database:
187 |
188 | **bean_ptr Database::loadBean(sqlid_t id)** loads the bean with the given id.
189 |
190 | ```cpp
191 | bean_ptr p=db.loadBean(1);
192 | cout << "first person is " << p->name << endl;
193 | ```
194 |
195 | In this case object itself is not loaded, when bean_ptr is returned.
196 | bean_ptr is a lazy pointer, so the wrapped object will be loaded when first needed.
197 | In this example Person will be loaded later, when we try to access the name field.
198 |
199 | **std::vector< bean_ptr > Database::getAllBeans()**
200 | returns a vector with all the beans of a given class C.
201 |
202 | ```cpp
203 | vector< bean_ptr > v=db.getAllBeans();
204 | cout << "found " << v.size() << " persons in the database\n";
205 | ```
206 |
207 | In this example objects are not loaded at all.
208 |
209 | You can load the same object more than once - all the returned bean_ptr's will point the same bean.
210 |
211 | ## Deleting beans
212 |
213 | To remove an object from the database, call bean_ptr::destroy():
214 |
215 | ```cpp
216 | bean_ptr p==db.loadBean(1);
217 | p.destroy();
218 | ```
219 |
220 | ## Examples
221 |
222 | All the above code is put together in sample.cpp. For more demonstration see the poor-mans unit tests : tests.cpp.
223 |
224 | User-defined class
225 | First we define the class we plan to store in the database:
226 |
227 | ```cpp
228 | class MyClass{
229 | friend class hiberlite::access;
230 | template
231 | void hibernate(Archive & ar)
232 | {
233 | ar & HIBERLITE_NVP(a);
234 | ar & HIBERLITE_NVP(b);
235 | ar & HIBERLITE_NVP(vs);
236 | }
237 | public:
238 | int a;
239 | double b;
240 | vector vs;
241 | };
242 | HIBERLITE_EXPORT_CLASS(MyClass)
243 | ```
244 |
245 | Note the friend declaration and the hibernate(...) template method - these two pieces of code are necessary
246 | for hiberlite to access the internal structure of the user-defined class.
247 |
248 | **HIBERLITE_NVP** is a macro that creates a name-value pair with reference to its argument.
249 |
250 | **HIBERLITE_EXPORT_CLASS()** defines the root table name for the class. More on this later.
251 |
252 | ## How it is stored
253 |
254 | hiberlite will use 2 tables to represent MyClass instances in the database:
255 |
256 | ```cpp
257 | CREATE TABLE MyClass
258 | (
259 | a INTEGER,
260 | b REAL,
261 | hiberlite_id INTEGER PRIMARY KEY AUTOINCREMENT
262 | )
263 | CREATE TABLE MyClass_vs_items
264 | (
265 | hiberlite_entry_indx INTEGER,
266 | hiberlite_id INTEGER PRIMARY KEY AUTOINCREMENT,
267 | hiberlite_parent_id INTEGER,
268 | item TEXT
269 | )
270 | ```
271 |
272 | Table MyClass is the root table for MyClass. It will contain one row per object. Columns a and b store values of the corresponding int and double fields.
273 |
274 | HIBERLITE_EXPORT_CLASS(MyClass) macro simply declares that instances of MyClass must be stored int the MyClass root table and its subtables.
275 |
276 | MyClass_vs_items table is the "subtable" of MyClass. It is used to store elements of the vs vector: hiberlite_parent_id references the hiberlite_id of the root table, hiberlite_entry_indx - is the zero-index of the string element of the vector, and item is the value of that element.
277 |
278 | Objects in the database are called beans. To add a new bean to the database we call
279 |
280 | ```cpp
281 | hiberlite::bean_ptr p=db.copyBean(x);
282 | ```
283 |
284 | **copyBean()** creates an internal copy of its argument (by invoking copy-constructor **new MyClass(x)**),
285 | saves it in the database and returns a **bean_ptr**, pointing to that copy.
286 | **bean_ptr** is a smart-pointer, it will perform reference-counting and care about saving and destroying your
287 | bean when it is no longer in use.
288 | But the object will not be lost - it is stored in the database.
289 | The only way to remove it is to call **bean_ptr::destroy()**.
290 |
291 | There are two other ways to create a bean in the database:
292 | **bean_ptr Database::createBean()** creates a bean using default constructor and returns a
293 | **bean_ptr Database::manageBean(C& ptr)** takes control over its argument and wraps it in the bean_ptr.
294 | You must not call **delete ptr;** after calling **manageBean(ptr)** - **bean_ptr** will do it when necessary.
295 |
296 | ## Loading data
297 |
298 | Call to
299 |
300 | ```cpp
301 | std::vector< hiberlite::bean_ptr > v=db.getAllBeans();
302 | ```
303 |
304 | will return a vector with all objects in the database.
305 |
306 | bean_ptr is a smart pointer, but I forgot to mention that it is also a lazy pointer.
307 | Beans itself are not loaded when with **getAllBeans()** - only their primary keys.
308 | To give user the access to the underlying object, C& bean_ptr::operator->() is overloaded.
309 | The object will be created and fetched from the database with the first use of operator->.
310 |
311 | ## User-defined primitive types
312 |
313 | Sometimes, numbers or strings are not suitable representations for fields of objects. In that case it is possible to extend `hiberlite`'s conversion mechanism to support types other than the ones supported. For example:
314 |
315 | given an enum:
316 |
317 | ```cpp
318 | enum class Status {
319 | OK,
320 | NOT_OK
321 | };
322 | ```
323 |
324 | the macro `HIBERLITE_NVP` will cause a compile error if a member of that type is used with it. In order to convert the enum to a number and back (conversion safety considerations may apply), it is possible to define custom conversions before defining the data model:
325 |
326 | ```cpp
327 | namespace hiberlite {
328 | template
329 | void hibernate(A& ar, Status& value, const unsigned int) {
330 | ar& db_atom(value);
331 | }
332 |
333 | template <>
334 | inline std::string db_atom::sqliteStorageClass() {
335 | return "INTEGER";
336 | }
337 |
338 | template <>
339 | template
340 | void db_atom::loadValue(Stmt& res, Arg& arg) {
341 | val = static_cast(res.get_int(arg));
342 | }
343 |
344 | template <>
345 | inline void db_atom::bindValue(sqlite3_stmt* stmt, int col) {
346 | sqlite3_bind_int(stmt, col, static_cast(val));
347 | }
348 | }
349 | ```
350 |
351 | This allows the following to work:
352 |
353 | ```cpp
354 | struct Item {
355 | Status status;
356 |
357 | template
358 | void hibernate(Archive & ar) {
359 | ar & HIBERLITE_NVP(status);
360 | }
361 | };
362 | ```
363 |
--------------------------------------------------------------------------------
/catch_tests.cpp:
--------------------------------------------------------------------------------
1 | #define CATCH_CONFIG_MAIN
2 | #include "catch.hpp"
3 | #include "hiberlite.h"
4 | using namespace hiberlite;
5 |
6 | #include
7 | #include
8 | #include
9 | #include