From 55c36d804513a692627396c5e4093e8c2e3ec161 Mon Sep 17 00:00:00 2001 From: Gabriel Ferreira Date: Sat, 16 Apr 2022 23:49:59 -0300 Subject: [PATCH] build: throw error when DPDK/MPI/Python bindings dependencies are unmet --- build-support/macros-and-definitions.cmake | 18 ++++++++-------- src/fd-net-device/CMakeLists.txt | 24 ++++++++++++++-------- 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/build-support/macros-and-definitions.cmake b/build-support/macros-and-definitions.cmake index 8dae33a04..06617c212 100644 --- a/build-support/macros-and-definitions.cmake +++ b/build-support/macros-and-definitions.cmake @@ -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) diff --git a/src/fd-net-device/CMakeLists.txt b/src/fd-net-device/CMakeLists.txt index 6f072e75c..75dc4f15b 100644 --- a/src/fd-net-device/CMakeLists.txt +++ b/src/fd-net-device/CMakeLists.txt @@ -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