diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 67c856a..7c342b2 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -239,7 +239,10 @@ if(MSVC) /sdl /guard:cf /GS - /DYNAMICBASE) + /DYNAMICBASE + # c2pa_cpp wraps the deprecated C API surface, silence C4996 so the + # wrapper still builds cleanly while end users still see the warning. + /wd4996) target_link_options(c2pa_cpp PRIVATE /DYNAMICBASE @@ -254,6 +257,10 @@ else() -Wstack-protector -fstack-protector-strong -fPIC + # c2pa_cpp wraps the deprecated C API surface, silence the warning + # here so the wrapper still builds with -Werror while end users still + # see the deprecation warning. + -Wno-deprecated-declarations ) if(APPLE) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 8fc031d..217c94d 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -182,6 +182,10 @@ if(WIN32) else() # On Unix systems, link directly to the shared library target_link_libraries(ctest PRIVATE "${C2PA_C_LIB}") + # c-app-test deliberately exercises the deprecated C API so we can keep + # testing it. Silences the resulting -Wdeprecated-declarations so -Werror + # does not fail the (test) build. + target_compile_options(ctest PRIVATE -Wno-deprecated-declarations) endif() target_include_directories(ctest PRIVATE "${C2PA_PREBUILT_INCLUDE_DIR}"