Skip to content

Commit 857bc85

Browse files
committed
refactor(tests): modernize CMake configuration for notification server tests
Replaced global CMAKE_CXX_FLAGS with target-specific compile options using target_compile_options() for better encapsulation. Removed redundant include(GoogleTest) since find_package(GTest) is already called. Log: Modernize CMake configuration for notification server tests Influence: 1. Verify notifyserverapplet_tests builds successfully 2. Confirm no CMake configuration warnings refactor(tests): 现代化通知服务器测试的 CMake 配置 使用 target_compile_options() 替代全局 CMAKE_CXX_FLAGS, 提供更好的封装性。移除冗余的 include(GoogleTest)。 Log: 现代化通知服务器测试的 CMake 配置 Influence: 1. 验证 notifyserverapplet_tests 构建成功 2. 确认没有 CMake 配置警告
1 parent e120516 commit 857bc85

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tests/panels/notification/server/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
find_package(GTest REQUIRED)
66
find_package(Qt${QT_VERSION_MAJOR} ${REQUIRED_QT_VERSION} REQUIRED COMPONENTS Core Test DBus)
77

8-
include(GoogleTest)
8+
find_package(GTest REQUIRED)
99

1010
add_executable(notifyserverapplet_tests
1111
${CMAKE_SOURCE_DIR}/panels/notification/server/notifyserverapplet.h
@@ -28,7 +28,7 @@ add_executable(notifyserverapplet_tests
2828
notifyserverapplet_test.cpp
2929
)
3030

31-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden")
31+
target_compile_options(notifyserverapplet_tests PRIVATE -fvisibility=hidden -fvisibility-inlines-hidden)
3232

3333
target_link_libraries(notifyserverapplet_tests PRIVATE
3434
GTest::GTest

0 commit comments

Comments
 (0)