summaryrefslogtreecommitdiff
path: root/src/ipcpd/unicast
diff options
context:
space:
mode:
authorDimitri Staessens <[email protected]>2024-04-06 14:36:37 +0200
committerSander Vrijders <[email protected]>2024-04-16 14:16:16 +0200
commitce2b8755c6aa4101b0c4c4e097c7bc71493594c0 (patch)
treeb43dc20b0d3e478c936caba797a9976f464ddede /src/ipcpd/unicast
parentafa421a0396a18c7b40d50e8774ba1d8335754d3 (diff)
downloadouroboros-ce2b8755c6aa4101b0c4c4e097c7bc71493594c0.tar.gz
ouroboros-ce2b8755c6aa4101b0c4c4e097c7bc71493594c0.zip
build: Fix tests with CMake >= 3.29
Removing the testdriver source by the driver name doesn't work anymore in CMake 3.29 because of the following (breaking) change: Changed in version 3.29: The test driver source is listed by absolute path in the build tree. Previously it was listed only as <driverName>. https://cmake.org/cmake/help/latest/command/create_test_sourcelist.html When using CMake 3.29 or above, Ouroboros will use the list POP_FRONT function (introduced in CMake 3.15) to get rid of it. https://cmake.org/cmake/help/latest/command/list.html#pop-front Signed-off-by: Dimitri Staessens <[email protected]> Signed-off-by: Sander Vrijders <[email protected]>
Diffstat (limited to 'src/ipcpd/unicast')
-rw-r--r--src/ipcpd/unicast/dir/tests/CMakeLists.txt6
-rw-r--r--src/ipcpd/unicast/pff/tests/CMakeLists.txt6
-rw-r--r--src/ipcpd/unicast/routing/tests/CMakeLists.txt6
3 files changed, 15 insertions, 3 deletions
diff --git a/src/ipcpd/unicast/dir/tests/CMakeLists.txt b/src/ipcpd/unicast/dir/tests/CMakeLists.txt
index c850e41d..f62ed993 100644
--- a/src/ipcpd/unicast/dir/tests/CMakeLists.txt
+++ b/src/ipcpd/unicast/dir/tests/CMakeLists.txt
@@ -28,7 +28,11 @@ target_link_libraries(${PARENT_DIR}_test ouroboros-common)
add_dependencies(check ${PARENT_DIR}_test)
set(tests_to_run ${${PARENT_DIR}_tests})
-remove(tests_to_run test_suite.c)
+if(CMAKE_VERSION VERSION_LESS "3.29.0")
+ remove(tests_to_run test_suite.c)
+else ()
+ list(POP_FRONT tests_to_run)
+endif()
foreach (test ${tests_to_run})
get_filename_component(test_name ${test} NAME_WE)
diff --git a/src/ipcpd/unicast/pff/tests/CMakeLists.txt b/src/ipcpd/unicast/pff/tests/CMakeLists.txt
index e7082372..65705714 100644
--- a/src/ipcpd/unicast/pff/tests/CMakeLists.txt
+++ b/src/ipcpd/unicast/pff/tests/CMakeLists.txt
@@ -26,7 +26,11 @@ target_link_libraries(${PARENT_DIR}_test ouroboros-common)
add_dependencies(check ${PARENT_DIR}_test)
set(tests_to_run ${${PARENT_DIR}_tests})
-remove(tests_to_run test_suite.c)
+if(CMAKE_VERSION VERSION_LESS "3.29.0")
+ remove(tests_to_run test_suite.c)
+else ()
+ list(POP_FRONT tests_to_run)
+endif()
foreach (test ${tests_to_run})
get_filename_component(test_name ${test} NAME_WE)
diff --git a/src/ipcpd/unicast/routing/tests/CMakeLists.txt b/src/ipcpd/unicast/routing/tests/CMakeLists.txt
index d0652533..9d24bf03 100644
--- a/src/ipcpd/unicast/routing/tests/CMakeLists.txt
+++ b/src/ipcpd/unicast/routing/tests/CMakeLists.txt
@@ -26,7 +26,11 @@ target_link_libraries(${PARENT_DIR}_test ouroboros-common)
add_dependencies(check ${PARENT_DIR}_test)
set(tests_to_run ${${PARENT_DIR}_tests})
-remove(tests_to_run test_suite.c)
+if(CMAKE_VERSION VERSION_LESS "3.29.0")
+ remove(tests_to_run test_suite.c)
+else ()
+ list(POP_FRONT tests_to_run)
+endif()
foreach (test ${tests_to_run})
get_filename_component(test_name ${test} NAME_WE)