Skip to content

Commit

Permalink
build: Improve the search for an AWK processor in the CMake build
Browse files Browse the repository at this point in the history
Add nawk to the list of AWK-processing programs that are known to work,
and show the search result in the CMake log.
  • Loading branch information
ctruta committed Feb 19, 2024
1 parent aa95dee commit d165a20
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,15 @@ int main(void) { return 0; }
file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/conftest.map")
endif()

find_program(AWK NAMES gawk awk)
# Find an AWK language processor.
# Start with specific AWK implementations like gawk and nawk, which are
# known to work with our scripts, then fall back to the system awk.
find_program(AWK NAMES gawk nawk awk)
if(AWK)
message(STATUS "Found AWK program: ${AWK}")
else()
message(STATUS "Could not find an AWK-compatible program")
endif()

include_directories(${CMAKE_CURRENT_BINARY_DIR})

Expand Down

0 comments on commit d165a20

Please sign in to comment.