diff --git a/CMakeLists.txt b/CMakeLists.txt index e03ede2..e20362b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,10 +14,10 @@ cmake_minimum_required(VERSION 3.27) # This is the current version of this C++ project -project(c2pa-c VERSION 0.23.0) +project(c2pa-c VERSION 0.23.1) # Set the version of the c2pa_rs library used -set(C2PA_VERSION "0.79.3") +set(C2PA_VERSION "0.79.5") set(CMAKE_POLICY_DEFAULT_CMP0135 NEW) set(CMAKE_C_STANDARD 17) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 67c856a..54da8a8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -239,7 +239,8 @@ if(MSVC) /sdl /guard:cf /GS - /DYNAMICBASE) + /DYNAMICBASE + /wd4996) target_link_options(c2pa_cpp PRIVATE /DYNAMICBASE @@ -254,6 +255,7 @@ else() -Wstack-protector -fstack-protector-strong -fPIC + -Wno-deprecated-declarations ) if(APPLE) diff --git a/src/c2pa_builder.cpp b/src/c2pa_builder.cpp index 8b1249a..686dd8a 100644 --- a/src/c2pa_builder.cpp +++ b/src/c2pa_builder.cpp @@ -104,9 +104,20 @@ namespace c2pa : builder(nullptr) { CppIStream c_archive(archive); - builder = c2pa_builder_from_archive(c_archive.c_stream); - if (builder == nullptr) - { + + C2paContext* ctx = c2pa_context_new(); + if (ctx == nullptr) { + throw C2paException(); + } + + C2paBuilder* base = c2pa_builder_from_context(ctx); + c2pa_free(ctx); + if (base == nullptr) { + throw C2paException(); + } + + builder = c2pa_builder_with_archive(base, c_archive.c_stream); + if (builder == nullptr) { throw C2paException(); } } diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 8fc031d..69b8815 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -183,6 +183,9 @@ else() # On Unix systems, link directly to the shared library target_link_libraries(ctest PRIVATE "${C2PA_C_LIB}") endif() +if(NOT MSVC) + target_compile_options(ctest PRIVATE -Wno-deprecated-declarations) +endif() target_include_directories(ctest PRIVATE "${C2PA_PREBUILT_INCLUDE_DIR}" ${CMAKE_CURRENT_SOURCE_DIR}/c-app-test