updated build system

This commit is contained in:
Scott E. Graves 2024-10-18 11:46:59 -05:00
parent c216df9b73
commit 09cb5d8f19
14 changed files with 68 additions and 95 deletions

View File

@ -1,15 +1,15 @@
set(BINUTILS_VERSION 2.41)
set(BOOST2_MAJOR_VERSION 1)
set(BOOST2_MINOR_VERSION 76)
set(BOOST2_PATCH_VERSION 0)
set(BOOST_MAJOR_VERSION 1)
set(BOOST_MINOR_VERSION 85)
set(BOOST_PATCH_VERSION 0)
set(BOOST2_MAJOR_VERSION 1)
set(BOOST2_MINOR_VERSION 76)
set(BOOST2_PATCH_VERSION 0)
set(CPP_HTTPLIB_VERSION 0.16.3)
set(CURL2_VERSION 8_9_1)
set(CURL_VERSION 8.9.1)
set(EXPAT2_VERSION 2_6_2)
set(CURL2_VERSION 8_9_1)
set(EXPAT_VERSION 2.6.2)
set(EXPAT2_VERSION 2_6_2)
set(GCC_VERSION 14.2.0)
set(GTEST_VERSION 1.15.2)
set(ICU_VERSION 75-1)
@ -21,7 +21,7 @@ set(OPENSSL_VERSION 3.3.1)
set(PKG_CONFIG_VERSION 0.29.2)
set(PUGIXML_VERSION 1.14)
set(SPDLOG_VERSION 1.14.1)
set(SQLITE2_VERSION 3.46.1)
set(SQLITE_VERSION 3460100)
set(SQLITE2_VERSION 3.46.1)
set(STDUUID_VERSION 1.2.3)
set(ZLIB_VERSION 1.3.1)

View File

@ -221,44 +221,25 @@ using WCHAR = wchar_t;
#define MAX_PATH 260
#define STATUS_SUCCESS \
std::uint32_t { 0U }
#define STATUS_ACCESS_DENIED \
std::uint32_t { 0xC0000022L }
#define STATUS_DEVICE_BUSY \
std::uint32_t { 0x80000011L }
#define STATUS_DEVICE_INSUFFICIENT_RESOURCES \
std::uint32_t { 0xC0000468L }
#define STATUS_DIRECTORY_NOT_EMPTY \
std::uint32_t { 0xC0000101L }
#define STATUS_FILE_IS_A_DIRECTORY \
std::uint32_t { 0xC00000BAL }
#define STATUS_FILE_TOO_LARGE \
std::uint32_t { 0xC0000904L }
#define STATUS_INSUFFICIENT_RESOURCES \
std::uint32_t { 0xC000009AL }
#define STATUS_INTERNAL_ERROR \
std::uint32_t { 0xC00000E5L }
#define STATUS_INVALID_ADDRESS \
std::uint32_t { 0xC0000141L }
#define STATUS_INVALID_HANDLE \
std::uint32_t { 0xC0000006L }
#define STATUS_INVALID_IMAGE_FORMAT \
std::uint32_t { 0xC000007BL }
#define STATUS_INVALID_PARAMETER \
std::uint32_t { 0xC000000DL }
#define STATUS_NO_MEMORY \
std::uint32_t { 0xC0000017L }
#define STATUS_NOT_IMPLEMENTED \
std::uint32_t { 0xC0000002L }
#define STATUS_OBJECT_NAME_EXISTS \
std::uint32_t { 0x40000000L }
#define STATUS_OBJECT_NAME_NOT_FOUND \
std::uint32_t { 0xC0000034L }
#define STATUS_OBJECT_PATH_INVALID \
std::uint32_t { 0xC0000039L }
#define STATUS_UNEXPECTED_IO_ERROR \
std::uint32_t { 0xC00000E9L }
#define STATUS_SUCCESS std::uint32_t{0U}
#define STATUS_ACCESS_DENIED std::uint32_t{0xC0000022L}
#define STATUS_DEVICE_BUSY std::uint32_t{0x80000011L}
#define STATUS_DEVICE_INSUFFICIENT_RESOURCES std::uint32_t{0xC0000468L}
#define STATUS_DIRECTORY_NOT_EMPTY std::uint32_t{0xC0000101L}
#define STATUS_FILE_IS_A_DIRECTORY std::uint32_t{0xC00000BAL}
#define STATUS_FILE_TOO_LARGE std::uint32_t{0xC0000904L}
#define STATUS_INSUFFICIENT_RESOURCES std::uint32_t{0xC000009AL}
#define STATUS_INTERNAL_ERROR std::uint32_t{0xC00000E5L}
#define STATUS_INVALID_ADDRESS std::uint32_t{0xC0000141L}
#define STATUS_INVALID_HANDLE std::uint32_t{0xC0000006L}
#define STATUS_INVALID_IMAGE_FORMAT std::uint32_t{0xC000007BL}
#define STATUS_INVALID_PARAMETER std::uint32_t{0xC000000DL}
#define STATUS_NO_MEMORY std::uint32_t{0xC0000017L}
#define STATUS_NOT_IMPLEMENTED std::uint32_t{0xC0000002L}
#define STATUS_OBJECT_NAME_EXISTS std::uint32_t{0x40000000L}
#define STATUS_OBJECT_NAME_NOT_FOUND std::uint32_t{0xC0000034L}
#define STATUS_OBJECT_PATH_INVALID std::uint32_t{0xC0000039L}
#define STATUS_UNEXPECTED_IO_ERROR std::uint32_t{0xC00000E9L}
#define CONVERT_STATUS_NOT_IMPLEMENTED(e) \
((std::uint32_t(e) == STATUS_NOT_IMPLEMENTED) ? -ENOTSUP : e)
@ -296,8 +277,8 @@ using namespace Fsp;
#define INTERFACE_SETUP(name) \
public: \
name(const name &) noexcept = delete; \
name &operator=(const name &) noexcept = delete; \
name &operator=(name &&) noexcept = delete; \
auto operator=(const name &) noexcept -> name & = delete; \
auto operator=(name &&) noexcept -> name & = delete; \
\
protected: \
name() = default; \

View File

@ -27,7 +27,7 @@
#include "utils/error.hpp"
namespace repertory::utils::db::sqlite {
void sqlite3_deleter::operator()(sqlite3 *db3) const {
void sqlite_deleter::operator()(sqlite3 *db3) const {
REPERTORY_USES_FUNCTION_NAME();
if (db3 == nullptr) {
@ -35,10 +35,6 @@ void sqlite3_deleter::operator()(sqlite3 *db3) const {
}
utils::error::handle_error(function_name, "closing database handle");
sqlite3_db_cacheflush(db3);
std::string err_msg;
execute_sql(*db3, "PRAGMA wal_checkpoint(full);", err_msg);
if (not utils::retry_action(
[&db3]() -> bool {
@ -57,7 +53,8 @@ void sqlite3_deleter::operator()(sqlite3 *db3) const {
return false;
},
60U)) {
utils::error::handle_error(function_name, "failed to close database");
repertory::utils::error::handle_error(function_name,
"failed to close database");
}
}

View File

@ -19,15 +19,12 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include "utils/db/sqlite/db_delete.hpp"
#if defined(PROJECT_ENABLE_SQLITE)
#include "utils/db/sqlite/db_delete.hpp"
namespace repertory::utils::db::sqlite {
void db_delete::context::clear() {
// stmt.reset();
where_data.reset();
}
void db_delete::context::clear() { where_data.reset(); }
auto db_delete::context::db_delete_op_t::dump() const -> std::string {
return db_delete{ctx}.dump();

View File

@ -19,18 +19,15 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include "utils/db/sqlite/db_insert.hpp"
#if defined(PROJECT_ENABLE_SQLITE)
namespace repertory::utils::db::sqlite {
void db_insert::context::clear() {
// stmt.reset();
values.clear();
}
#include "utils/db/sqlite/db_insert.hpp"
auto db_insert::column_value(std::string column_name, db_types_t value)
-> db_insert & {
namespace repertory::utils::db::sqlite {
void db_insert::context::clear() { values.clear(); }
auto db_insert::column_value(std::string column_name,
db_types_t value) -> db_insert & {
ctx_->values[column_name] = value;
return *this;
}

View File

@ -19,10 +19,10 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include "utils/db/sqlite/db_select.hpp"
#if defined(PROJECT_ENABLE_SQLITE)
#include "utils/db/sqlite/db_select.hpp"
namespace repertory::utils::db::sqlite {
void db_select::context::clear() {
columns.clear();
@ -31,7 +31,6 @@ void db_select::context::clear() {
limit.reset();
offset.reset();
order_by.reset();
// stmt.reset();
where_data.reset();
}
@ -73,8 +72,8 @@ auto db_select::column(std::string column_name) -> db_select & {
return *this;
}
auto db_select::count(std::string column_name, std::string as_column_name)
-> db_select & {
auto db_select::count(std::string column_name,
std::string as_column_name) -> db_select & {
ctx_->count_columns[column_name] = as_column_name;
return *this;
}
@ -210,8 +209,8 @@ auto db_select::offset(std::int32_t value) -> db_select & {
return *this;
}
auto db_select::order_by(std::string column_name, bool ascending)
-> db_select & {
auto db_select::order_by(std::string column_name,
bool ascending) -> db_select & {
ctx_->order_by = {column_name, ascending};
return *this;
}

View File

@ -19,16 +19,15 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include "utils/db/sqlite/db_update.hpp"
#if defined(PROJECT_ENABLE_SQLITE)
#include "utils/db/sqlite/db_update.hpp"
namespace repertory::utils::db::sqlite {
void db_update::context::clear() {
column_values.clear();
limit.reset();
order_by.reset();
// stmt.reset();
where_data.reset();
}
@ -53,8 +52,8 @@ auto db_update::context::db_update_op_t::order_by(std::string column_name,
return *this;
}
auto db_update::column_value(std::string column_name, db_types_t value)
-> db_update & {
auto db_update::column_value(std::string column_name,
db_types_t value) -> db_update & {
ctx_->column_values[column_name] = value;
return *this;
}
@ -174,8 +173,8 @@ auto db_update::limit(std::int32_t value) -> db_update & {
return *this;
}
auto db_update::order_by(std::string column_name, bool ascending)
-> db_update & {
auto db_update::order_by(std::string column_name,
bool ascending) -> db_update & {
ctx_->order_by = {column_name, ascending};
return *this;
}

View File

@ -19,6 +19,8 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#if defined(PROJECT_ENABLE_LIBSODIUM) && defined(PROJECT_ENABLE_BOOST)
#include "utils/encrypting_reader.hpp"
#include "utils/collection.hpp"
@ -29,8 +31,6 @@
#include "utils/unix.hpp"
#include "utils/windows.hpp"
#if defined(PROJECT_ENABLE_LIBSODIUM) && defined(PROJECT_ENABLE_BOOST)
#if !defined(CURL_READFUNC_ABORT)
#define CURL_READFUNC_ABORT (-1)
#endif // !defined(CURL_READFUNC_ABORT)

View File

@ -19,13 +19,13 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#if defined(PROJECT_ENABLE_LIBSODIUM) && defined(PROJECT_ENABLE_BOOST)
#include "utils/encryption.hpp"
#include "utils/collection.hpp"
#include "utils/encrypting_reader.hpp"
#if defined(PROJECT_ENABLE_LIBSODIUM) && defined(PROJECT_ENABLE_BOOST)
namespace repertory::utils::encryption {
auto decrypt_file_path(std::string_view encryption_token,
std::string &file_path) -> bool {

View File

@ -27,8 +27,13 @@ std::atomic<const i_exception_handler *> exception_handler{
auto create_error_message(std::vector<std::string_view> items) -> std::string {
std::stringstream stream{};
for (auto &&item : items) {
stream << '|' << item;
stream << function_name;
for (std::size_t idx = 0U; idx < items.size(); ++idx) {
if (idx > 0) {
stream << '|';
}
stream << item;
}
return stream.str();

View File

@ -161,7 +161,7 @@ auto directory::create_directory(std::string_view path) const
std::string{abs_path} + '|' +
std::to_string(res));
}
#else // !defined(_WIN32)
#else // !defined(_WIN32)
auto ret{true};
auto paths =
utils::string::split(abs_path, utils::path::directory_seperator, false);

View File

@ -25,7 +25,6 @@
#include "utils/common.hpp"
#include "utils/error.hpp"
#include "utils/path.hpp"
#include <utils/config.hpp>
namespace {
[[nodiscard]] auto get_file_size(std::string_view path,
@ -398,8 +397,6 @@ auto file::sha256() -> std::optional<std::string> {
#endif // defined(PROJECT_ENABLE_LIBSODIUM)
auto file::remove() -> bool {
REPERTORY_USES_FUNCTION_NAME();
close();
return utils::retry_action([this]() -> bool {

View File

@ -19,10 +19,10 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include "utils/hash.hpp"
#if defined(PROJECT_ENABLE_LIBSODIUM)
#include "utils/hash.hpp"
namespace repertory::utils::encryption {
auto create_hash_blake2b_256(std::string_view data) -> hash_256_t {
return create_hash_blake2b_t<hash_256_t>(

View File

@ -20,6 +20,7 @@
SOFTWARE.
*/
#if defined(_WIN32)
#include "utils/windows.hpp"
#include "utils/com_init_wrapper.hpp"
@ -27,7 +28,7 @@
namespace repertory::utils {
void create_console() {
if (AllocConsole() == 0) {
if (::AllocConsole() == 0) {
return;
}
@ -56,7 +57,7 @@ void create_console() {
}
void free_console() {
FreeConsole();
::FreeConsole();
}
auto get_last_error_code() -> DWORD { return ::GetLastError(); }