function(do_build_dpdk dpdk_dir)
- find_program(MAKE_EXECUTABLE NAMES gmake make)
- if(NOT MAKE_EXECUTABLE)
- message(FATAL_ERROR "Can't find make")
- endif()
# mk/machine/native/rte.vars.mk
# rte_cflags are extracted from mk/machine/${machine}/rte.vars.mk
# only 3 of them have -march=<arch> defined, so copying them here.
set(target "${arch}-${machine_tmpl}-${execenv}-${toolchain}")
+ include(FindMake)
+ find_make("MAKE_EXECUTABLE" "make_cmd")
execute_process(
COMMAND ${MAKE_EXECUTABLE} showconfigs
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/src/spdk/dpdk
"\"${target}\" not listed in ${supported_targets}")
endif()
- if(CMAKE_MAKE_PROGRAM MATCHES "make")
- # try to inherit command line arguments passed by parent "make" job
- set(make_cmd "$(MAKE)")
- else()
- set(make_cmd "${MAKE_EXECUTABLE}")
- endif()
-
if(Seastar_DPDK AND WITH_SPDK)
message(FATAL_ERROR "not able to build DPDK with "
"both Seastar_DPDK and WITH_SPDK enabled")
find_package(aio REQUIRED)
find_package(uuid REQUIRED)
endif()
-
- find_program(MAKE_EXECUTABLE NAMES gmake make)
- if(NOT MAKE_EXECUTABLE)
- message(FATAL_ERROR "Can't find make")
- endif()
- if(CMAKE_MAKE_PROGRAM MATCHES "make")
- # try to inherit command line arguments passed by parent "make" job
- set(make_cmd "$(MAKE)")
- else()
- set(make_cmd "${MAKE_EXECUTABLE}")
- endif()
+ include(FindMake)
+ find_make("MAKE_EXECUTABLE" "make_cmd")
set(spdk_CFLAGS "-fPIC")
include(CheckCCompilerFlag)
--- /dev/null
+function(find_make make_exe make_cmd)
+ # make_exe the name of the variable whose value will be the path to "make"
+ # executable
+ # make_cmd the name of the variable whose value will be the command to
+ # used in the generated build script executed by the cmake generator
+ find_program(MAKE_EXECUTABLE NAMES gmake make)
+ if(NOT MAKE_EXECUTABLE)
+ message(FATAL_ERROR "Can't find make")
+ endif()
+ set(${make_exe} "${MAKE_EXECUTABLE}" PARENT_SCOPE)
+ if(CMAKE_MAKE_PROGRAM MATCHES "make")
+ # try to inherit command line arguments passed by parent "make" job
+ set(${make_cmd} "$(MAKE)" PARENT_SCOPE)
+ else()
+ set(${make_cmd} "${MAKE_EXECUTABLE}" PARENT_SCOPE)
+ endif()
+endfunction()