aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRobert Tari <robert@tari.in>2021-08-10 00:51:22 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2021-08-10 21:50:54 +0200
commit9ed2cfff005478242fbf23bd008d7eddb8d9d11e (patch)
tree0ad743c460a1f5cfa81f7746f4bf7bd97d980beb /tests
parent0e8c18ce4a96cbf4bc85e92c3d323050d8903026 (diff)
downloadayatana-indicator-power-9ed2cfff005478242fbf23bd008d7eddb8d9d11e.tar.gz
ayatana-indicator-power-9ed2cfff005478242fbf23bd008d7eddb8d9d11e.tar.bz2
ayatana-indicator-power-9ed2cfff005478242fbf23bd008d7eddb8d9d11e.zip
Use -no-pie build flag for tests only
Diffstat (limited to 'tests')
-rw-r--r--tests/CMakeLists.txt3
1 files changed, 1 insertions, 2 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 1e35481..1dc8a8f 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -1,8 +1,6 @@
find_package(GMock)
include_directories(${GMOCK_INCLUDE_DIRS})
-SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -no-pie")
-
# dbustest
pkg_check_modules(DBUSTEST REQUIRED
dbustest-1>=14.04.0)
@@ -45,6 +43,7 @@ function(add_test_by_name name)
set (TEST_NAME ${name})
set (COVERAGE_TEST_TARGETS ${COVERAGE_TEST_TARGETS} ${TEST_NAME} PARENT_SCOPE)
add_executable (${TEST_NAME} ${TEST_NAME}.cc)
+ target_link_options(${TEST_NAME} PRIVATE -no-pie)
add_test (${TEST_NAME} ${TEST_NAME})
add_dependencies (${TEST_NAME} ayatanaindicatorpowerservice gschemas-compiled)
target_link_libraries (${TEST_NAME} ayatanaindicatorpowerservice gtest ${DBUSTEST_LIBRARIES} ${SERVICE_DEPS_LIBRARIES} ${GTEST_LIBS} ${URLDISPATCHER_LIBRARIES} ${GMOCK_LIBRARIES})