utelle / SQLite3MultipleCiphers

SQLite3 encryption extension with support for multiple ciphers
https://utelle.github.io/SQLite3MultipleCiphers/
MIT License
390 stars 73 forks source link

Add CMake Support For Windows, Linux, Mac OS X #101

Closed jammerxd closed 1 year ago

jammerxd commented 1 year ago

This PR adds a proof-of-concept CMakeLists.txt - this CMakeLists.txt will work for Windows and Linux (I tested under Ubuntu 22.04 Desktop edition in a virtual machine)

To build with cmake on windows with icu support, specify -DWITH_ICU= on the command line. This should be the folder that has the include, lib, and bin folders or include, lib64, and bin64 folders when building x64.

The build.bat is included as an example of how to build 32-bit Debug/Release and 64-bit Debug/Release and have the build binaries/libs go to separate folders.

Additionally, I found that I cannot compile with the following flags: SQLITE_ENABLE_SERIES SQLITE_ENABLE_REGEXP

Attempting to compile with those flags results in the following compile erros (both on windows/msvc 2022 and linux/ubuntu):

Building Custom Rule D:/Git/SQLite3MultipleCiphers/CMakeLists.txt sqlite3mc.c sqlite3mc_lib_mt.vcxproj -> D:\Git\SQLite3MultipleCiphers\x64\Release\sqlite3mc_lib_mt.lib Building Custom Rule D:/Git/SQLite3MultipleCiphers/CMakeLists.txt sqlite3mc_lib_mt.lib(sqlite3mc.obj) : error LNK2005: sqlite3_regexp_init already defined in shell.obj [D:\Git\SQLite3MultipleCiphers\x64\sqlite3mc_shell.vcxproj] sqlite3mc_lib_mt.lib(sqlite3mc.obj) : error LNK2005: sqlite3_series_init already defined in shell.obj [D:\Git\SQLite3MultipleCiphers\x64\sqlite3mc_shell.vcxproj] Creating library D:/Git/SQLite3MultipleCiphers/x64/Release/sqlite3mc_shell.lib and object D:/Git/SQLite3MultipleCiphers/x64/Release/sqlite3mc_shell.exp D:\Git\SQLite3MultipleCiphers\x64\Release\sqlite3mc_shell.exe : fatal error LNK1169: one or more multiply defined symbols found [D:\Git\SQLite3MultipleCiphers\x64\sqlite3mc_shell.vcxproj]

jammerxd commented 1 year ago

I should also mention this was based on the work that @lwttai did and simply cleans things up and adds cross-platform support.

jammerxd commented 1 year ago

This would also close #9

jammerxd commented 1 year ago

Closing this in support of #102