Silence LocalParameterization deprecation warnings

Suppress warnings in all Ceres targets without leaking suppressions into
user code (fixes #750).

Change-Id: I3aa1063cb0aae547865a15311ac286ef6d81a955
This commit is contained in:
Sergiu Deitsch
2022-02-10 20:47:55 +01:00
committed by Sameer Agarwal
parent de69e657a6
commit 708a2a7233
2 changed files with 6 additions and 14 deletions
+6
View File
@@ -649,6 +649,12 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") # Matches Clang & AppleClang.
endif(HAVE_RETURN_TYPE_C_LINKAGE)
endif ()
# Disable warnings about deprecated interfaces while we are
# transitioning from LocalParameterization to Manifolds.
add_compile_options(
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>,$<CXX_COMPILER_ID:GNU>>:-Wno-deprecated-declarations>
$<$<CXX_COMPILER_ID:MSVC>:/wd4996>)
# Configure the Ceres config.h compile options header using the current
# compile options and put the configured header into the Ceres build
# directory. Note that the ceres/internal subdir in <build>/config where
-14
View File
@@ -262,13 +262,6 @@ set_target_properties(ceres PROPERTIES
VERSION ${CERES_VERSION}
SOVERSION ${CERES_VERSION_MAJOR})
# Disable warnings about deprecated interfaces while we are
# transitioning from LocalParameterization to Manifolds.
target_compile_options(ceres PRIVATE
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>,$<CXX_COMPILER_ID:GNU>>:
-Wno-deprecated-declarations>
$<$<CXX_COMPILER_ID:MSVC>: /wd4996>)
if (BUILD_SHARED_LIBS)
set_target_properties(ceres PROPERTIES
# Set the default symbol visibility to hidden to unify the behavior among
@@ -443,13 +436,6 @@ if (BUILD_TESTING AND GFLAGS)
${CERES_LIBRARY_PRIVATE_DEPENDENCIES_INCLUDE_DIRS})
# Disable warnings about deprecated interfaces while we are
# transitioning from LocalParameterization to Manifolds.
target_compile_options(${NAME}_test PRIVATE
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>,$<CXX_COMPILER_ID:GNU>>:
-Wno-deprecated-declarations>
$<$<CXX_COMPILER_ID:MSVC>: /wd4996>)
target_link_libraries(${NAME}_test PUBLIC test_util Ceres::ceres gtest)
if (BUILD_SHARED_LIBS)
# Define gtest-specific shared library flags for linking.