Skip to content

Commit a1633fc

Browse files
authored
cmake BUGFIX fix list(REMOVE_ITEM ...) (#2332)
When using a cmake version <= 3.19 the compat check fails with: CMake Error at CMakeModules/UseCompat.cmake:48 (list): list sub-command REMOVE_ITEM requires two or more arguments. To solve the issue we simply add an empty element "". Signed-off-by: Heiko Thiery <[email protected]>
1 parent e0fbbb7 commit a1633fc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

CMakeModules/UseCompat.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ macro(USE_COMPAT)
4545
find_package(Threads)
4646
list(APPEND CMAKE_REQUIRED_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
4747
check_function_exists(pthread_mutex_timedlock HAVE_PTHREAD_MUTEX_TIMEDLOCK)
48-
list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
48+
list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES ${CMAKE_THREAD_LIBS_INIT} "") # cmake <= 3.19 needs at least one item
4949

5050
test_big_endian(IS_BIG_ENDIAN)
5151

0 commit comments

Comments
 (0)