Skip to content

Commit aa3c542

Browse files
committed
[lldb] Prefer gmake on FreeBSD and NetBSD
System `make` on FreeBSD is missing some GNU make features so out of the box you get a lot of: ``` make: "<...>/Makefile.rules" line 569: Invalid line type ``` gmake is GNU compatible make, but we were preferring make even if it was installed. Reverse that on the BSDs so we use gmake if we can, and warn if we cannot find a gmake that some of the tests won't build.
1 parent d416cae commit aa3c542

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

lldb/test/API/CMakeLists.txt

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,22 @@ 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 "make" "gmake")
56+
if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR CMAKE_SYSTEM_NAME STREQUAL "NetBSD")
57+
# Prefer gmake (GNU compatible make) to make on the BSDs.
58+
list(REVERSE MAKE_NAMES)
59+
endif()
60+
find_program(LLDB_DEFAULT_TEST_MAKE NAMES ${MAKE_NAMES})
5661
if(LLDB_DEFAULT_TEST_MAKE)
5762
message(STATUS "Found make: ${LLDB_DEFAULT_TEST_MAKE}")
63+
if((CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR CMAKE_SYSTEM_NAME STREQUAL "NetBSD") AND
64+
NOT LLDB_DEFAULT_TEST_MAKE MATCHES "gmake$")
65+
message(WARNING
66+
"Make tool '${LLDB_DEFAULT_TEST_MAKE}' may not be able to build LLDB tests. "
67+
"Consider installing 'gmake' if you want to run tests.")
68+
endif()
5869
else()
59-
message(STATUS "Not found: make")
70+
message(STATUS "Did not find one of: ${MAKE_NAMES}")
6071
message(WARNING
6172
"Many LLDB API tests require 'make' tool. Please provide it in Path "
6273
"or pass via LLDB_TEST_MAKE.")

0 commit comments

Comments
 (0)