Skip to content

[lldb][test] Prefer gmake to make and warn for potentially non-GNU make #119573

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions lldb/test/API/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,24 @@ set(LLDB_DEFAULT_TEST_DSYMUTIL "${LLVM_TOOLS_BINARY_DIR}/dsymutil${CMAKE_EXECUTA
if(LLDB_TEST_MAKE)
set(LLDB_DEFAULT_TEST_MAKE ${LLDB_TEST_MAKE})
else()
find_program(LLDB_DEFAULT_TEST_MAKE make gmake)
# Prefer gmake as it will be a version of GNU make. 'make' could be GNU compatible or not.
set(MAKE_NAMES "gmake" "make")
find_program(LLDB_DEFAULT_TEST_MAKE NAMES ${MAKE_NAMES})
if(LLDB_DEFAULT_TEST_MAKE)
message(STATUS "Found make: ${LLDB_DEFAULT_TEST_MAKE}")
execute_process(COMMAND ${LLDB_DEFAULT_TEST_MAKE} --version OUTPUT_VARIABLE MAKE_VERSION
ERROR_QUIET)
if(NOT MAKE_VERSION MATCHES "^GNU Make")
message(WARNING "'make' tool ${LLDB_DEFAULT_TEST_MAKE} may not be GNU make compatible. "
"Some tests may fail to build. Provide a GNU compatible 'make' tool by setting "
"LLDB_TEST_MAKE.")
endif()
else()
message(STATUS "Not found: make")
list(JOIN "${MAKE_NAMES}" " " MAKE_NAMES_SPACES)
string(REPLACE ";" " " MAKE_NAMES_SPACES "${MAKE_NAMES}")
message(STATUS "Did not find one of: ${MAKE_NAMES_SPACES}")
message(WARNING
"Many LLDB API tests require 'make' tool. Please provide it in Path "
"Many LLDB API tests require a 'make' tool. Please provide it in Path "
"or pass via LLDB_TEST_MAKE.")
endif()
endif()
Expand Down
Loading