build: throw error when DPDK/MPI/Python bindings dependencies are unmet

This commit is contained in:
Gabriel Ferreira
2022-04-16 23:49:59 -03:00
parent 4df6af79d4
commit 55c36d8045
2 changed files with 24 additions and 18 deletions

View File

@@ -761,15 +761,15 @@ macro(process_options)
if(${NS3_PYTHON_BINDINGS})
if(NOT ${Python3_FOUND})
message(
${HIGHLIGHTED_STATUS}
"Bindings: python bindings require Python, but it could not be found"
FATAL_ERROR
"Bindings: python bindings require Python, but it could not be found"
)
else()
check_python_packages("pybindgen" missing_packages)
if(missing_packages)
message(
${HIGHLIGHTED_STATUS}
"Bindings: python bindings disabled due to the following missing dependencies: ${missing_packages}"
FATAL_ERROR
"Bindings: python bindings disabled due to the following missing dependencies: ${missing_packages}"
)
else()
set(ENABLE_PYTHON_BINDINGS ON)
@@ -786,8 +786,8 @@ macro(process_options)
if(${NS3_SCAN_PYTHON_BINDINGS})
if(NOT ${Python3_FOUND})
message(
${HIGHLIGHTED_STATUS}
"Bindings: scanning python bindings require Python, but it could not be found"
FATAL_ERROR
"Bindings: scanning python bindings require Python, but it could not be found"
)
else()
# Check if pybindgen, pygccxml, cxxfilt and castxml are installed
@@ -808,8 +808,8 @@ macro(process_options)
# If packages were not found, print message
if(missing_packages)
message(
${HIGHLIGHTED_STATUS}
"Bindings: scanning of python bindings disabled due to the following missing dependencies: ${missing_packages}"
FATAL_ERROR
"Bindings: scanning of python bindings disabled due to the following missing dependencies: ${missing_packages}"
)
else()
set(ENABLE_SCAN_PYTHON_BINDINGS ON)
@@ -862,7 +862,7 @@ macro(process_options)
if(${NS3_MPI})
find_package(MPI QUIET)
if(NOT ${MPI_FOUND})
message(${HIGHLIGHTED_STATUS} "MPI was not found. Continuing without it.")
message(FATAL_ERROR "MPI was not found.")
else()
message(STATUS "MPI was found.")
add_definitions(-DNS3_MPI)

View File

@@ -86,15 +86,21 @@ if(${THREADS_ENABLED}
""
)
if(${NS3_DPDK}
AND PKG_CONFIG_FOUND
AND DPDK_FOUND
)
set(ENABLE_DPDKDEVNET
True
CACHE INTERNAL
""
)
if(${NS3_DPDK})
if(PKG_CONFIG_FOUND)
if(DPDK_FOUND)
set(ENABLE_DPDKDEVNET
True
CACHE INTERNAL
""
)
else()
message(FATAL_ERROR "DPDK not found.")
endif()
else()
message(FATAL_ERROR "Pkgconfig was not found and is required by DPDK.")
endif()
endif()
if(HAVE_IF_NETS_H