Skip to content

Commit 4bec90c

Browse files
committed
[lldb] Require gmake on FreeBSD and NetBSD
gmake is GNU make where make is not GNU compatible. This leads to a lot of tests failing to build with errors like: ``` make: "<...>/Makefile.rules" line 569: Invalid line type ``` See https://cmake.org/cmake/help/latest/variable/CMAKE_SYSTEM_NAME.html for the platform names. Tested on Linux and FreeBSD. Not tested on NetBSD, but the logic was always "if netbsd or freebsd use gmake" so I think I'm safe to assume NetBSD will be fine with this.
1 parent d416cae commit 4bec90c

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

lldb/test/API/CMakeLists.txt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,18 @@ set(LLDB_DEFAULT_TEST_DSYMUTIL "${LLVM_TOOLS_BINARY_DIR}/dsymutil${CMAKE_EXECUTA
5252
if(LLDB_TEST_MAKE)
5353
set(LLDB_DEFAULT_TEST_MAKE ${LLDB_TEST_MAKE})
5454
else()
55-
find_program(LLDB_DEFAULT_TEST_MAKE make gmake)
55+
set(MAKE_NAMES "gmake")
56+
57+
# "make" on FreeBSD and NetBSD is not GNU make compatible.
58+
if(NOT CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" AND NOT CMAKE_SYSTEM_NAME STREQUAL "NetBSD")
59+
list(APPEND MAKE_NAMES "make")
60+
endif()
61+
62+
find_program(LLDB_DEFAULT_TEST_MAKE NAMES ${MAKE_NAMES})
5663
if(LLDB_DEFAULT_TEST_MAKE)
5764
message(STATUS "Found make: ${LLDB_DEFAULT_TEST_MAKE}")
5865
else()
59-
message(STATUS "Not found: make")
66+
message(STATUS "Did not find one of: ${MAKE_NAMES}")
6067
message(WARNING
6168
"Many LLDB API tests require 'make' tool. Please provide it in Path "
6269
"or pass via LLDB_TEST_MAKE.")

0 commit comments

Comments
 (0)