aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRobert Tari <robert@tari.in>2022-01-12 20:00:07 +0100
committerRobert Tari <robert@tari.in>2022-01-12 20:00:07 +0100
commit552f4c5c4ac08b18fe014192952dbbd2d2d2d4a1 (patch)
tree5ba345af2f582a043d53a535ba7c85f0f60ef822 /tests
parent69eac3c0291049a76988d076b43c599230473731 (diff)
downloadayatana-indicator-messages-552f4c5c4ac08b18fe014192952dbbd2d2d2d4a1.tar.gz
ayatana-indicator-messages-552f4c5c4ac08b18fe014192952dbbd2d2d2d4a1.tar.bz2
ayatana-indicator-messages-552f4c5c4ac08b18fe014192952dbbd2d2d2d4a1.zip
Clean up compilation flags
Diffstat (limited to 'tests')
-rw-r--r--tests/CMakeLists.txt14
1 files changed, 8 insertions, 6 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 1f0d117..a43265d 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -24,7 +24,6 @@ set(
)
set_source_files_properties(${HEADERS_GEN} ${SOURCES_GEN} PROPERTIES GENERATED TRUE)
-set_source_files_properties(${HEADERS} ${SOURCES} PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS})
add_library("indicator-messages-service" STATIC ${HEADERS} ${HEADERS_GEN} ${SOURCES} ${SOURCES_GEN})
target_include_directories("indicator-messages-service" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS})
target_compile_definitions("indicator-messages-service" PUBLIC G_LOG_DOMAIN="Ayatana-Indicator-Messages")
@@ -32,18 +31,22 @@ target_link_libraries("indicator-messages-service")
# test-gactionmuxer
-set_source_files_properties(gtest-menuitems.cpp PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS})
add_executable("test-gactionmuxer" test-gactionmuxer.cpp)
target_link_options("test-gactionmuxer" PRIVATE -no-pie)
target_include_directories("test-gactionmuxer" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS} "${CMAKE_SOURCE_DIR}/src")
target_link_libraries("test-gactionmuxer" "indicator-messages-service" ${PROJECT_DEPS_LIBRARIES} ${GTEST_LIBRARIES} ${GTEST_BOTH_LIBRARIES} ${GMOCK_LIBRARIES})
-if (ENABLE_COVERAGE)
- target_link_libraries("test-gactionmuxer" "-lgcov")
-endif()
add_test("test-gactionmuxer" "test-gactionmuxer")
add_dependencies("test-gactionmuxer" "indicator-messages-service")
set(COVERAGE_TEST_TARGETS ${COVERAGE_TEST_TARGETS} "test-gactionmuxer" PARENT_SCOPE)
+if (ENABLE_COVERAGE)
+ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+ target_link_libraries("test-gactionmuxer" "--coverage")
+ else()
+ target_link_libraries("test-gactionmuxer" "-lgcov")
+ endif()
+endif()
+
# gschemas.compiled
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES gschemas.compiled)
@@ -55,7 +58,6 @@ add_custom_target("gschemas-compiled" ALL DEPENDS gschemas.compiled)
# indicator-test
pkg_check_modules(DBUSTEST REQUIRED dbustest-1)
-set_source_files_properties(indicator-test.cpp PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS})
add_executable("indicator-test" indicator-test.cpp)
target_link_options("indicator-test" PRIVATE -no-pie)
target_include_directories("indicator-test" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS} ${DBUSTEST_INCLUDE_DIRS} "${CMAKE_SOURCE_DIR}/libmessaging-menu")