aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRobert Tari <robert@tari.in>2021-08-10 00:45:52 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2021-08-10 21:54:30 +0200
commit6472b6f79c7bada6d7d18891d7d6333196e454e8 (patch)
tree28841d20fa441e28acc1f4911579ff0208770b79 /tests
parentd9340bfd47aaf6c6ff584929987ce1dd46caf0b5 (diff)
downloadayatana-indicator-session-6472b6f79c7bada6d7d18891d7d6333196e454e8.tar.gz
ayatana-indicator-session-6472b6f79c7bada6d7d18891d7d6333196e454e8.tar.bz2
ayatana-indicator-session-6472b6f79c7bada6d7d18891d7d6333196e454e8.zip
Use -no-pie build flag for tests only
Diffstat (limited to 'tests')
-rw-r--r--tests/CMakeLists.txt3
-rw-r--r--tests/backend-dbus/CMakeLists.txt3
2 files changed, 4 insertions, 2 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 1e81bc2..f03b98e 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -1,7 +1,5 @@
find_package(GMock)
-SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -no-pie")
-
# build the necessary schemas
set_directory_properties (PROPERTIES
ADDITIONAL_MAKE_CLEAN_FILES gschemas.compiled)
@@ -51,6 +49,7 @@ add_custom_target(
# test-service
add_executable (test-service
test-service.cc)
+target_link_options(test-service PRIVATE -no-pie)
set_target_properties (test-service PROPERTIES COMPILE_FLAGS " -std=c++0x")
add_test (test-service test-service)
add_dependencies (test-service libayatanaindicatorsessionservice backendmock gschemas-compiled)
diff --git a/tests/backend-dbus/CMakeLists.txt b/tests/backend-dbus/CMakeLists.txt
index 0589487..93ffc45 100644
--- a/tests/backend-dbus/CMakeLists.txt
+++ b/tests/backend-dbus/CMakeLists.txt
@@ -35,17 +35,20 @@ include_directories (${CMAKE_SOURCE_DIR}/tests)
# test the Actions class
add_executable (test-actions
test-actions.cc)
+target_link_options(test-actions PRIVATE -no-pie)
add_test (test-actions test-actions)
target_link_libraries (test-actions desktopmock backenddbus libayatanaindicatorsessionservice ${SERVICE_LDFLAGS} ${GTEST_LIBRARIES} ${GTEST_BOTH_LIBRARIES} ${GMOCK_LIBRARIES})
# test the Guest class
add_executable (test-guest
test-guest.cc)
+target_link_options(test-guest PRIVATE -no-pie)
add_test (test-guest test-guest)
target_link_libraries (test-guest desktopmock backenddbus libayatanaindicatorsessionservice ${SERVICE_LDFLAGS} ${GTEST_LIBRARIES} ${GTEST_BOTH_LIBRARIES} ${GMOCK_LIBRARIES})
# test the Users class
add_executable (test-users
test-users.cc)
+target_link_options(test-users PRIVATE -no-pie)
add_test (test-users test-users)
target_link_libraries (test-users desktopmock backenddbus libayatanaindicatorsessionservice ${SERVICE_LDFLAGS} ${GTEST_LIBRARIES} ${GTEST_BOTH_LIBRARIES} ${GMOCK_LIBRARIES})