From d2ebc1caa2118425e341319d7c9a0e1f2f30f133 Mon Sep 17 00:00:00 2001 From: Florian Becker Date: Thu, 14 Nov 2024 13:42:51 +0100 Subject: [PATCH] Fix icu dependency Fix macos codeql workflow Fix unsigned char convertion --- .github/workflows/macos-codeql.yml | 4 ++-- cmake/external/icu.cmake | 10 +++++----- source/CMakeLists.txt | 5 +++++ source/SqliteUtils.cpp | 5 +++++ 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/.github/workflows/macos-codeql.yml b/.github/workflows/macos-codeql.yml index 7094395..c836309 100644 --- a/.github/workflows/macos-codeql.yml +++ b/.github/workflows/macos-codeql.yml @@ -24,13 +24,13 @@ jobs: ] config: [Debug, Release] include: - - name: macos-13-xcode-15-x86_64 + - name: macos-13-xcode-14-x86_64 os: macos-13 compiler: xcode version: "14.3" architecture: x86_64 - - name: macos-13-xcode-15-arm64 + - name: macos-13-xcode-14-arm64 os: macos-13 compiler: xcode version: "14.3" diff --git a/cmake/external/icu.cmake b/cmake/external/icu.cmake index 1b4035d..b9c094f 100644 --- a/cmake/external/icu.cmake +++ b/cmake/external/icu.cmake @@ -63,15 +63,15 @@ else() if(CMAKE_BUILD_TYPE STREQUAL "Debug") set(ICU_I18N_LIBRARY ${ICU_SRC}/src/ICU/lib${ICU_ARCH}/icuind.lib) set(ICU_UC_LIBRARY ${ICU_SRC}/src/ICU/lib${ICU_ARCH}/icuucd.lib) - set(ICU_I18N_DLL ${ICU_SRC}/src/ICU/bin${ICU_ARCH}/icuin72d.dll) - set(ICU_UC_DLL ${ICU_SRC}/src/ICU/bin${ICU_ARCH}/icuuc72d.dll) + set(ICU_I18N_DLL ${ICU_SRC}/src/ICU/bin${ICU_ARCH}/icuin76d.dll) + set(ICU_UC_DLL ${ICU_SRC}/src/ICU/bin${ICU_ARCH}/icuuc76d.dll) else() set(ICU_I18N_LIBRARY ${ICU_SRC}/src/ICU/lib${ICU_ARCH}/icuin.lib) set(ICU_UC_LIBRARY ${ICU_SRC}/src/ICU/lib${ICU_ARCH}/icuuc.lib) - set(ICU_I18N_DLL ${ICU_SRC}/src/ICU/bin${ICU_ARCH}/icuin72.dll) - set(ICU_UC_DLL ${ICU_SRC}/src/ICU/bin${ICU_ARCH}/icuuc72.dll) + set(ICU_I18N_DLL ${ICU_SRC}/src/ICU/bin${ICU_ARCH}/icuin76.dll) + set(ICU_UC_DLL ${ICU_SRC}/src/ICU/bin${ICU_ARCH}/icuuc76.dll) endif() - set(ICU_DATA_DLL ${ICU_SRC}/src/ICU/bin${ICU_ARCH}/icudt72.dll) + set(ICU_DATA_DLL ${ICU_SRC}/src/ICU/bin${ICU_ARCH}/icudt76.dll) set(ICU_INCLUDE_DIR ${ICU_SRC}/src/ICU/include) endif() diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 347487a..b6666d2 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -43,6 +43,11 @@ target_include_directories(${PROJECT_NAME} ${PROJECT_SOURCE_DIR} ) +target_compile_definitions(${PROJECT_NAME} + PRIVATE + $<$:HAVE_SPAN> +) + if(CMAKE_CXX_COMPILER_ID MATCHES Clang AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0) set(${PROJECT_NAME}_LIBS -lc++fs) endif() diff --git a/source/SqliteUtils.cpp b/source/SqliteUtils.cpp index 922dd74..cd34c5e 100644 --- a/source/SqliteUtils.cpp +++ b/source/SqliteUtils.cpp @@ -255,7 +255,12 @@ namespace vx::sqlite_utils { return { SQLITE_IOERR, SqliteErrorCategory::instance() }; } +#ifdef HAVE_SPAN + const std::span spanDump( dump.get(), static_cast( serializationSize ) ); + std::vector converted( std::begin( spanDump ), std::end( spanDump ) ); +#else std::vector converted( dump.get(), dump.get() + serializationSize ); +#endif if ( converted.empty() ) { SqliteErrorCategory::instance().setMessage( "Export not convertable." );