]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
cmake: Fix googletest deprecated warnings by using target_compile_options() 62680/head
authorKefu Chai <tchaikov@gmail.com>
Fri, 4 Apr 2025 07:37:20 +0000 (15:37 +0800)
committerKefu Chai <tchaikov@gmail.com>
Fri, 4 Apr 2025 07:44:16 +0000 (15:44 +0800)
commitfe9fcf67ac7359201c42528f21e419a3e821ec7b
tree1981d67c875b329b06c4707c069a2d24549881d8
parent7a4d7c559257a76dc9e4e65129618b1dd961125c
cmake: Fix googletest deprecated warnings by using target_compile_options()

Previously, we attempted to disable deprecated declarations warnings when
building gtest by adding `-Wno-deprecated-declarations` to the COMPILE_OPTIONS
property of the googletest directory. However, this approach failed to apply
the option when actually building gtest.

This change applies the compile option directly to the `gtest` target using
target_compile_options() instead. Verified by forcing the condition to TRUE
and confirming the option is included when building `gtest-all.cc` through
`cmake --build ~/dev/ceph/build --target gtest --verbose`.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
src/CMakeLists.txt