Skip to content

Commit 39cff3d

Browse files
authored
test: fix includetest to use CMAKE_MAKE_PROGRAM (#431)
includetest currently fais if, for example, ninja is used as a CMake generator. Fix it by using CMAKE_MAKE_PROGRAM in the test.
1 parent b2ede8d commit 39cff3d

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ endif(LIBVNCSERVER_WITH_WEBSOCKETS)
680680

681681
add_test(NAME cargs COMMAND test_cargstest)
682682
if(UNIX)
683-
add_test(NAME includetest COMMAND ${TESTS_DIR}/includetest.sh ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR})
683+
add_test(NAME includetest COMMAND ${TESTS_DIR}/includetest.sh ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR} ${CMAKE_MAKE_PROGRAM})
684684
endif(UNIX)
685685
if(FOUND_LIBJPEG_TURBO)
686686
add_test(NAME turbojpeg COMMAND test_tjunittest)

test/includetest.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55

66
# expects install prefix like /usr as an argument
77
PREFIX=$1
8+
CMAKE_MAKE_PROGRAM=$2
89

910
TMPDIR=$(mktemp -d)
1011

11-
make install DESTDIR=$TMPDIR
12+
DESTDIR="$TMPDIR" $CMAKE_MAKE_PROGRAM install
1213

1314
echo \
1415
"
@@ -19,6 +20,6 @@ int main()
1920
{
2021
return 0;
2122
}
22-
" > $TMPDIR/includetest.c
23+
" > "$TMPDIR"/includetest.c
2324

24-
cc -I $TMPDIR/$PREFIX $TMPDIR/includetest.c
25+
cc -I "$TMPDIR/$PREFIX" "$TMPDIR"/includetest.c

0 commit comments

Comments
 (0)