最小化 SQLite 库大小 [英] Minimize SQLite library size

查看:52
本文介绍了最小化 SQLite 库大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我认为这对于 sqlite3.dll 或 sqlite3.lib 是相同的,但如果不是,我对 sqlite3.o (mingw32) 感兴趣.

I assume this is the same for sqlite3.dll or sqlite3.lib, but if not, I am interested in sqlite3.o (mingw32).

如何最小化库的大小(使用 -O3 进行编译,因为速度是我最关心的问题,因此无法选择不同的编译器优化)?
如果我知道我的程序中有一些我不需要的 SQL 部分(例如 JOINATTACH 或触发器),我可以删除对它们的支持吗(这是为了嵌入式系统,每个字节都很重要,或者至少每 100 个字节左右)?
我可以设置哪些预处理器选项来删除我不需要的 FTS 或 R-Tree 支持等内容?我是在命令行还是在文件中设置它们?
是否有任何其他我可能不需要的易于移除的东西,甚至可能不知道它们存在以便移除它们?
一些 C API 怎么样?其中大部分我从未使用过.

How can I minimize the size of the library (compiling with -O3, since speed is my top concern, so different compiler optimizations is not an option)?
If I know there are parts of SQL I don't need in my program (like JOIN or ATTACH or triggers), can I remove support for them (this is for an embedded system and every byte counts, or at least every 100 bytes or so)?
What pre-processor options can I set to remove things like FTS or R-Tree support which I do not need? Do I set them at the command line or in the file?
Are there any other things easily removable that I might not need and might not even know they exist in order to remove them?
How about some of the C API? Most of it I never use.

推荐答案

请查看此处.有一章省略功能的选项".例如,您会在那里找到 SQLITE_OMIT_ATTACH.

Please look here. There's a chapter "Options to omit features". You'll find for example SQLITE_OMIT_ATTACH there.

但是请注意那里的警告.它说

But please note the warning there. It says

SQLITE_OMIT_* 编译时选项通常未经测试并且是几乎可以肯定未经测试的组合.任何或所有这些选项可能会在将来的版本中从代码中删除,并且不会发出警告.对于任何特定版本,其中一些选项可能会导致编译时或运行时失败,特别是在用于与其他选项结合使用.

the SQLITE_OMIT_* compile-time options are usually untested and are almost certainly untested in combination. Any or all of these options may be removed from the code in future releases and without warning. For any particular release, some of these options may cause compile-time or run-time failures, particularly when used in combination with other options.

这篇关于最小化 SQLite 库大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆